diff --git a/dashboard.py b/dashboard.py index 96348d9..83150ee 100644 --- a/dashboard.py +++ b/dashboard.py @@ -28,7 +28,7 @@ signal_functions: List[Dict[str, SignalFunction]] = [ symbol = 'SPY' today = datetime.today() -data = ohlc(symbol = symbol, start_date = today - timedelta(days = 180), end_date = today) +data = ohlc(symbol = symbol, start_date = today - timedelta(days = 365), end_date = today) def calculate_signals(days: int = 12) -> DataFrame: signal_data = [] @@ -46,12 +46,13 @@ def calculate_signals(days: int = 12) -> DataFrame: return DataFrame(signal_data) def load_chart() -> dict: + chart_data = data.tail(180) candlestick_chart = CandlestickChart( - x = data['Date'], - opens = data['Open'], - highs = data['High'], - lows = data['Low'], - closes = data['Close'] + x = chart_data['Date'], + opens = chart_data['Open'], + highs = chart_data['High'], + lows = chart_data['Low'], + closes = chart_data['Close'] ) return figure_with_subplots([[candlestick_chart]])