JayLacoma commited on
Commit
db0cb1a
·
verified ·
1 Parent(s): a0effa1

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -357,11 +357,11 @@ def generate_trading_signals(df):
357
  df['BB_Signal'] = np.where(df['Close'] >= df['UpperBB'], -1, df['BB_Signal'])
358
 
359
  # Less strict Stochastic Signal - Standard overbought/oversold (20/80 instead of 10/95)
360
- df['Stochastic_Signal'] = np.where((df['SlowK'] < 20) & (df['SlowD'] < 20), 1, 0)
361
- df['Stochastic_Signal'] = np.where((df['SlowK'] > 90) & (df['SlowD'] > 90), -1, df['Stochastic_Signal'])
362
 
363
  # Less strict CMF Signal - Use ±0.1 instead of ±0.4
364
- df['CMF_Signal'] = np.where(df['CMF'] > 0.1, -1, np.where(df['CMF'] < -0.1, 1, 0))
365
 
366
  # Less strict CCI Signal - Standard thresholds (±100 instead of ±220)
367
  df['CCI_Signal'] = np.where(df['CCI'] < -100, 1, 0)
 
357
  df['BB_Signal'] = np.where(df['Close'] >= df['UpperBB'], -1, df['BB_Signal'])
358
 
359
  # Less strict Stochastic Signal - Standard overbought/oversold (20/80 instead of 10/95)
360
+ df['Stochastic_Signal'] = np.where((df['SlowK'] < 30) & (df['SlowD'] < 30), 1, 0)
361
+ df['Stochastic_Signal'] = np.where((df['SlowK'] > 100) & (df['SlowD'] > 100), -1, df['Stochastic_Signal'])
362
 
363
  # Less strict CMF Signal - Use ±0.1 instead of ±0.4
364
+ df['CMF_Signal'] = np.where(df['CMF'] > 0.3, -1, np.where(df['CMF'] < -0.3, 1, 0))
365
 
366
  # Less strict CCI Signal - Standard thresholds (±100 instead of ±220)
367
  df['CCI_Signal'] = np.where(df['CCI'] < -100, 1, 0)