Skip to content

Commit f49ebdb

Browse files
committed
there are some places where i forgot to add the centralized point of paths to them. fixed (I think) most of them.
1 parent 3bffb1d commit f49ebdb

File tree

3 files changed

+115
-3
lines changed

3 files changed

+115
-3
lines changed

logs/terminal_output.log

Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,3 +143,105 @@ Markets are closed today: 09/01/2025 - Monday
143143
Waiting until tomorrow's 8:20 AM...
144144
Manually interrupted, cleaning up...
145145
Discord bot started.
146+
Starting the main trading bot...
147+
[INFO] Running initial_setup and main_loop at 2025-09-01 21:15:42
148+
[EMA STATE] Hard reset for TFs: 2M, 5M, 15M
149+
We have logged in as TradeMaster#8429
150+
151+
[DATA_AQUISITION] 'is_market_open()' DATA:
152+
{'afterHours': False, 'currencies': {'crypto': 'open', 'fx': 'open'}, 'earlyHours': False, 'exchanges': {'nasdaq': 'closed', 'nyse': 'closed', 'otc': 'closed'}, 'indicesGroups': {'s_and_p': 'closed', 'societe_generale': 'closed', 'msci': 'closed', 'ftse_russell': 'closed', 'mstar': 'closed', 'mstarc': 'closed', 'cccy': 'open', 'cgi': 'closed', 'nasdaq': 'closed', 'dow_jones': 'closed'}, 'market': 'closed', 'serverTime': '2025-09-01T21:15:49-04:00'}
153+
154+
Markets are closed today: 09/01/2025 - Monday
155+
[INFO] initial_setup and main_loop completed successfully.
156+
Waiting until tomorrow's 8:20 AM...
157+
Manually interrupted, cleaning up...
158+
Discord bot started.
159+
Starting the main trading bot...
160+
[INFO] Running initial_setup and main_loop at 2025-09-01 21:26:45
161+
[EMA STATE] Hard reset for TFs: 2M, 5M, 15M
162+
We have logged in as TradeMaster#8429
163+
164+
[DATA_AQUISITION] 'is_market_open()' DATA:
165+
{'afterHours': False, 'currencies': {'crypto': 'open', 'fx': 'open'}, 'earlyHours': False, 'exchanges': {'nasdaq': 'closed', 'nyse': 'closed', 'otc': 'closed'}, 'indicesGroups': {'s_and_p': 'closed', 'societe_generale': 'closed', 'msci': 'closed', 'ftse_russell': 'closed', 'mstar': 'closed', 'mstarc': 'closed', 'cccy': 'open', 'cgi': 'closed', 'nasdaq': 'closed', 'dow_jones': 'closed'}, 'market': 'closed', 'serverTime': '2025-09-01T21:26:52-04:00'}
166+
167+
Markets are closed today: 09/01/2025 - Monday
168+
[INFO] initial_setup and main_loop completed successfully.
169+
Waiting until tomorrow's 8:20 AM...
170+
Manually interrupted, cleaning up...
171+
Discord bot started.
172+
Starting the main trading bot...
173+
[INFO] Running initial_setup and main_loop at 2025-09-01 21:31:31
174+
[EMA STATE] Hard reset for TFs: 2M, 5M, 15M
175+
We have logged in as TradeMaster#8429
176+
177+
[DATA_AQUISITION] 'is_market_open()' DATA:
178+
{'afterHours': False, 'currencies': {'crypto': 'open', 'fx': 'open'}, 'earlyHours': False, 'exchanges': {'nasdaq': 'closed', 'nyse': 'closed', 'otc': 'closed'}, 'indicesGroups': {'s_and_p': 'closed', 'societe_generale': 'closed', 'msci': 'closed', 'ftse_russell': 'closed', 'mstar': 'closed', 'mstarc': 'closed', 'cccy': 'open', 'cgi': 'closed', 'nasdaq': 'closed', 'dow_jones': 'closed'}, 'market': 'closed', 'serverTime': '2025-09-01T21:31:37-04:00'}
179+
180+
Markets are closed today: 09/01/2025 - Monday
181+
[INFO] initial_setup and main_loop completed successfully.
182+
Waiting until tomorrow's 8:20 AM...
183+
Manually interrupted, cleaning up...
184+
Discord bot started.
185+
Starting the main trading bot...
186+
[INFO] Running initial_setup and main_loop at 2025-09-01 21:32:53
187+
[EMA STATE] Hard reset for TFs: 2M, 5M, 15M
188+
We have logged in as TradeMaster#8429
189+
190+
[DATA_AQUISITION] 'is_market_open()' DATA:
191+
{'afterHours': False, 'currencies': {'crypto': 'open', 'fx': 'open'}, 'earlyHours': False, 'exchanges': {'nasdaq': 'closed', 'nyse': 'closed', 'otc': 'closed'}, 'indicesGroups': {'s_and_p': 'closed', 'societe_generale': 'closed', 'msci': 'closed', 'ftse_russell': 'closed', 'mstar': 'closed', 'mstarc': 'closed', 'cccy': 'open', 'cgi': 'closed', 'nasdaq': 'closed', 'dow_jones': 'closed'}, 'market': 'closed', 'serverTime': '2025-09-01T21:32:59-04:00'}
192+
193+
Markets are closed today: 09/01/2025 - Monday
194+
[INFO] initial_setup and main_loop completed successfully.
195+
Waiting until tomorrow's 8:20 AM...
196+
Manually interrupted, cleaning up...
197+
Discord bot started.
198+
Starting the main trading bot...
199+
[INFO] Running initial_setup and main_loop at 2025-09-01 21:43:43
200+
[EMA STATE] Hard reset for TFs: 2M, 5M, 15M
201+
We have logged in as TradeMaster#8429
202+
203+
[DATA_AQUISITION] 'is_market_open()' DATA:
204+
{'afterHours': False, 'currencies': {'crypto': 'open', 'fx': 'open'}, 'earlyHours': False, 'exchanges': {'nasdaq': 'closed', 'nyse': 'closed', 'otc': 'closed'}, 'indicesGroups': {'s_and_p': 'closed', 'societe_generale': 'closed', 'msci': 'closed', 'ftse_russell': 'closed', 'mstar': 'closed', 'mstarc': 'closed', 'cccy': 'open', 'cgi': 'closed', 'nasdaq': 'closed', 'dow_jones': 'closed'}, 'market': 'closed', 'serverTime': '2025-09-01T21:43:48-04:00'}
205+
206+
Markets are closed today: 09/01/2025 - Monday
207+
[INFO] initial_setup and main_loop completed successfully.
208+
Waiting until tomorrow's 8:20 AM...
209+
Manually interrupted, cleaning up...
210+
Discord bot started.
211+
Starting the main trading bot...
212+
[INFO] Running initial_setup and main_loop at 2025-09-01 21:45:26
213+
[EMA STATE] Hard reset for TFs: 2M, 5M, 15M
214+
We have logged in as TradeMaster#8429
215+
216+
[DATA_AQUISITION] 'is_market_open()' DATA:
217+
{'afterHours': False, 'currencies': {'crypto': 'open', 'fx': 'open'}, 'earlyHours': False, 'exchanges': {'nasdaq': 'closed', 'nyse': 'closed', 'otc': 'closed'}, 'indicesGroups': {'s_and_p': 'closed', 'societe_generale': 'closed', 'msci': 'closed', 'ftse_russell': 'closed', 'mstar': 'closed', 'mstarc': 'closed', 'cccy': 'open', 'cgi': 'closed', 'nasdaq': 'closed', 'dow_jones': 'closed'}, 'market': 'closed', 'serverTime': '2025-09-01T21:45:32-04:00'}
218+
219+
Markets are closed today: 09/01/2025 - Monday
220+
[INFO] initial_setup and main_loop completed successfully.
221+
Waiting until tomorrow's 8:20 AM...
222+
Manually interrupted, cleaning up...
223+
Discord bot started.
224+
Starting the main trading bot...
225+
[INFO] Running initial_setup and main_loop at 2025-09-01 21:46:10
226+
[EMA STATE] Hard reset for TFs: 2M, 5M, 15M
227+
We have logged in as TradeMaster#8429
228+
229+
[DATA_AQUISITION] 'is_market_open()' DATA:
230+
{'afterHours': False, 'currencies': {'crypto': 'open', 'fx': 'open'}, 'earlyHours': False, 'exchanges': {'nasdaq': 'closed', 'nyse': 'closed', 'otc': 'closed'}, 'indicesGroups': {'s_and_p': 'closed', 'societe_generale': 'closed', 'msci': 'closed', 'ftse_russell': 'closed', 'mstar': 'closed', 'mstarc': 'closed', 'cccy': 'open', 'cgi': 'closed', 'nasdaq': 'closed', 'dow_jones': 'closed'}, 'market': 'closed', 'serverTime': '2025-09-01T21:46:17-04:00'}
231+
232+
Markets are closed today: 09/01/2025 - Monday
233+
[INFO] initial_setup and main_loop completed successfully.
234+
Waiting until tomorrow's 8:20 AM...
235+
Manually interrupted, cleaning up...
236+
Discord bot started.
237+
Starting the main trading bot...
238+
[INFO] Running initial_setup and main_loop at 2025-09-01 21:47:17
239+
[EMA STATE] Hard reset for TFs: 2M, 5M, 15M
240+
We have logged in as TradeMaster#8429
241+
242+
[DATA_AQUISITION] 'is_market_open()' DATA:
243+
{'afterHours': False, 'currencies': {'crypto': 'open', 'fx': 'open'}, 'earlyHours': False, 'exchanges': {'nasdaq': 'closed', 'nyse': 'closed', 'otc': 'closed'}, 'indicesGroups': {'s_and_p': 'closed', 'societe_generale': 'closed', 'msci': 'closed', 'ftse_russell': 'closed', 'mstar': 'closed', 'mstarc': 'closed', 'cccy': 'open', 'cgi': 'closed', 'nasdaq': 'closed', 'dow_jones': 'closed'}, 'market': 'closed', 'serverTime': '2025-09-01T21:47:23-04:00'}
244+
245+
Markets are closed today: 09/01/2025 - Monday
246+
[INFO] initial_setup and main_loop completed successfully.
247+
Waiting until tomorrow's 8:20 AM...

