-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathshow_bias.py
More file actions
46 lines (38 loc) · 1.32 KB
/
Copy pathshow_bias.py
File metadata and controls
46 lines (38 loc) · 1.32 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
"""Print the current NASDAQ BIAS as it would appear in Telegram."""
import sys
from pathlib import Path
sys.path.insert(0, str(Path(__file__).parent))
from nasdaq_scanner import fetch_indicators, calculate_bias
from datetime import datetime
indicators = fetch_indicators()
bias, score, details = calculate_bias(indicators)
now = datetime.now().strftime("%d/%m/%Y %H:%M")
sep = "=" * 45
print(sep)
print(f" NASDAQ DAILY BIAS | {now}")
print(sep)
print()
print("[ LIVE INDICATORS ]")
print(f" DXY : {indicators['DXY']['value']:>8} ({indicators['DXY']['change_pct']:+.2f}%)")
print(f" VIX : {indicators['VIX']['value']:>8} ({indicators['VIX']['change_pct']:+.2f}%)")
print(f" NDX : {indicators['NDX']['value']:>8} ({indicators['NDX']['change_pct']:+.2f}%)")
print(f" SPX : {indicators['SPX']['value']:>8} ({indicators['SPX']['change_pct']:+.2f}%)")
print(f" 10Y : {indicators['10Y']['value']:>8}% ({indicators['10Y']['change_pct']:+.2f}%)")
print()
print(f"[ BIAS: {bias} ]")
print(f" Score : {score}/3")
for d in details:
print(f" - {d}")
print()
if "BULLISH" in bias.upper():
symbol = "^^^"
elif "BEARISH" in bias.upper():
symbol = "vvv"
else:
symbol = "---"
print(f" {symbol} {bias} {symbol}")
print()
print(sep)
print(" This is what Telegram receives")
print(" once BOT_TOKEN + CHAT_ID are set.")
print(sep)