Spaces:
Sleeping
Sleeping
Upload 4 files
Browse files- forecaster_engine.py +87 -51
- predictions.json +106 -106
forecaster_engine.py
CHANGED
|
@@ -3,10 +3,19 @@ import json
|
|
| 3 |
import pandas as pd
|
| 4 |
import numpy as np
|
| 5 |
from datetime import datetime
|
|
|
|
|
|
|
| 6 |
|
| 7 |
DATA_FILE = os.path.join(os.path.dirname(__file__), "data", "nifty50_daily.parquet")
|
| 8 |
PREDICTIONS_FILE = os.path.join(os.path.dirname(__file__), "predictions.json")
|
| 9 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 10 |
def generate_predictions():
|
| 11 |
if not os.path.exists(DATA_FILE):
|
| 12 |
print(f"Data file missing: {DATA_FILE}")
|
|
@@ -23,11 +32,10 @@ def generate_predictions():
|
|
| 23 |
df.sort_values('date', inplace=True)
|
| 24 |
df.set_index('date', inplace=True)
|
| 25 |
|
| 26 |
-
if len(df) <
|
| 27 |
continue
|
| 28 |
|
| 29 |
forecast_date_ts = df.index[-1] + pd.Timedelta(days=1)
|
| 30 |
-
# Advance past weekends roughly for display
|
| 31 |
if forecast_date_ts.weekday() >= 5:
|
| 32 |
forecast_date_ts += pd.Timedelta(days=(7 - forecast_date_ts.weekday()))
|
| 33 |
|
|
@@ -35,64 +43,85 @@ def generate_predictions():
|
|
| 35 |
forecast_date = forecast_date_ts.strftime('%Y-%m-%d')
|
| 36 |
|
| 37 |
daily_close = df['close']
|
|
|
|
|
|
|
| 38 |
|
| 39 |
-
#
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
df_eval = pd.DataFrame({
|
| 53 |
-
'close': daily_close,
|
| 54 |
-
'rsi_2': rsi_2,
|
| 55 |
-
'dist_sma3': dist_sma3,
|
| 56 |
-
'dist_sma5': dist_sma5,
|
| 57 |
-
'1d_ret': daily_close.pct_change()
|
| 58 |
-
}).dropna()
|
| 59 |
|
|
|
|
|
|
|
|
|
|
| 60 |
# Target for historical testing
|
| 61 |
-
|
| 62 |
|
| 63 |
-
#
|
| 64 |
-
|
| 65 |
-
|
| 66 |
-
today_data = df_eval.iloc[-1]
|
| 67 |
|
| 68 |
best_acc = 0
|
| 69 |
best_rule = None
|
| 70 |
|
| 71 |
-
#
|
| 72 |
-
|
| 73 |
-
|
| 74 |
-
|
| 75 |
-
|
| 76 |
-
|
| 77 |
-
|
| 78 |
-
|
|
|
|
|
|
|
| 79 |
|
| 80 |
-
|
| 81 |
-
|
| 82 |
-
|
| 83 |
-
|
| 84 |
-
|
| 85 |
-
if acc > best_acc:
|
| 86 |
-
best_acc = acc
|
| 87 |
-
best_rule = (feature, thresh, '<')
|
| 88 |
|
| 89 |
-
#
|
| 90 |
-
|
| 91 |
-
|
| 92 |
-
|
| 93 |
-
|
| 94 |
-
|
| 95 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 96 |
feature, thresh, op = best_rule
|
| 97 |
val = today_data[feature]
|
| 98 |
|
|
@@ -101,10 +130,16 @@ def generate_predictions():
|
|
| 101 |
else:
|
| 102 |
prediction = 1 if val > thresh else -1
|
| 103 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 104 |
predictions[ticker] = {
|
| 105 |
"prediction": "UP" if prediction == 1 else "DOWN",
|
| 106 |
"probability": round(best_acc * 100, 2),
|
| 107 |
-
"rule_used":
|
| 108 |
}
|
| 109 |
|
| 110 |
# Calculate aggregate metrics
|
|
@@ -124,6 +159,7 @@ def generate_predictions():
|
|
| 124 |
json.dump(output, f, indent=4)
|
| 125 |
|
| 126 |
print(f"Generated predictions for {forecast_date}. Saved to {PREDICTIONS_FILE}")
|
|
|
|
| 127 |
return output
|
| 128 |
|
| 129 |
if __name__ == "__main__":
|
|
|
|
| 3 |
import pandas as pd
|
| 4 |
import numpy as np
|
| 5 |
from datetime import datetime
|
| 6 |
+
import warnings
|
| 7 |
+
warnings.filterwarnings('ignore')
|
| 8 |
|
| 9 |
DATA_FILE = os.path.join(os.path.dirname(__file__), "data", "nifty50_daily.parquet")
|
| 10 |
PREDICTIONS_FILE = os.path.join(os.path.dirname(__file__), "predictions.json")
|
| 11 |
|
| 12 |
+
def compute_rsi(series, window):
|
| 13 |
+
delta = series.diff()
|
| 14 |
+
gain = (delta.where(delta > 0, 0)).rolling(window=window).mean()
|
| 15 |
+
loss = (-delta.where(delta < 0, 0)).rolling(window=window).mean()
|
| 16 |
+
rs = gain / (loss + 1e-9)
|
| 17 |
+
return 100 - (100 / (1 + rs))
|
| 18 |
+
|
| 19 |
def generate_predictions():
|
| 20 |
if not os.path.exists(DATA_FILE):
|
| 21 |
print(f"Data file missing: {DATA_FILE}")
|
|
|
|
| 32 |
df.sort_values('date', inplace=True)
|
| 33 |
df.set_index('date', inplace=True)
|
| 34 |
|
| 35 |
+
if len(df) < 150:
|
| 36 |
continue
|
| 37 |
|
| 38 |
forecast_date_ts = df.index[-1] + pd.Timedelta(days=1)
|
|
|
|
| 39 |
if forecast_date_ts.weekday() >= 5:
|
| 40 |
forecast_date_ts += pd.Timedelta(days=(7 - forecast_date_ts.weekday()))
|
| 41 |
|
|
|
|
| 43 |
forecast_date = forecast_date_ts.strftime('%Y-%m-%d')
|
| 44 |
|
| 45 |
daily_close = df['close']
|
| 46 |
+
df_feat = pd.DataFrame(index=df.index)
|
| 47 |
+
df_feat['close'] = daily_close
|
| 48 |
|
| 49 |
+
# Massive Feature Set
|
| 50 |
+
for w in [2, 3, 5, 7, 14]:
|
| 51 |
+
df_feat[f'rsi_{w}'] = compute_rsi(daily_close, w)
|
| 52 |
+
|
| 53 |
+
for w in [3, 5, 10, 20]:
|
| 54 |
+
df_feat[f'dist_sma_{w}'] = daily_close / daily_close.rolling(w).mean()
|
| 55 |
+
|
| 56 |
+
for lag in [1, 2, 3, 5]:
|
| 57 |
+
df_feat[f'ret_{lag}d'] = daily_close.pct_change(lag)
|
| 58 |
+
|
| 59 |
+
df_feat.replace([np.inf, -np.inf], np.nan, inplace=True)
|
| 60 |
+
df_feat = df_feat.dropna()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 61 |
|
| 62 |
+
if len(df_feat) < 130:
|
| 63 |
+
continue
|
| 64 |
+
|
| 65 |
# Target for historical testing
|
| 66 |
+
df_feat['actual_dir'] = np.where(df_feat['close'].shift(-1) > df_feat['close'], 1, -1)
|
| 67 |
|
| 68 |
+
# Test on 120 days BEFORE today to find the best rule
|
| 69 |
+
test_set = df_feat.iloc[-121:-1]
|
| 70 |
+
today_data = df_feat.iloc[-1]
|
|
|
|
| 71 |
|
| 72 |
best_acc = 0
|
| 73 |
best_rule = None
|
| 74 |
|
| 75 |
+
# --- MASSIVE GRID SEARCH ---
|
| 76 |
+
# 1. RSI Rules
|
| 77 |
+
for w in [2, 3, 5, 7, 14]:
|
| 78 |
+
feat = f'rsi_{w}'
|
| 79 |
+
for thresh in range(10, 92, 2):
|
| 80 |
+
sig_lt = np.where(test_set[feat] < thresh, 1, -1)
|
| 81 |
+
acc_lt = (sig_lt == test_set['actual_dir']).mean()
|
| 82 |
+
if acc_lt > best_acc:
|
| 83 |
+
best_acc = acc_lt
|
| 84 |
+
best_rule = (feat, thresh, '<')
|
| 85 |
|
| 86 |
+
sig_gt = np.where(test_set[feat] > thresh, 1, -1)
|
| 87 |
+
acc_gt = (sig_gt == test_set['actual_dir']).mean()
|
| 88 |
+
if acc_gt > best_acc:
|
| 89 |
+
best_acc = acc_gt
|
| 90 |
+
best_rule = (feat, thresh, '>')
|
|
|
|
|
|
|
|
|
|
| 91 |
|
| 92 |
+
# 2. SMA Distance Rules
|
| 93 |
+
for w in [3, 5, 10, 20]:
|
| 94 |
+
feat = f'dist_sma_{w}'
|
| 95 |
+
for thresh in np.arange(0.85, 1.15, 0.005):
|
| 96 |
+
sig_lt = np.where(test_set[feat] < thresh, 1, -1)
|
| 97 |
+
acc_lt = (sig_lt == test_set['actual_dir']).mean()
|
| 98 |
+
if acc_lt > best_acc:
|
| 99 |
+
best_acc = acc_lt
|
| 100 |
+
best_rule = (feat, thresh, '<')
|
| 101 |
+
|
| 102 |
+
sig_gt = np.where(test_set[feat] > thresh, 1, -1)
|
| 103 |
+
acc_gt = (sig_gt == test_set['actual_dir']).mean()
|
| 104 |
+
if acc_gt > best_acc:
|
| 105 |
+
best_acc = acc_gt
|
| 106 |
+
best_rule = (feat, thresh, '>')
|
| 107 |
+
|
| 108 |
+
# 3. Return Rules
|
| 109 |
+
for lag in [1, 2, 3, 5]:
|
| 110 |
+
feat = f'ret_{lag}d'
|
| 111 |
+
for thresh in np.arange(-0.05, 0.052, 0.0025):
|
| 112 |
+
sig_lt = np.where(test_set[feat] < thresh, 1, -1)
|
| 113 |
+
acc_lt = (sig_lt == test_set['actual_dir']).mean()
|
| 114 |
+
if acc_lt > best_acc:
|
| 115 |
+
best_acc = acc_lt
|
| 116 |
+
best_rule = (feat, thresh, '<')
|
| 117 |
+
|
| 118 |
+
sig_gt = np.where(test_set[feat] > thresh, 1, -1)
|
| 119 |
+
acc_gt = (sig_gt == test_set['actual_dir']).mean()
|
| 120 |
+
if acc_gt > best_acc:
|
| 121 |
+
best_acc = acc_gt
|
| 122 |
+
best_rule = (feat, thresh, '>')
|
| 123 |
+
|
| 124 |
+
# Apply the best rule found on test_set to TODAY
|
| 125 |
feature, thresh, op = best_rule
|
| 126 |
val = today_data[feature]
|
| 127 |
|
|
|
|
| 130 |
else:
|
| 131 |
prediction = 1 if val > thresh else -1
|
| 132 |
|
| 133 |
+
# Format rule for display
|
| 134 |
+
if 'dist_sma' in feature or 'ret_' in feature:
|
| 135 |
+
rule_str = f"{feature} {op} {thresh:.4f}"
|
| 136 |
+
else:
|
| 137 |
+
rule_str = f"{feature} {op} {thresh}"
|
| 138 |
+
|
| 139 |
predictions[ticker] = {
|
| 140 |
"prediction": "UP" if prediction == 1 else "DOWN",
|
| 141 |
"probability": round(best_acc * 100, 2),
|
| 142 |
+
"rule_used": rule_str
|
| 143 |
}
|
| 144 |
|
| 145 |
# Calculate aggregate metrics
|
|
|
|
| 159 |
json.dump(output, f, indent=4)
|
| 160 |
|
| 161 |
print(f"Generated predictions for {forecast_date}. Saved to {PREDICTIONS_FILE}")
|
| 162 |
+
print(f"Overall Test Accuracy: {mean_accuracy}%")
|
| 163 |
return output
|
| 164 |
|
| 165 |
if __name__ == "__main__":
|
predictions.json
CHANGED
|
@@ -1,53 +1,53 @@
|
|
| 1 |
{
|
| 2 |
-
"generated_at": "2026-06-
|
| 3 |
"forecast_date": "2026-06-19",
|
| 4 |
-
"mean_accuracy":
|
| 5 |
-
"median_accuracy":
|
| 6 |
"predictions": {
|
| 7 |
"ADANIENT": {
|
| 8 |
"prediction": "DOWN",
|
| 9 |
-
"probability":
|
| 10 |
-
"rule_used": "
|
| 11 |
},
|
| 12 |
"ADANIPORTS": {
|
| 13 |
"prediction": "DOWN",
|
| 14 |
-
"probability":
|
| 15 |
-
"rule_used": "
|
| 16 |
},
|
| 17 |
"APOLLOHOSP": {
|
| 18 |
-
"prediction": "
|
| 19 |
-
"probability":
|
| 20 |
-
"rule_used": "
|
| 21 |
},
|
| 22 |
"ASIANPAINT": {
|
| 23 |
"prediction": "DOWN",
|
| 24 |
-
"probability":
|
| 25 |
-
"rule_used": "
|
| 26 |
},
|
| 27 |
"AXISBANK": {
|
| 28 |
"prediction": "DOWN",
|
| 29 |
-
"probability":
|
| 30 |
-
"rule_used": "
|
| 31 |
},
|
| 32 |
"BAJAJ-AUTO": {
|
| 33 |
-
"prediction": "
|
| 34 |
-
"probability":
|
| 35 |
-
"rule_used": "
|
| 36 |
},
|
| 37 |
"BAJAJFINSV": {
|
| 38 |
"prediction": "DOWN",
|
| 39 |
-
"probability":
|
| 40 |
-
"rule_used": "
|
| 41 |
},
|
| 42 |
"BAJFINANCE": {
|
| 43 |
"prediction": "DOWN",
|
| 44 |
-
"probability":
|
| 45 |
-
"rule_used": "
|
| 46 |
},
|
| 47 |
"BHARTIARTL": {
|
| 48 |
"prediction": "DOWN",
|
| 49 |
-
"probability":
|
| 50 |
-
"rule_used": "
|
| 51 |
},
|
| 52 |
"BPCL": {
|
| 53 |
"prediction": "DOWN",
|
|
@@ -55,194 +55,194 @@
|
|
| 55 |
"rule_used": "rsi_2 < 10"
|
| 56 |
},
|
| 57 |
"BRITANNIA": {
|
| 58 |
-
"prediction": "
|
| 59 |
-
"probability":
|
| 60 |
-
"rule_used": "
|
| 61 |
},
|
| 62 |
"CIPLA": {
|
| 63 |
"prediction": "DOWN",
|
| 64 |
-
"probability":
|
| 65 |
-
"rule_used": "
|
| 66 |
},
|
| 67 |
"COALINDIA": {
|
| 68 |
-
"prediction": "
|
| 69 |
-
"probability":
|
| 70 |
-
"rule_used": "
|
| 71 |
},
|
| 72 |
"DIVISLAB": {
|
| 73 |
"prediction": "DOWN",
|
| 74 |
-
"probability":
|
| 75 |
-
"rule_used": "
|
| 76 |
},
|
| 77 |
"DRREDDY": {
|
| 78 |
"prediction": "UP",
|
| 79 |
-
"probability":
|
| 80 |
-
"rule_used": "rsi_2 <
|
| 81 |
},
|
| 82 |
"EICHERMOT": {
|
| 83 |
-
"prediction": "
|
| 84 |
-
"probability":
|
| 85 |
-
"rule_used": "
|
| 86 |
},
|
| 87 |
"GRASIM": {
|
| 88 |
"prediction": "UP",
|
| 89 |
"probability": 63.33,
|
| 90 |
-
"rule_used": "
|
| 91 |
},
|
| 92 |
"HCLTECH": {
|
| 93 |
"prediction": "UP",
|
| 94 |
-
"probability":
|
| 95 |
-
"rule_used": "
|
| 96 |
},
|
| 97 |
"HDFCBANK": {
|
| 98 |
-
"prediction": "
|
| 99 |
-
"probability":
|
| 100 |
-
"rule_used": "
|
| 101 |
},
|
| 102 |
"HDFCLIFE": {
|
| 103 |
"prediction": "DOWN",
|
| 104 |
-
"probability":
|
| 105 |
-
"rule_used": "
|
| 106 |
},
|
| 107 |
"HEROMOTOCO": {
|
| 108 |
"prediction": "DOWN",
|
| 109 |
-
"probability":
|
| 110 |
-
"rule_used": "
|
| 111 |
},
|
| 112 |
"HINDALCO": {
|
| 113 |
-
"prediction": "
|
| 114 |
"probability": 63.33,
|
| 115 |
-
"rule_used": "
|
| 116 |
},
|
| 117 |
"HINDUNILVR": {
|
| 118 |
"prediction": "UP",
|
| 119 |
-
"probability":
|
| 120 |
-
"rule_used": "
|
| 121 |
},
|
| 122 |
"ICICIBANK": {
|
| 123 |
"prediction": "DOWN",
|
| 124 |
-
"probability":
|
| 125 |
-
"rule_used": "
|
| 126 |
},
|
| 127 |
"INDUSINDBK": {
|
| 128 |
-
"prediction": "
|
| 129 |
-
"probability":
|
| 130 |
-
"rule_used": "
|
| 131 |
},
|
| 132 |
"INFY": {
|
| 133 |
"prediction": "DOWN",
|
| 134 |
-
"probability":
|
| 135 |
-
"rule_used": "
|
| 136 |
},
|
| 137 |
"ITC": {
|
| 138 |
"prediction": "DOWN",
|
| 139 |
-
"probability":
|
| 140 |
-
"rule_used": "
|
| 141 |
},
|
| 142 |
"JSWSTEEL": {
|
| 143 |
-
"prediction": "
|
| 144 |
-
"probability":
|
| 145 |
-
"rule_used": "
|
| 146 |
},
|
| 147 |
"KOTAKBANK": {
|
| 148 |
"prediction": "DOWN",
|
| 149 |
-
"probability":
|
| 150 |
-
"rule_used": "
|
| 151 |
},
|
| 152 |
"LT": {
|
| 153 |
-
"prediction": "
|
| 154 |
"probability": 57.5,
|
| 155 |
-
"rule_used": "
|
| 156 |
},
|
| 157 |
"LTIM": {
|
| 158 |
"prediction": "UP",
|
| 159 |
"probability": 60.0,
|
| 160 |
-
"rule_used": "
|
| 161 |
},
|
| 162 |
"MARUTI": {
|
| 163 |
"prediction": "DOWN",
|
| 164 |
-
"probability":
|
| 165 |
-
"rule_used": "rsi_2 <
|
| 166 |
},
|
| 167 |
"MM": {
|
| 168 |
-
"prediction": "
|
| 169 |
-
"probability":
|
| 170 |
-
"rule_used": "
|
| 171 |
},
|
| 172 |
"NESTLEIND": {
|
| 173 |
"prediction": "DOWN",
|
| 174 |
-
"probability":
|
| 175 |
-
"rule_used": "
|
| 176 |
},
|
| 177 |
"NTPC": {
|
| 178 |
"prediction": "UP",
|
| 179 |
-
"probability":
|
| 180 |
-
"rule_used": "
|
| 181 |
},
|
| 182 |
"ONGC": {
|
| 183 |
"prediction": "UP",
|
| 184 |
-
"probability":
|
| 185 |
-
"rule_used": "rsi_2 <
|
| 186 |
},
|
| 187 |
"POWERGRID": {
|
| 188 |
"prediction": "UP",
|
| 189 |
-
"probability":
|
| 190 |
-
"rule_used": "
|
| 191 |
},
|
| 192 |
"RELIANCE": {
|
| 193 |
"prediction": "DOWN",
|
| 194 |
-
"probability":
|
| 195 |
-
"rule_used": "
|
| 196 |
},
|
| 197 |
"SBILIFE": {
|
| 198 |
"prediction": "DOWN",
|
| 199 |
-
"probability": 60.
|
| 200 |
-
"rule_used": "
|
| 201 |
},
|
| 202 |
"SBIN": {
|
| 203 |
"prediction": "UP",
|
| 204 |
-
"probability":
|
| 205 |
-
"rule_used": "
|
| 206 |
},
|
| 207 |
"SUNPHARMA": {
|
| 208 |
"prediction": "UP",
|
| 209 |
-
"probability":
|
| 210 |
-
"rule_used": "
|
| 211 |
},
|
| 212 |
"TATACONSUM": {
|
| 213 |
-
"prediction": "
|
| 214 |
-
"probability":
|
| 215 |
-
"rule_used": "
|
| 216 |
},
|
| 217 |
"TATASTEEL": {
|
| 218 |
"prediction": "DOWN",
|
| 219 |
-
"probability":
|
| 220 |
-
"rule_used": "
|
| 221 |
},
|
| 222 |
"TCS": {
|
| 223 |
"prediction": "UP",
|
| 224 |
-
"probability":
|
| 225 |
-
"rule_used": "
|
| 226 |
},
|
| 227 |
"TECHM": {
|
| 228 |
-
"prediction": "
|
| 229 |
-
"probability":
|
| 230 |
-
"rule_used": "
|
| 231 |
},
|
| 232 |
"TITAN": {
|
| 233 |
"prediction": "DOWN",
|
| 234 |
-
"probability":
|
| 235 |
-
"rule_used": "
|
| 236 |
},
|
| 237 |
"ULTRACEMCO": {
|
| 238 |
"prediction": "DOWN",
|
| 239 |
-
"probability":
|
| 240 |
-
"rule_used": "
|
| 241 |
},
|
| 242 |
"UPL": {
|
| 243 |
"prediction": "DOWN",
|
| 244 |
-
"probability":
|
| 245 |
-
"rule_used": "
|
| 246 |
},
|
| 247 |
"WIPRO": {
|
| 248 |
"prediction": "UP",
|
|
|
|
| 1 |
{
|
| 2 |
+
"generated_at": "2026-06-19T16:14:00.701098",
|
| 3 |
"forecast_date": "2026-06-19",
|
| 4 |
+
"mean_accuracy": 60.88,
|
| 5 |
+
"median_accuracy": 60.83,
|
| 6 |
"predictions": {
|
| 7 |
"ADANIENT": {
|
| 8 |
"prediction": "DOWN",
|
| 9 |
+
"probability": 58.33,
|
| 10 |
+
"rule_used": "dist_sma_3 < 1.0100"
|
| 11 |
},
|
| 12 |
"ADANIPORTS": {
|
| 13 |
"prediction": "DOWN",
|
| 14 |
+
"probability": 61.67,
|
| 15 |
+
"rule_used": "ret_2d < -0.0150"
|
| 16 |
},
|
| 17 |
"APOLLOHOSP": {
|
| 18 |
+
"prediction": "UP",
|
| 19 |
+
"probability": 64.17,
|
| 20 |
+
"rule_used": "ret_1d < 0.0075"
|
| 21 |
},
|
| 22 |
"ASIANPAINT": {
|
| 23 |
"prediction": "DOWN",
|
| 24 |
+
"probability": 60.0,
|
| 25 |
+
"rule_used": "rsi_14 < 22"
|
| 26 |
},
|
| 27 |
"AXISBANK": {
|
| 28 |
"prediction": "DOWN",
|
| 29 |
+
"probability": 60.83,
|
| 30 |
+
"rule_used": "rsi_14 < 52"
|
| 31 |
},
|
| 32 |
"BAJAJ-AUTO": {
|
| 33 |
+
"prediction": "UP",
|
| 34 |
+
"probability": 60.83,
|
| 35 |
+
"rule_used": "rsi_7 < 76"
|
| 36 |
},
|
| 37 |
"BAJAJFINSV": {
|
| 38 |
"prediction": "DOWN",
|
| 39 |
+
"probability": 61.67,
|
| 40 |
+
"rule_used": "rsi_14 < 44"
|
| 41 |
},
|
| 42 |
"BAJFINANCE": {
|
| 43 |
"prediction": "DOWN",
|
| 44 |
+
"probability": 57.5,
|
| 45 |
+
"rule_used": "rsi_5 < 56"
|
| 46 |
},
|
| 47 |
"BHARTIARTL": {
|
| 48 |
"prediction": "DOWN",
|
| 49 |
+
"probability": 60.83,
|
| 50 |
+
"rule_used": "ret_2d < -0.0125"
|
| 51 |
},
|
| 52 |
"BPCL": {
|
| 53 |
"prediction": "DOWN",
|
|
|
|
| 55 |
"rule_used": "rsi_2 < 10"
|
| 56 |
},
|
| 57 |
"BRITANNIA": {
|
| 58 |
+
"prediction": "UP",
|
| 59 |
+
"probability": 59.17,
|
| 60 |
+
"rule_used": "ret_5d > 0.0050"
|
| 61 |
},
|
| 62 |
"CIPLA": {
|
| 63 |
"prediction": "DOWN",
|
| 64 |
+
"probability": 60.0,
|
| 65 |
+
"rule_used": "rsi_14 < 18"
|
| 66 |
},
|
| 67 |
"COALINDIA": {
|
| 68 |
+
"prediction": "UP",
|
| 69 |
+
"probability": 63.33,
|
| 70 |
+
"rule_used": "dist_sma_20 < 1.0000"
|
| 71 |
},
|
| 72 |
"DIVISLAB": {
|
| 73 |
"prediction": "DOWN",
|
| 74 |
+
"probability": 60.0,
|
| 75 |
+
"rule_used": "rsi_5 < 44"
|
| 76 |
},
|
| 77 |
"DRREDDY": {
|
| 78 |
"prediction": "UP",
|
| 79 |
+
"probability": 66.67,
|
| 80 |
+
"rule_used": "rsi_2 < 64"
|
| 81 |
},
|
| 82 |
"EICHERMOT": {
|
| 83 |
+
"prediction": "DOWN",
|
| 84 |
+
"probability": 60.83,
|
| 85 |
+
"rule_used": "ret_2d < -0.0100"
|
| 86 |
},
|
| 87 |
"GRASIM": {
|
| 88 |
"prediction": "UP",
|
| 89 |
"probability": 63.33,
|
| 90 |
+
"rule_used": "ret_1d < 0.0000"
|
| 91 |
},
|
| 92 |
"HCLTECH": {
|
| 93 |
"prediction": "UP",
|
| 94 |
+
"probability": 60.0,
|
| 95 |
+
"rule_used": "dist_sma_10 > 0.9800"
|
| 96 |
},
|
| 97 |
"HDFCBANK": {
|
| 98 |
+
"prediction": "UP",
|
| 99 |
+
"probability": 62.5,
|
| 100 |
+
"rule_used": "ret_1d > 0.0125"
|
| 101 |
},
|
| 102 |
"HDFCLIFE": {
|
| 103 |
"prediction": "DOWN",
|
| 104 |
+
"probability": 67.5,
|
| 105 |
+
"rule_used": "rsi_14 < 36"
|
| 106 |
},
|
| 107 |
"HEROMOTOCO": {
|
| 108 |
"prediction": "DOWN",
|
| 109 |
+
"probability": 58.33,
|
| 110 |
+
"rule_used": "rsi_14 < 46"
|
| 111 |
},
|
| 112 |
"HINDALCO": {
|
| 113 |
+
"prediction": "DOWN",
|
| 114 |
"probability": 63.33,
|
| 115 |
+
"rule_used": "rsi_5 > 28"
|
| 116 |
},
|
| 117 |
"HINDUNILVR": {
|
| 118 |
"prediction": "UP",
|
| 119 |
+
"probability": 59.17,
|
| 120 |
+
"rule_used": "ret_3d > -0.0275"
|
| 121 |
},
|
| 122 |
"ICICIBANK": {
|
| 123 |
"prediction": "DOWN",
|
| 124 |
+
"probability": 58.33,
|
| 125 |
+
"rule_used": "dist_sma_20 < 1.0100"
|
| 126 |
},
|
| 127 |
"INDUSINDBK": {
|
| 128 |
+
"prediction": "DOWN",
|
| 129 |
+
"probability": 60.0,
|
| 130 |
+
"rule_used": "ret_5d < -0.0050"
|
| 131 |
},
|
| 132 |
"INFY": {
|
| 133 |
"prediction": "DOWN",
|
| 134 |
+
"probability": 57.5,
|
| 135 |
+
"rule_used": "rsi_14 > 56"
|
| 136 |
},
|
| 137 |
"ITC": {
|
| 138 |
"prediction": "DOWN",
|
| 139 |
+
"probability": 61.67,
|
| 140 |
+
"rule_used": "ret_1d < -0.0100"
|
| 141 |
},
|
| 142 |
"JSWSTEEL": {
|
| 143 |
+
"prediction": "DOWN",
|
| 144 |
+
"probability": 64.17,
|
| 145 |
+
"rule_used": "rsi_5 < 46"
|
| 146 |
},
|
| 147 |
"KOTAKBANK": {
|
| 148 |
"prediction": "DOWN",
|
| 149 |
+
"probability": 57.5,
|
| 150 |
+
"rule_used": "rsi_5 < 64"
|
| 151 |
},
|
| 152 |
"LT": {
|
| 153 |
+
"prediction": "UP",
|
| 154 |
"probability": 57.5,
|
| 155 |
+
"rule_used": "rsi_3 > 40"
|
| 156 |
},
|
| 157 |
"LTIM": {
|
| 158 |
"prediction": "UP",
|
| 159 |
"probability": 60.0,
|
| 160 |
+
"rule_used": "ret_1d < 0.0000"
|
| 161 |
},
|
| 162 |
"MARUTI": {
|
| 163 |
"prediction": "DOWN",
|
| 164 |
+
"probability": 62.5,
|
| 165 |
+
"rule_used": "rsi_2 < 32"
|
| 166 |
},
|
| 167 |
"MM": {
|
| 168 |
+
"prediction": "UP",
|
| 169 |
+
"probability": 65.83,
|
| 170 |
+
"rule_used": "rsi_14 < 54"
|
| 171 |
},
|
| 172 |
"NESTLEIND": {
|
| 173 |
"prediction": "DOWN",
|
| 174 |
+
"probability": 60.0,
|
| 175 |
+
"rule_used": "ret_1d < -0.0025"
|
| 176 |
},
|
| 177 |
"NTPC": {
|
| 178 |
"prediction": "UP",
|
| 179 |
+
"probability": 63.33,
|
| 180 |
+
"rule_used": "rsi_7 < 60"
|
| 181 |
},
|
| 182 |
"ONGC": {
|
| 183 |
"prediction": "UP",
|
| 184 |
+
"probability": 60.83,
|
| 185 |
+
"rule_used": "rsi_2 < 46"
|
| 186 |
},
|
| 187 |
"POWERGRID": {
|
| 188 |
"prediction": "UP",
|
| 189 |
+
"probability": 59.17,
|
| 190 |
+
"rule_used": "rsi_14 < 50"
|
| 191 |
},
|
| 192 |
"RELIANCE": {
|
| 193 |
"prediction": "DOWN",
|
| 194 |
+
"probability": 60.83,
|
| 195 |
+
"rule_used": "rsi_7 < 50"
|
| 196 |
},
|
| 197 |
"SBILIFE": {
|
| 198 |
"prediction": "DOWN",
|
| 199 |
+
"probability": 60.83,
|
| 200 |
+
"rule_used": "ret_1d < -0.0025"
|
| 201 |
},
|
| 202 |
"SBIN": {
|
| 203 |
"prediction": "UP",
|
| 204 |
+
"probability": 56.67,
|
| 205 |
+
"rule_used": "rsi_7 > 42"
|
| 206 |
},
|
| 207 |
"SUNPHARMA": {
|
| 208 |
"prediction": "UP",
|
| 209 |
+
"probability": 57.5,
|
| 210 |
+
"rule_used": "ret_3d > -0.0025"
|
| 211 |
},
|
| 212 |
"TATACONSUM": {
|
| 213 |
+
"prediction": "UP",
|
| 214 |
+
"probability": 60.83,
|
| 215 |
+
"rule_used": "rsi_14 < 50"
|
| 216 |
},
|
| 217 |
"TATASTEEL": {
|
| 218 |
"prediction": "DOWN",
|
| 219 |
+
"probability": 60.0,
|
| 220 |
+
"rule_used": "rsi_7 > 40"
|
| 221 |
},
|
| 222 |
"TCS": {
|
| 223 |
"prediction": "UP",
|
| 224 |
+
"probability": 60.83,
|
| 225 |
+
"rule_used": "rsi_14 > 32"
|
| 226 |
},
|
| 227 |
"TECHM": {
|
| 228 |
+
"prediction": "DOWN",
|
| 229 |
+
"probability": 60.83,
|
| 230 |
+
"rule_used": "rsi_5 > 44"
|
| 231 |
},
|
| 232 |
"TITAN": {
|
| 233 |
"prediction": "DOWN",
|
| 234 |
+
"probability": 59.17,
|
| 235 |
+
"rule_used": "rsi_14 < 36"
|
| 236 |
},
|
| 237 |
"ULTRACEMCO": {
|
| 238 |
"prediction": "DOWN",
|
| 239 |
+
"probability": 59.17,
|
| 240 |
+
"rule_used": "ret_1d < -0.0300"
|
| 241 |
},
|
| 242 |
"UPL": {
|
| 243 |
"prediction": "DOWN",
|
| 244 |
+
"probability": 63.33,
|
| 245 |
+
"rule_used": "rsi_3 < 44"
|
| 246 |
},
|
| 247 |
"WIPRO": {
|
| 248 |
"prediction": "UP",
|