paths.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,16 @@ def get_merged_ema_csv_path(timeframe: str): # This i
5959
SPY_15M_CHART_PATH = IMAGES_DIR / 'SPY_15M_chart.png' # Live chart
6060
SPY_15M_ZONE_CHART_PATH = IMAGES_DIR / 'SPY_15M-zone_chart.png' # Historical chart (Zones and levels)
6161

62+
def get_chart_path(timeframe: str, zone_type: bool = False) -> Path:
63+
"""
64+
Returns the path to the chart image for a given timeframe.
65+
Example:
66+
get_chart_path("2M") → storage/images/SPY_2M_chart.png
67+
get_chart_path("15M", True) → storage/images/SPY_15M-zone_chart.png
68+
"""
69+
suffix = "-zone" if zone_type else ""
70+
return IMAGES_DIR / f"SPY_{timeframe}{suffix}_chart.png"
71+
6272

6373
def pretty_path(path: Path, short: bool = True): # We print alot of stuff in terminal and a long path string is pointless and a pretty version of the path is more readable in terminal logs.
6474
from paths import BASE

web_dash/chart_updater.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# web_dash/chart_updater.py
2-
from pathlib import Path
2+
from paths import get_chart_path, pretty_path
33
import plotly.graph_objects as go
44
import plotly.io as pio
55
from web_dash.charts.live_chart import generate_live_chart
@@ -19,7 +19,7 @@ def update_chart(timeframe="2M", chart_type="live", notify=False):
1919
# Build a clean figure for static export
2020
if chart_type == "zones":
2121
fig = _as_figure(generate_zones_chart())
22-
out = Path(f"storage/SPY_{timeframe}-zone_chart.png") # keep your naming
22+
out = get_chart_path(timeframe, zone_type=True)
2323

2424
# Guardrails for zones (categorical x)
2525
fig.update_layout(
@@ -29,7 +29,7 @@ def update_chart(timeframe="2M", chart_type="live", notify=False):
2929
)
3030
elif chart_type == "live":
3131
fig = _as_figure(generate_live_chart(timeframe))
32-
out = Path(f"storage/SPY_{timeframe}_chart.png")
32+
out = get_chart_path(timeframe)
3333

3434
# Guardrails for live (datetime x)
3535
fig.update_layout(

0 commit comments

Comments
 (0)