Spaces:
Running
Running
Updated the chart title
Browse files
app.py
CHANGED
|
@@ -164,12 +164,12 @@ def run_backtest(data, params, use_rsi, use_volatility, use_trend, use_volume, r
|
|
| 164 |
return 0, 0, 0, 0, None, ([], [], [], []), []
|
| 165 |
df['large_ma'] = df['Close'].rolling(window=params['large_ma_period']).mean()
|
| 166 |
|
| 167 |
-
# ---
|
| 168 |
indicator_bb = BollingerBands(close=df['Close'], window=params['bband_period'], window_dev=params['bband_std_dev'])
|
| 169 |
df['bband_lower'] = indicator_bb.bollinger_lband()
|
| 170 |
df['bband_upper'] = indicator_bb.bollinger_hband()
|
| 171 |
|
| 172 |
-
# ---
|
| 173 |
indicator_rsi = RSIIndicator(close=df['Close'], window=14)
|
| 174 |
df['RSI'] = indicator_rsi.rsi()
|
| 175 |
|
|
|
|
| 164 |
return 0, 0, 0, 0, None, ([], [], [], []), []
|
| 165 |
df['large_ma'] = df['Close'].rolling(window=params['large_ma_period']).mean()
|
| 166 |
|
| 167 |
+
# --- CORRECTED: Calculate Bollinger Bands using the 'ta' library ---
|
| 168 |
indicator_bb = BollingerBands(close=df['Close'], window=params['bband_period'], window_dev=params['bband_std_dev'])
|
| 169 |
df['bband_lower'] = indicator_bb.bollinger_lband()
|
| 170 |
df['bband_upper'] = indicator_bb.bollinger_hband()
|
| 171 |
|
| 172 |
+
# --- CORRECTED: Calculate RSI using the 'ta' library ---
|
| 173 |
indicator_rsi = RSIIndicator(close=df['Close'], window=14)
|
| 174 |
df['RSI'] = indicator_rsi.rsi()
|
| 175 |
|