Skip to content

Commit 34f10f5

Browse files
authored
Merge pull request #2 from merdan-9/main
Fix Yahoo Finance 1w Timeframe Error
2 parents 67650aa + dffb8c4 commit 34f10f5

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

web_interface.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,6 @@ def __init__(self):
5555
'DXY': 'DX-Y.NYB', # US Dollar Index
5656
}
5757

58-
# Available timeframes
59-
self.timeframes = ['1m', '5m', '15m', '30m', '1h', '4h', '1d']
60-
6158
# Yahoo Finance interval mapping
6259
self.yfinance_intervals = {
6360
'1m': '1m',
@@ -66,7 +63,9 @@ def __init__(self):
6663
'30m': '30m',
6764
'1h': '1h',
6865
'4h': '4h', # yfinance supports 4h natively!
69-
'1d': '1d'
66+
'1d': '1d',
67+
'1w': '1wk',
68+
'1mo': '1mo'
7069
}
7170

7271
# Load persisted custom assets
@@ -265,6 +264,10 @@ def run_analysis(self, df: pd.DataFrame, asset_name: str, timeframe: str) -> Dic
265264
display_timeframe += 'in'
266265
elif timeframe.endswith('d'):
267266
display_timeframe += 'ay'
267+
elif timeframe == '1w':
268+
display_timeframe = '1 week'
269+
elif timeframe == '1mo':
270+
display_timeframe = '1 month'
268271

269272
# Create initial state
270273
initial_state = {
@@ -387,6 +390,7 @@ def get_timeframe_date_limits(self, timeframe: str) -> Dict[str, Any]:
387390
"4h": {"max_days": 730, "description": "4 hour data: max 730 days"},
388391
"1d": {"max_days": 730, "description": "1 day data: max 730 days"},
389392
"5d": {"max_days": 60, "description": "5 day data: max 60 days"},
393+
"1w": {"max_days": 730, "description": "1 week data: max 730 days"},
390394
"1wk": {"max_days": 730, "description": "1 week data: max 730 days"},
391395
"1mo": {"max_days": 730, "description": "1 month data: max 730 days"},
392396
"3mo": {"max_days": 730, "description": "3 month data: max 730 days"}

0 commit comments

Comments
 (0)