Jitendra12421 commited on
Commit
f5fb7f5
·
verified ·
1 Parent(s): 8fe2df2

Upload 60 files

Browse files
Files changed (4) hide show
  1. app.py +37 -0
  2. data/t5_rules.json +247 -0
  3. t5_engine.py +159 -0
  4. t5_predictions.json +618 -0
app.py CHANGED
@@ -7,12 +7,14 @@ from zoneinfo import ZoneInfo
7
  from data_updater import update_daily_data, is_trading_day
8
  from forecaster_engine import generate_predictions
9
  from signal_generator import generate_signals
 
10
 
11
  IST = ZoneInfo("Asia/Kolkata")
12
  MARKET_CLOSE_BUFFER = time(15, 45) # Update runs after 3:45 PM
13
  SIGNAL_TIME = time(9, 30) # Signal generation at 9:30 AM
14
  PREDICTIONS_FILE = os.path.join(os.path.dirname(__file__), "predictions.json")
15
  SIGNALS_FILE = os.path.join(os.path.dirname(__file__), "signals.json")
 
16
 
17
  app = FastAPI(title="HF NIFTY Forecaster Backend")
18
 
@@ -75,6 +77,41 @@ def cron_trigger(background_tasks: BackgroundTasks):
75
 
76
  return {"status": "triggered", "message": "Update and forecast pipeline started in the background."}
77
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
78
  # ── NEW: Signal Generator Endpoints ──────────────────────────────────────────
79
 
80
  @app.get("/signals")
 
7
  from data_updater import update_daily_data, is_trading_day
8
  from forecaster_engine import generate_predictions
9
  from signal_generator import generate_signals
10
+ from t5_engine import run_t5_pipeline
11
 
12
  IST = ZoneInfo("Asia/Kolkata")
13
  MARKET_CLOSE_BUFFER = time(15, 45) # Update runs after 3:45 PM
14
  SIGNAL_TIME = time(9, 30) # Signal generation at 9:30 AM
15
  PREDICTIONS_FILE = os.path.join(os.path.dirname(__file__), "predictions.json")
16
  SIGNALS_FILE = os.path.join(os.path.dirname(__file__), "signals.json")
17
+ T5_PREDICTIONS_FILE = os.path.join(os.path.dirname(__file__), "t5_predictions.json")
18
 
19
  app = FastAPI(title="HF NIFTY Forecaster Backend")
20
 
 
77
 
78
  return {"status": "triggered", "message": "Update and forecast pipeline started in the background."}
79
 
80
+ # ── NEW: T5 Forecaster Endpoints ─────────────────────────────────────────────
81
+
82
+ @app.get("/t5/predictions")
83
+ def get_t5_predictions():
84
+ """Get the latest first 5-minute (T5) predictions for all stocks."""
85
+ if not os.path.exists(T5_PREDICTIONS_FILE):
86
+ raise HTTPException(status_code=404, detail="T5 predictions not yet generated")
87
+
88
+ with open(T5_PREDICTIONS_FILE, "r") as f:
89
+ data = json.load(f)
90
+
91
+ return data
92
+
93
+ @app.post("/cron/t5_update")
94
+ def t5_update_trigger(background_tasks: BackgroundTasks):
95
+ """
96
+ Trigger T5 prediction generation. Should be called at or after 09:20 AM IST.
97
+ """
98
+ now = datetime.now(IST)
99
+ today = now.date()
100
+ current_time = now.time()
101
+
102
+ # 1. Check if it's a trading day
103
+ if not is_trading_day(today):
104
+ return {"status": "skipped", "reason": f"{today} is a holiday or weekend"}
105
+
106
+ # 2. Check if it's past 09:20 AM
107
+ T5_UPDATE_TIME = time(9, 20)
108
+ if current_time < T5_UPDATE_TIME:
109
+ return {"status": "skipped", "reason": "Market first 5 minutes not completed yet. Runs after 09:20 AM IST."}
110
+
111
+ background_tasks.add_task(run_t5_pipeline)
112
+
113
+ return {"status": "triggered", "message": "T5 update pipeline started in the background."}
114
+
115
  # ── NEW: Signal Generator Endpoints ──────────────────────────────────────────
116
 
117
  @app.get("/signals")
data/t5_rules.json ADDED
@@ -0,0 +1,247 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ [
2
+ {
3
+ "Ticker":"ADANIENT",
4
+ "Test_Acc":0.6833333333,
5
+ "Rule":"close_to_high > 0.1216 AND hl_spread > 0.0106"
6
+ },
7
+ {
8
+ "Ticker":"ADANIPORTS",
9
+ "Test_Acc":0.6416666667,
10
+ "Rule":"hl_spread > 0.0127"
11
+ },
12
+ {
13
+ "Ticker":"APOLLOHOSP",
14
+ "Test_Acc":0.6416666667,
15
+ "Rule":"candle_shape > -0.7032 AND hl_spread > 0.0047"
16
+ },
17
+ {
18
+ "Ticker":"ASIANPAINT",
19
+ "Test_Acc":0.6333333333,
20
+ "Rule":"close_to_high < 0.8230 AND hl_spread > 0.0086"
21
+ },
22
+ {
23
+ "Ticker":"AXISBANK",
24
+ "Test_Acc":0.625,
25
+ "Rule":"close_to_high < 0.4247 AND prev_ret < -0.0013"
26
+ },
27
+ {
28
+ "Ticker":"BAJAJ-AUTO",
29
+ "Test_Acc":0.675,
30
+ "Rule":"ret_5m < -0.0050 AND gap < 0.0044"
31
+ },
32
+ {
33
+ "Ticker":"BAJAJFINSV",
34
+ "Test_Acc":0.625,
35
+ "Rule":"ret_5m < -0.0034 AND prev_ret < 0.0039"
36
+ },
37
+ {
38
+ "Ticker":"BAJFINANCE",
39
+ "Test_Acc":0.6666666667,
40
+ "Rule":"close_to_high > 0.0602 AND hl_spread > 0.0111"
41
+ },
42
+ {
43
+ "Ticker":"BHARTIARTL",
44
+ "Test_Acc":0.65,
45
+ "Rule":"hl_spread > 0.0084 AND prev_ret < 0.0030"
46
+ },
47
+ {
48
+ "Ticker":"BPCL",
49
+ "Test_Acc":0.6583333333,
50
+ "Rule":"gap < -0.0015 AND close_to_high < 0.6103"
51
+ },
52
+ {
53
+ "Ticker":"BRITANNIA",
54
+ "Test_Acc":0.6333333333,
55
+ "Rule":"ret_5m > -0.0027 AND prev_ret < 0.0002"
56
+ },
57
+ {
58
+ "Ticker":"CIPLA",
59
+ "Test_Acc":0.6333333333,
60
+ "Rule":"gap < 0.0010 AND vol_5m_ratio > 0.0126"
61
+ },
62
+ {
63
+ "Ticker":"COALINDIA",
64
+ "Test_Acc":0.6416666667,
65
+ "Rule":"close_to_high < 0.2902 AND vol_5m_ratio > 0.0248"
66
+ },
67
+ {
68
+ "Ticker":"DIVISLAB",
69
+ "Test_Acc":0.6916666667,
70
+ "Rule":"vol_5m_ratio > 0.0376 AND prev_ret < 0.0064"
71
+ },
72
+ {
73
+ "Ticker":"DRREDDY",
74
+ "Test_Acc":0.7,
75
+ "Rule":"close_to_high < 0.3847 AND vol_5m_ratio > 0.0082"
76
+ },
77
+ {
78
+ "Ticker":"EICHERMOT",
79
+ "Test_Acc":0.6083333333,
80
+ "Rule":"gap > -0.0095 AND close_to_high > 0.0295"
81
+ },
82
+ {
83
+ "Ticker":"GRASIM",
84
+ "Test_Acc":0.6416666667,
85
+ "Rule":"gap < 0.0041 AND prev_ret < -0.0037"
86
+ },
87
+ {
88
+ "Ticker":"HCLTECH",
89
+ "Test_Acc":0.6333333333,
90
+ "Rule":"ret_5m > -0.0075 AND gap < -0.0010"
91
+ },
92
+ {
93
+ "Ticker":"HDFCBANK",
94
+ "Test_Acc":0.6333333333,
95
+ "Rule":"gap > -0.0046 AND hl_spread > 0.0072"
96
+ },
97
+ {
98
+ "Ticker":"HDFCLIFE",
99
+ "Test_Acc":0.5916666667,
100
+ "Rule":"close_to_high < 0.7809 AND vol_5m_ratio < 0.0499"
101
+ },
102
+ {
103
+ "Ticker":"HEROMOTOCO",
104
+ "Test_Acc":0.6333333333,
105
+ "Rule":"ret_5m < -0.0066 AND close_to_high > 0.0984"
106
+ },
107
+ {
108
+ "Ticker":"HINDALCO",
109
+ "Test_Acc":0.6583333333,
110
+ "Rule":"vol_5m_ratio > 0.0208 AND prev_ret < -0.0007"
111
+ },
112
+ {
113
+ "Ticker":"HINDUNILVR",
114
+ "Test_Acc":0.6083333333,
115
+ "Rule":"gap > 0.0004 AND close_to_high < 0.6781"
116
+ },
117
+ {
118
+ "Ticker":"ICICIBANK",
119
+ "Test_Acc":0.6333333333,
120
+ "Rule":"gap > -0.0052 AND vol_5m_ratio > 0.0385"
121
+ },
122
+ {
123
+ "Ticker":"INDUSINDBK",
124
+ "Test_Acc":0.6416666667,
125
+ "Rule":"vol_5m_ratio > 0.0195 AND hl_spread < 0.0124"
126
+ },
127
+ {
128
+ "Ticker":"INFY",
129
+ "Test_Acc":0.6583333333,
130
+ "Rule":"gap < -0.0022 AND prev_ret > -0.0173"
131
+ },
132
+ {
133
+ "Ticker":"ITC",
134
+ "Test_Acc":0.6416666667,
135
+ "Rule":"ret_5m < 0.0007 AND close_to_high > 0.3338"
136
+ },
137
+ {
138
+ "Ticker":"JSWSTEEL",
139
+ "Test_Acc":0.6333333333,
140
+ "Rule":"gap > -0.0035 AND prev_ret < -0.0008"
141
+ },
142
+ {
143
+ "Ticker":"KOTAKBANK",
144
+ "Test_Acc":0.6416666667,
145
+ "Rule":"ret_5m > -0.0076 AND vol_5m_ratio < 0.0171"
146
+ },
147
+ {
148
+ "Ticker":"LTIM",
149
+ "Test_Acc":0.6333333333,
150
+ "Rule":"ret_5m > -0.0077 AND close_to_high < 0.3565"
151
+ },
152
+ {
153
+ "Ticker":"LT",
154
+ "Test_Acc":0.65,
155
+ "Rule":"vol_5m_ratio < 0.0433 AND hl_spread > 0.0067"
156
+ },
157
+ {
158
+ "Ticker":"MARUTI",
159
+ "Test_Acc":0.6416666667,
160
+ "Rule":"gap > -0.0054 AND hl_spread > 0.0059"
161
+ },
162
+ {
163
+ "Ticker":"MM",
164
+ "Test_Acc":0.6583333333,
165
+ "Rule":"gap < 0.0041 AND close_to_high > 0.5563"
166
+ },
167
+ {
168
+ "Ticker":"NESTLEIND",
169
+ "Test_Acc":0.6333333333,
170
+ "Rule":"vol_5m_ratio > 0.0013 AND prev_ret < 0.0017"
171
+ },
172
+ {
173
+ "Ticker":"NTPC",
174
+ "Test_Acc":0.6333333333,
175
+ "Rule":"ret_5m < 0.0049 AND gap < 0.0014"
176
+ },
177
+ {
178
+ "Ticker":"ONGC",
179
+ "Test_Acc":0.6666666667,
180
+ "Rule":"vol_5m_ratio > 0.0165 AND hl_spread > 0.0081"
181
+ },
182
+ {
183
+ "Ticker":"POWERGRID",
184
+ "Test_Acc":0.6416666667,
185
+ "Rule":"gap < -0.0038 AND hl_spread < 0.0261"
186
+ },
187
+ {
188
+ "Ticker":"RELIANCE",
189
+ "Test_Acc":0.6666666667,
190
+ "Rule":"close_to_high > 0.4682 AND prev_ret < 0.0007"
191
+ },
192
+ {
193
+ "Ticker":"SBILIFE",
194
+ "Test_Acc":0.6,
195
+ "Rule":"hl_spread > 0.0057 AND prev_ret < 0.0058"
196
+ },
197
+ {
198
+ "Ticker":"SBIN",
199
+ "Test_Acc":0.6166666667,
200
+ "Rule":"ret_5m > 0.0001 AND close_to_high < 0.6810"
201
+ },
202
+ {
203
+ "Ticker":"SUNPHARMA",
204
+ "Test_Acc":0.6083333333,
205
+ "Rule":"close_to_high > 0.0984 AND vol_5m_ratio < 0.0198"
206
+ },
207
+ {
208
+ "Ticker":"TATACONSUM",
209
+ "Test_Acc":0.6583333333,
210
+ "Rule":"candle_shape > 0.5173 AND prev_ret < 0.0138"
211
+ },
212
+ {
213
+ "Ticker":"TATASTEEL",
214
+ "Test_Acc":0.6,
215
+ "Rule":"ret_5m > -0.0121 AND hl_spread > 0.0101"
216
+ },
217
+ {
218
+ "Ticker":"TCS",
219
+ "Test_Acc":0.675,
220
+ "Rule":"gap < -0.0108 AND candle_shape > -0.6825"
221
+ },
222
+ {
223
+ "Ticker":"TECHM",
224
+ "Test_Acc":0.6416666667,
225
+ "Rule":"vol_5m_ratio < 0.0931 AND prev_ret > -0.0072"
226
+ },
227
+ {
228
+ "Ticker":"TITAN",
229
+ "Test_Acc":0.6416666667,
230
+ "Rule":"candle_shape < 0.6971 AND hl_spread > 0.0074"
231
+ },
232
+ {
233
+ "Ticker":"ULTRACEMCO",
234
+ "Test_Acc":0.6666666667,
235
+ "Rule":"gap > 0.0006 AND prev_ret < 0.0135"
236
+ },
237
+ {
238
+ "Ticker":"UPL",
239
+ "Test_Acc":0.6666666667,
240
+ "Rule":"ret_5m > -0.0024 AND gap > 0.0029"
241
+ },
242
+ {
243
+ "Ticker":"WIPRO",
244
+ "Test_Acc":0.6583333333,
245
+ "Rule":"candle_shape < 0.7496 AND close_to_high > 0.5824"
246
+ }
247
+ ]
t5_engine.py ADDED
@@ -0,0 +1,159 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import os
2
+ import json
3
+ import time
4
+ import requests
5
+ import pandas as pd
6
+ from datetime import datetime, date, timedelta
7
+ from zoneinfo import ZoneInfo
8
+ import pandas_market_calendars as mcal
9
+ import numpy as np
10
+
11
+ IST = ZoneInfo("Asia/Kolkata")
12
+ BASE_DIR = os.path.dirname(__file__)
13
+ DATA_DIR = os.path.join(BASE_DIR, "data")
14
+ RULES_FILE = os.path.join(DATA_DIR, "t5_rules.json")
15
+ PREDICTIONS_FILE = os.path.join(BASE_DIR, "t5_predictions.json")
16
+
17
+ TICKERS = [
18
+ 'ADANIENT', 'ADANIPORTS', 'APOLLOHOSP', 'ASIANPAINT', 'AXISBANK', 'BAJAJ-AUTO', 'BAJAJFINSV', 'BAJFINANCE',
19
+ 'BHARTIARTL', 'BPCL', 'BRITANNIA', 'CIPLA', 'COALINDIA', 'DIVISLAB', 'DRREDDY', 'EICHERMOT', 'GRASIM',
20
+ 'HCLTECH', 'HDFCBANK', 'HDFCLIFE', 'HEROMOTOCO', 'HINDALCO', 'HINDUNILVR', 'ICICIBANK', 'INDUSINDBK',
21
+ 'INFY', 'ITC', 'JSWSTEEL', 'KOTAKBANK', 'LT', 'M&M', 'MARUTI', 'NESTLEIND', 'NTPC', 'ONGC', 'POWERGRID',
22
+ 'RELIANCE', 'SBILIFE', 'SBIN', 'SUNPHARMA', 'TATACONSUM', 'TATAMOTORS', 'TATASTEEL', 'TCS', 'TECHM',
23
+ 'TITAN', 'ULTRACEMCO', 'UPL', 'WIPRO'
24
+ ]
25
+
26
+ def fetch_groww_history(ticker: str, start_ts: int, end_ts: int):
27
+ url = f"https://groww.in/v1/api/charting_service/v2/chart/exchange/NSE/segment/CASH/{ticker}?endTimeInMillis={end_ts}&intervalInMinutes=1&startTimeInMillis={start_ts}"
28
+ headers = {
29
+ "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64)",
30
+ "Accept": "application/json"
31
+ }
32
+ try:
33
+ res = requests.get(url, headers=headers, timeout=10)
34
+ if res.status_code == 200:
35
+ data = res.json()
36
+ if data and 'candles' in data:
37
+ return data['candles']
38
+ return []
39
+ except Exception as e:
40
+ print(f"Error fetching {ticker}: {e}")
41
+ return []
42
+
43
+ def evaluate_rule(rule_str: str, features: dict) -> int:
44
+ if not rule_str:
45
+ return 0
46
+ # Convert 'AND' to python 'and'
47
+ py_rule = rule_str.replace("AND", "and")
48
+ try:
49
+ # features dict contains e.g. {'ret_5m': -0.01, 'gap': 0.005, ...}
50
+ # eval evaluates the boolean expression
51
+ result = eval(py_rule, {"__builtins__": None}, features)
52
+ return 1 if result else -1
53
+ except Exception as e:
54
+ print(f"Rule eval error: {e}")
55
+ return 0
56
+
57
+ def run_t5_pipeline():
58
+ print(f"[{datetime.now(IST)}] Starting T5 Engine Pipeline...")
59
+
60
+ if not os.path.exists(RULES_FILE):
61
+ print("T5 rules file not found!")
62
+ return {"status": "error", "reason": "Missing rules file"}
63
+
64
+ with open(RULES_FILE, "r") as f:
65
+ rules_list = json.load(f)
66
+
67
+ rules_dict = {item['Ticker']: item['Rule'] for item in rules_list if item['Rule']}
68
+
69
+ now = datetime.now(IST)
70
+ # Fetch data for the last 5 days to ensure we have yesterday and today
71
+ start_dt = now - timedelta(days=5)
72
+
73
+ start_ts = int(start_dt.timestamp() * 1000)
74
+ end_ts = int(now.timestamp() * 1000)
75
+
76
+ predictions = {}
77
+
78
+ for ticker in TICKERS:
79
+ candles = fetch_groww_history(ticker, start_ts, end_ts)
80
+ if not candles:
81
+ continue
82
+
83
+ # Format: [timestamp, open, high, low, close, volume]
84
+ df = pd.DataFrame(candles, columns=['timestamp', 'open', 'high', 'low', 'close', 'volume'])
85
+ df['date'] = pd.to_datetime(df['timestamp'], unit='s', utc=True).dt.tz_convert(IST)
86
+ df.set_index('date', inplace=True)
87
+ df.sort_index(inplace=True)
88
+
89
+ # Group by day
90
+ df['day'] = df.index.date
91
+ days = df['day'].unique()
92
+
93
+ if len(days) < 2:
94
+ print(f"{ticker}: Not enough days of data")
95
+ continue
96
+
97
+ # Today is the last day in the dataset
98
+ today_date = days[-1]
99
+ yesterday_date = days[-2]
100
+
101
+ # Yesterday's aggregation
102
+ yesterday_df = df[df['day'] == yesterday_date]
103
+ if yesterday_df.empty:
104
+ continue
105
+ prev_open = yesterday_df['open'].iloc[0]
106
+ prev_close = yesterday_df['close'].iloc[-1]
107
+ prev_vol = yesterday_df['volume'].sum()
108
+
109
+ # Today's first 5 mins aggregation (09:15 to 09:19 inclusive)
110
+ today_df = df[df['day'] == today_date]
111
+ first_5m_df = today_df.between_time('09:15', '09:19')
112
+
113
+ if first_5m_df.empty:
114
+ print(f"{ticker}: Missing first 5 mins data for today")
115
+ continue
116
+
117
+ open_5m = first_5m_df['open'].iloc[0]
118
+ high_5m = first_5m_df['high'].max()
119
+ low_5m = first_5m_df['low'].min()
120
+ close_5m = first_5m_df['close'].iloc[-1]
121
+ vol_5m = first_5m_df['volume'].sum()
122
+
123
+ # Calculate features
124
+ features = {}
125
+ features['ret_5m'] = (close_5m - open_5m) / open_5m if open_5m else 0
126
+ features['gap'] = (open_5m - prev_close) / prev_close if prev_close else 0
127
+ features['candle_shape'] = (close_5m - open_5m) / (high_5m - low_5m + 1e-9)
128
+ features['close_to_high'] = (close_5m - low_5m) / (high_5m - low_5m + 1e-9)
129
+ features['vol_5m_ratio'] = vol_5m / (prev_vol + 1e-9)
130
+ features['hl_spread'] = (high_5m - low_5m) / open_5m if open_5m else 0
131
+ features['prev_ret'] = (prev_close - prev_open) / prev_open if prev_open else 0
132
+
133
+ # Evaluate rule
134
+ rule = rules_dict.get(ticker)
135
+ if rule:
136
+ pred = evaluate_rule(rule, features)
137
+ predictions[ticker] = {
138
+ "prediction": "UP" if pred == 1 else ("DOWN" if pred == -1 else "FLAT"),
139
+ "features": features,
140
+ "rule_used": rule
141
+ }
142
+
143
+ time.sleep(0.5) # Rate limiting
144
+
145
+ output = {
146
+ "generated_at": now.isoformat(),
147
+ "date_target": str(now.date()),
148
+ "horizon": "Same day close > 09:19 close",
149
+ "predictions": predictions
150
+ }
151
+
152
+ with open(PREDICTIONS_FILE, "w") as f:
153
+ json.dump(output, f, indent=4)
154
+
155
+ print(f"[{datetime.now(IST)}] T5 Pipeline completed. {len(predictions)} predictions generated.")
156
+ return {"status": "success", "count": len(predictions)}
157
+
158
+ if __name__ == "__main__":
159
+ run_t5_pipeline()
t5_predictions.json ADDED
@@ -0,0 +1,618 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "generated_at": "2026-06-19T20:10:28.554750+05:30",
3
+ "date_target": "2026-06-19",
4
+ "horizon": "Same day close > 09:19 close",
5
+ "predictions": {
6
+ "ADANIENT": {
7
+ "prediction": "DOWN",
8
+ "features": {
9
+ "ret_5m": 0.0069605568445475635,
10
+ "gap": -0.004947229551451188,
11
+ "candle_shape": 0.7317073170476803,
12
+ "close_to_high": 0.8222996515392947,
13
+ "vol_5m_ratio": 0.0022453547686507947,
14
+ "hl_spread": 0.00951276102088161,
15
+ "prev_ret": 0.02710027100271003
16
+ },
17
+ "rule_used": "close_to_high > 0.1216 AND hl_spread > 0.0106"
18
+ },
19
+ "ADANIPORTS": {
20
+ "prediction": "DOWN",
21
+ "features": {
22
+ "ret_5m": -0.0010857173877639652,
23
+ "gap": -0.0016259281339764784,
24
+ "candle_shape": -0.20618556698905208,
25
+ "close_to_high": 0.7113402061122156,
26
+ "vol_5m_ratio": 0.001300136238280726,
27
+ "hl_spread": 0.005265729330655255,
28
+ "prev_ret": 0.006601200218221445
29
+ },
30
+ "rule_used": "hl_spread > 0.0127"
31
+ },
32
+ "APOLLOHOSP": {
33
+ "prediction": "UP",
34
+ "features": {
35
+ "ret_5m": 0.004343169919086149,
36
+ "gap": -0.00130718954248366,
37
+ "candle_shape": 0.9124999999771876,
38
+ "close_to_high": 0.9249999999768751,
39
+ "vol_5m_ratio": 0.00024220589014449094,
40
+ "hl_spread": 0.00475963826749167,
41
+ "prev_ret": -0.0027848551282810925
42
+ },
43
+ "rule_used": "candle_shape > -0.7032 AND hl_spread > 0.0047"
44
+ },
45
+ "ASIANPAINT": {
46
+ "prediction": "UP",
47
+ "features": {
48
+ "ret_5m": -0.007483017908387486,
49
+ "gap": 0.0,
50
+ "candle_shape": -0.820717131441405,
51
+ "close_to_high": 0.17928286851875433,
52
+ "vol_5m_ratio": 0.0008501888258319456,
53
+ "hl_spread": 0.009117657742743982,
54
+ "prev_ret": 0.002877959927140288
55
+ },
56
+ "rule_used": "close_to_high < 0.8230 AND hl_spread > 0.0086"
57
+ },
58
+ "AXISBANK": {
59
+ "prediction": "DOWN",
60
+ "features": {
61
+ "ret_5m": 0.002284787735849157,
62
+ "gap": -0.0016188373804268178,
63
+ "candle_shape": 0.5166666665805782,
64
+ "close_to_high": 0.5166666665805782,
65
+ "vol_5m_ratio": 0.0008782219770038296,
66
+ "hl_spread": 0.004422169811320755,
67
+ "prev_ret": 0.00845948352626899
68
+ },
69
+ "rule_used": "close_to_high < 0.4247 AND prev_ret < -0.0013"
70
+ },
71
+ "BAJAJ-AUTO": {
72
+ "prediction": "UP",
73
+ "features": {
74
+ "ret_5m": -0.005920663114268798,
75
+ "gap": 0.003863298662704309,
76
+ "candle_shape": -0.7228915662563506,
77
+ "close_to_high": 0.2771084337316011,
78
+ "vol_5m_ratio": 0.0056564811145670335,
79
+ "hl_spread": 0.00819025064140517,
80
+ "prev_ret": 0.004577569907453478
81
+ },
82
+ "rule_used": "ret_5m < -0.0050 AND gap < 0.0044"
83
+ },
84
+ "BAJAJFINSV": {
85
+ "prediction": "UP",
86
+ "features": {
87
+ "ret_5m": -0.00496950530833519,
88
+ "gap": 0.0,
89
+ "candle_shape": -0.6197183098155076,
90
+ "close_to_high": 0.38028169011406987,
91
+ "vol_5m_ratio": 0.0005865222501797871,
92
+ "hl_spread": 0.00801897447481367,
93
+ "prev_ret": 0.0005650355972426263
94
+ },
95
+ "rule_used": "ret_5m < -0.0034 AND prev_ret < 0.0039"
96
+ },
97
+ "BAJFINANCE": {
98
+ "prediction": "DOWN",
99
+ "features": {
100
+ "ret_5m": 0.004297468686127586,
101
+ "gap": -0.004850318139146856,
102
+ "candle_shape": 0.7256637166857156,
103
+ "close_to_high": 0.7256637166857156,
104
+ "vol_5m_ratio": 0.0009881518046231392,
105
+ "hl_spread": 0.005922121482102711,
106
+ "prev_ret": 0.00036521103980802704
107
+ },
108
+ "rule_used": "close_to_high > 0.0602 AND hl_spread > 0.0111"
109
+ },
110
+ "BHARTIARTL": {
111
+ "prediction": "UP",
112
+ "features": {
113
+ "ret_5m": 0.0010670650376140426,
114
+ "gap": 5.335609860202169e-05,
115
+ "candle_shape": 0.11494252872902569,
116
+ "close_to_high": 0.4999999999712644,
117
+ "vol_5m_ratio": 0.0011685720705432664,
118
+ "hl_spread": 0.009283465827242219,
119
+ "prev_ret": -0.002448371300830269
120
+ },
121
+ "rule_used": "hl_spread > 0.0084 AND prev_ret < 0.0030"
122
+ },
123
+ "BPCL": {
124
+ "prediction": "UP",
125
+ "features": {
126
+ "ret_5m": -0.004761904761904762,
127
+ "gap": -0.0041100221308884325,
128
+ "candle_shape": -0.6666666663703703,
129
+ "close_to_high": 0.33333333318518515,
130
+ "vol_5m_ratio": 0.0006186315183135338,
131
+ "hl_spread": 0.007142857142857143,
132
+ "prev_ret": -0.008463949843260153
133
+ },
134
+ "rule_used": "gap < -0.0015 AND close_to_high < 0.6103"
135
+ },
136
+ "BRITANNIA": {
137
+ "prediction": "UP",
138
+ "features": {
139
+ "ret_5m": -0.0005757052389176742,
140
+ "gap": -0.0031563845050215206,
141
+ "candle_shape": -0.12244897958683881,
142
+ "close_to_high": 0.36734693876051644,
143
+ "vol_5m_ratio": 0.00022516906437265074,
144
+ "hl_spread": 0.0047015927844943385,
145
+ "prev_ret": -0.0005735589331803843
146
+ },
147
+ "rule_used": "ret_5m > -0.0027 AND prev_ret < 0.0002"
148
+ },
149
+ "CIPLA": {
150
+ "prediction": "DOWN",
151
+ "features": {
152
+ "ret_5m": 0.004280442804428011,
153
+ "gap": -0.0027965852222548975,
154
+ "candle_shape": 0.8656716416618274,
155
+ "close_to_high": 0.8656716416618274,
156
+ "vol_5m_ratio": 0.0012463515403930785,
157
+ "hl_spread": 0.004944649446494498,
158
+ "prev_ret": 0.004138338752586394
159
+ },
160
+ "rule_used": "gap < 0.0010 AND vol_5m_ratio > 0.0126"
161
+ },
162
+ "COALINDIA": {
163
+ "prediction": "DOWN",
164
+ "features": {
165
+ "ret_5m": -0.001105460977227504,
166
+ "gap": 0.00011055831951356854,
167
+ "candle_shape": -0.24390243890541208,
168
+ "close_to_high": 0.6097560972635302,
169
+ "vol_5m_ratio": 0.0004934931287154849,
170
+ "hl_spread": 0.0045323900066327905,
171
+ "prev_ret": -0.008223684210526315
172
+ },
173
+ "rule_used": "close_to_high < 0.2902 AND vol_5m_ratio > 0.0248"
174
+ },
175
+ "DIVISLAB": {
176
+ "prediction": "DOWN",
177
+ "features": {
178
+ "ret_5m": -0.0035346097201767305,
179
+ "gap": 0.0032505910165484633,
180
+ "candle_shape": -0.7164179104263757,
181
+ "close_to_high": 0.2835820895437737,
182
+ "vol_5m_ratio": 0.0017822289693948746,
183
+ "hl_spread": 0.004933726067746686,
184
+ "prev_ret": 0.015987390227426256
185
+ },
186
+ "rule_used": "vol_5m_ratio > 0.0376 AND prev_ret < 0.0064"
187
+ },
188
+ "DRREDDY": {
189
+ "prediction": "DOWN",
190
+ "features": {
191
+ "ret_5m": -0.0007892659826361484,
192
+ "gap": -0.002362204724409449,
193
+ "candle_shape": -0.20408163261140813,
194
+ "close_to_high": 0.20408163261140813,
195
+ "vol_5m_ratio": 0.0007998550867700401,
196
+ "hl_spread": 0.003867403314917199,
197
+ "prev_ret": 0.0007880220646178094
198
+ },
199
+ "rule_used": "close_to_high < 0.3847 AND vol_5m_ratio > 0.0082"
200
+ },
201
+ "EICHERMOT": {
202
+ "prediction": "UP",
203
+ "features": {
204
+ "ret_5m": 0.003708609271523179,
205
+ "gap": -0.00572858365707513,
206
+ "candle_shape": 0.4869565217306617,
207
+ "close_to_high": 0.9999999999826088,
208
+ "vol_5m_ratio": 0.0008083166956206224,
209
+ "hl_spread": 0.0076158940397350995,
210
+ "prev_ret": 0.009773936170212766
211
+ },
212
+ "rule_used": "gap > -0.0095 AND close_to_high > 0.0295"
213
+ },
214
+ "GRASIM": {
215
+ "prediction": "UP",
216
+ "features": {
217
+ "ret_5m": 0.00207329909731747,
218
+ "gap": -0.002481784339304522,
219
+ "candle_shape": 0.46099290776872687,
220
+ "close_to_high": 0.8226950354026445,
221
+ "vol_5m_ratio": 0.00012080961728694583,
222
+ "hl_spread": 0.004497464195719406,
223
+ "prev_ret": -0.00493905334810825
224
+ },
225
+ "rule_used": "gap < 0.0041 AND prev_ret < -0.0037"
226
+ },
227
+ "HCLTECH": {
228
+ "prediction": "DOWN",
229
+ "features": {
230
+ "ret_5m": -0.00873873873873878,
231
+ "gap": -0.04260824564429885,
232
+ "candle_shape": -0.5052083333070215,
233
+ "close_to_high": 0.44270833331027454,
234
+ "vol_5m_ratio": 0.007447771808723967,
235
+ "hl_spread": 0.01729729729729734,
236
+ "prev_ret": 0.00642361111111119
237
+ },
238
+ "rule_used": "ret_5m > -0.0075 AND gap < -0.0010"
239
+ },
240
+ "HDFCBANK": {
241
+ "prediction": "DOWN",
242
+ "features": {
243
+ "ret_5m": -0.002472422974515082,
244
+ "gap": -0.015294337973656282,
245
+ "candle_shape": -0.4062499999153779,
246
+ "close_to_high": 0.5312499998893184,
247
+ "vol_5m_ratio": 0.0018721398963810457,
248
+ "hl_spread": 0.006085964244960003,
249
+ "prev_ret": 0.018372536554354793
250
+ },
251
+ "rule_used": "gap > -0.0046 AND hl_spread > 0.0072"
252
+ },
253
+ "HDFCLIFE": {
254
+ "prediction": "UP",
255
+ "features": {
256
+ "ret_5m": 0.0014505119453925304,
257
+ "gap": -0.00879566982408668,
258
+ "candle_shape": 0.6296296291632435,
259
+ "close_to_high": 0.7407407401920314,
260
+ "vol_5m_ratio": 0.0005445048887432678,
261
+ "hl_spread": 0.002303754266211643,
262
+ "prev_ret": 0.01406518010291603
263
+ },
264
+ "rule_used": "close_to_high < 0.7809 AND vol_5m_ratio < 0.0499"
265
+ },
266
+ "HEROMOTOCO": {
267
+ "prediction": "DOWN",
268
+ "features": {
269
+ "ret_5m": -0.0013174441583327255,
270
+ "gap": -0.0030447761194030212,
271
+ "candle_shape": -0.32038834949899225,
272
+ "close_to_high": 0.5825242718163978,
273
+ "vol_5m_ratio": 0.0005787235127345385,
274
+ "hl_spread": 0.004112022676008435,
275
+ "prev_ret": 7.960832703093503e-05
276
+ },
277
+ "rule_used": "ret_5m < -0.0066 AND close_to_high > 0.0984"
278
+ },
279
+ "HINDALCO": {
280
+ "prediction": "DOWN",
281
+ "features": {
282
+ "ret_5m": 0.0054108216432865505,
283
+ "gap": -0.01383399209486166,
284
+ "candle_shape": 0.3033707864998082,
285
+ "close_to_high": 0.9606741572493979,
286
+ "vol_5m_ratio": 0.0009230778775695824,
287
+ "hl_spread": 0.01783567134268544,
288
+ "prev_ret": 0.005964214711729622
289
+ },
290
+ "rule_used": "vol_5m_ratio > 0.0208 AND prev_ret < -0.0007"
291
+ },
292
+ "HINDUNILVR": {
293
+ "prediction": "DOWN",
294
+ "features": {
295
+ "ret_5m": -0.003077480086893432,
296
+ "gap": -0.0017619155184097994,
297
+ "candle_shape": -0.5312499999584861,
298
+ "close_to_high": 0.4687499999633889,
299
+ "vol_5m_ratio": 0.00044630271917906557,
300
+ "hl_spread": 0.005792903692975981,
301
+ "prev_ret": 0.0021732240684566406
302
+ },
303
+ "rule_used": "gap > 0.0004 AND close_to_high < 0.6781"
304
+ },
305
+ "ICICIBANK": {
306
+ "prediction": "DOWN",
307
+ "features": {
308
+ "ret_5m": 0.0029839612085042896,
309
+ "gap": -0.0003728560775540641,
310
+ "candle_shape": 0.40816326526447505,
311
+ "close_to_high": 0.7653061223708907,
312
+ "vol_5m_ratio": 0.0011860254414294957,
313
+ "hl_spread": 0.007310704960835475,
314
+ "prev_ret": 0.005548890221955678
315
+ },
316
+ "rule_used": "gap > -0.0052 AND vol_5m_ratio > 0.0385"
317
+ },
318
+ "INDUSINDBK": {
319
+ "prediction": "DOWN",
320
+ "features": {
321
+ "ret_5m": -0.003036760788492299,
322
+ "gap": -0.0015426352465557163,
323
+ "candle_shape": -0.8028169011823217,
324
+ "close_to_high": 0.1267605633445569,
325
+ "vol_5m_ratio": 0.00039973685659876884,
326
+ "hl_spread": 0.003782631859349978,
327
+ "prev_ret": 0.003148345784418405
328
+ },
329
+ "rule_used": "vol_5m_ratio > 0.0195 AND hl_spread < 0.0124"
330
+ },
331
+ "INFY": {
332
+ "prediction": "UP",
333
+ "features": {
334
+ "ret_5m": -0.01854466723147891,
335
+ "gap": -0.057994147379622316,
336
+ "candle_shape": -0.7111913357143979,
337
+ "close_to_high": 0.288808664249501,
338
+ "vol_5m_ratio": 0.00804127638139769,
339
+ "hl_spread": 0.02607549656405916,
340
+ "prev_ret": -0.013299501268702463
341
+ },
342
+ "rule_used": "gap < -0.0022 AND prev_ret > -0.0173"
343
+ },
344
+ "ITC": {
345
+ "prediction": "DOWN",
346
+ "features": {
347
+ "ret_5m": -0.0010351966873706395,
348
+ "gap": -0.003610108303249136,
349
+ "candle_shape": -0.22222222205762718,
350
+ "close_to_high": 0.2962962960768082,
351
+ "vol_5m_ratio": 0.0015736952309674762,
352
+ "hl_spread": 0.004658385093167584,
353
+ "prev_ret": -0.0006871671534100279
354
+ },
355
+ "rule_used": "ret_5m < 0.0007 AND close_to_high > 0.3338"
356
+ },
357
+ "JSWSTEEL": {
358
+ "prediction": "DOWN",
359
+ "features": {
360
+ "ret_5m": -0.0011636927851047323,
361
+ "gap": -0.005401234567901234,
362
+ "candle_shape": -0.07462686566792935,
363
+ "close_to_high": 0.9253731342823194,
364
+ "vol_5m_ratio": 0.0014687646754325562,
365
+ "hl_spread": 0.015593483320403343,
366
+ "prev_ret": 0.006211180124223602
367
+ },
368
+ "rule_used": "gap > -0.0035 AND prev_ret < -0.0008"
369
+ },
370
+ "KOTAKBANK": {
371
+ "prediction": "UP",
372
+ "features": {
373
+ "ret_5m": -0.0001242236024845003,
374
+ "gap": -0.0012406947890818859,
375
+ "candle_shape": -0.04166666663195431,
376
+ "close_to_high": 0.08333333326386125,
377
+ "vol_5m_ratio": 0.00033699050821034215,
378
+ "hl_spread": 0.002981366459627301,
379
+ "prev_ret": -0.002351776209926943
380
+ },
381
+ "rule_used": "ret_5m > -0.0076 AND vol_5m_ratio < 0.0171"
382
+ },
383
+ "LT": {
384
+ "prediction": "DOWN",
385
+ "features": {
386
+ "ret_5m": -0.001885441527446214,
387
+ "gap": -0.0014299332697807435,
388
+ "candle_shape": -0.34497816592377595,
389
+ "close_to_high": 0.4890829694109772,
390
+ "vol_5m_ratio": 0.0005716136931657703,
391
+ "hl_spread": 0.005465393794749533,
392
+ "prev_ret": -0.002780616488818076
393
+ },
394
+ "rule_used": "vol_5m_ratio < 0.0433 AND hl_spread > 0.0067"
395
+ },
396
+ "MARUTI": {
397
+ "prediction": "DOWN",
398
+ "features": {
399
+ "ret_5m": -0.0011865915158706616,
400
+ "gap": -0.0012591659877046145,
401
+ "candle_shape": -0.2909090909038017,
402
+ "close_to_high": 0.3454545454482645,
403
+ "vol_5m_ratio": 0.0005706390301743404,
404
+ "hl_spread": 0.004078908335805399,
405
+ "prev_ret": -0.010625824417411696
406
+ },
407
+ "rule_used": "gap > -0.0054 AND hl_spread > 0.0059"
408
+ },
409
+ "NESTLEIND": {
410
+ "prediction": "DOWN",
411
+ "features": {
412
+ "ret_5m": 0.006312769010043009,
413
+ "gap": -0.004285714285714286,
414
+ "candle_shape": 0.9166666665711845,
415
+ "close_to_high": 0.9166666665711845,
416
+ "vol_5m_ratio": 0.0004919700103496338,
417
+ "hl_spread": 0.006886657101865071,
418
+ "prev_ret": -0.005187237973424255
419
+ },
420
+ "rule_used": "vol_5m_ratio > 0.0013 AND prev_ret < 0.0017"
421
+ },
422
+ "NTPC": {
423
+ "prediction": "DOWN",
424
+ "features": {
425
+ "ret_5m": 0.005940046967813329,
426
+ "gap": -0.00013812154696135737,
427
+ "candle_shape": 0.44329896898077326,
428
+ "close_to_high": 0.824742267871193,
429
+ "vol_5m_ratio": 0.0006638014154055953,
430
+ "hl_spread": 0.013399640834369295,
431
+ "prev_ret": 0.014005602240896359
432
+ },
433
+ "rule_used": "ret_5m < 0.0049 AND gap < 0.0014"
434
+ },
435
+ "ONGC": {
436
+ "prediction": "DOWN",
437
+ "features": {
438
+ "ret_5m": -0.0020383204239706482,
439
+ "gap": -0.0008146639511201167,
440
+ "candle_shape": -0.31249999980468307,
441
+ "close_to_high": 0.6874999995703169,
442
+ "vol_5m_ratio": 0.0008910042928859849,
443
+ "hl_spread": 0.006522625356706167,
444
+ "prev_ret": -0.0018296401707663698
445
+ },
446
+ "rule_used": "vol_5m_ratio > 0.0165 AND hl_spread > 0.0081"
447
+ },
448
+ "POWERGRID": {
449
+ "prediction": "DOWN",
450
+ "features": {
451
+ "ret_5m": -0.0001730403183942252,
452
+ "gap": -0.0008644536652835409,
453
+ "candle_shape": -0.028571428555108535,
454
+ "close_to_high": 0.5428571425469323,
455
+ "vol_5m_ratio": 0.0006629420734558732,
456
+ "hl_spread": 0.0060564111437965045,
457
+ "prev_ret": 0.00995285489785216
458
+ },
459
+ "rule_used": "gap < -0.0038 AND hl_spread < 0.0261"
460
+ },
461
+ "RELIANCE": {
462
+ "prediction": "DOWN",
463
+ "features": {
464
+ "ret_5m": 0.0030120481927710845,
465
+ "gap": -0.002253944402704733,
466
+ "candle_shape": 0.3669724770305499,
467
+ "close_to_high": 0.6422018348034624,
468
+ "vol_5m_ratio": 0.001213777883938126,
469
+ "hl_spread": 0.008207831325301273,
470
+ "prev_ret": 0.0007518796992481203
471
+ },
472
+ "rule_used": "close_to_high > 0.4682 AND prev_ret < 0.0007"
473
+ },
474
+ "SBILIFE": {
475
+ "prediction": "DOWN",
476
+ "features": {
477
+ "ret_5m": 0.003499999999999975,
478
+ "gap": -0.004094279074914292,
479
+ "candle_shape": 0.7974683543294194,
480
+ "close_to_high": 0.7974683543294194,
481
+ "vol_5m_ratio": 0.00022833469074943564,
482
+ "hl_spread": 0.0043888888888889395,
483
+ "prev_ret": 0.003553581343697996
484
+ },
485
+ "rule_used": "hl_spread > 0.0057 AND prev_ret < 0.0058"
486
+ },
487
+ "SBIN": {
488
+ "prediction": "DOWN",
489
+ "features": {
490
+ "ret_5m": -0.0019193857965451055,
491
+ "gap": -0.00047961630695443646,
492
+ "candle_shape": -0.6249999998046786,
493
+ "close_to_high": 0.3749999998828214,
494
+ "vol_5m_ratio": 0.0005517961770120836,
495
+ "hl_spread": 0.0030710172744722124,
496
+ "prev_ret": 0.014203716314816527
497
+ },
498
+ "rule_used": "ret_5m > 0.0001 AND close_to_high < 0.6810"
499
+ },
500
+ "SUNPHARMA": {
501
+ "prediction": "UP",
502
+ "features": {
503
+ "ret_5m": 0.006962719298245639,
504
+ "gap": -0.001368738023542294,
505
+ "candle_shape": 0.8410596025933154,
506
+ "close_to_high": 0.8807947019284265,
507
+ "vol_5m_ratio": 0.0007961138323301204,
508
+ "hl_spread": 0.008278508771929774,
509
+ "prev_ret": 0.0049518569463548835
510
+ },
511
+ "rule_used": "close_to_high > 0.0984 AND vol_5m_ratio < 0.0198"
512
+ },
513
+ "TATACONSUM": {
514
+ "prediction": "UP",
515
+ "features": {
516
+ "ret_5m": 0.004162895927601728,
517
+ "gap": -0.00495272399819901,
518
+ "candle_shape": 0.9583333331336706,
519
+ "close_to_high": 0.9583333331336706,
520
+ "vol_5m_ratio": 0.0006245639332478234,
521
+ "hl_spread": 0.004343891402714891,
522
+ "prev_ret": -0.01253779121465402
523
+ },
524
+ "rule_used": "candle_shape > 0.5173 AND prev_ret < 0.0138"
525
+ },
526
+ "TATASTEEL": {
527
+ "prediction": "UP",
528
+ "features": {
529
+ "ret_5m": -0.0001505646173149367,
530
+ "gap": -0.006234413965087282,
531
+ "candle_shape": -0.014150943389551947,
532
+ "close_to_high": 0.9858490561387498,
533
+ "vol_5m_ratio": 0.001030697398009603,
534
+ "hl_spread": 0.010639899623588479,
535
+ "prev_ret": 0.007487060951711015
536
+ },
537
+ "rule_used": "ret_5m > -0.0121 AND hl_spread > 0.0101"
538
+ },
539
+ "TCS": {
540
+ "prediction": "UP",
541
+ "features": {
542
+ "ret_5m": -0.01572446555819473,
543
+ "gap": -0.04448479346345892,
544
+ "candle_shape": -0.6580516898477483,
545
+ "close_to_high": 0.2047713717653156,
546
+ "vol_5m_ratio": 0.011288272865556824,
547
+ "hl_spread": 0.02389548693586707,
548
+ "prev_ret": -0.002716161158895428
549
+ },
550
+ "rule_used": "gap < -0.0108 AND candle_shape > -0.6825"
551
+ },
552
+ "TECHM": {
553
+ "prediction": "UP",
554
+ "features": {
555
+ "ret_5m": 0.006370370370370303,
556
+ "gap": -0.0675507666804807,
557
+ "candle_shape": 0.37391304346199983,
558
+ "close_to_high": 0.4521739130238126,
559
+ "vol_5m_ratio": 0.008324274419476734,
560
+ "hl_spread": 0.017037037037037038,
561
+ "prev_ret": -0.004264099037138958
562
+ },
563
+ "rule_used": "vol_5m_ratio < 0.0931 AND prev_ret > -0.0072"
564
+ },
565
+ "TITAN": {
566
+ "prediction": "DOWN",
567
+ "features": {
568
+ "ret_5m": 0.0022935779816513763,
569
+ "gap": -0.006607427660059239,
570
+ "candle_shape": 0.43478260867674856,
571
+ "close_to_high": 0.43478260867674856,
572
+ "vol_5m_ratio": 0.00030434954582323295,
573
+ "hl_spread": 0.005275229357798165,
574
+ "prev_ret": 0.002054794520547945
575
+ },
576
+ "rule_used": "candle_shape < 0.6971 AND hl_spread > 0.0074"
577
+ },
578
+ "ULTRACEMCO": {
579
+ "prediction": "DOWN",
580
+ "features": {
581
+ "ret_5m": 0.009371408363539916,
582
+ "gap": -0.01300174520069808,
583
+ "candle_shape": 0.9724770642112617,
584
+ "close_to_high": 0.9724770642112617,
585
+ "vol_5m_ratio": 0.00036023544283325995,
586
+ "hl_spread": 0.00963663690213067,
587
+ "prev_ret": 0.006145741878841089
588
+ },
589
+ "rule_used": "gap > 0.0006 AND prev_ret < 0.0135"
590
+ },
591
+ "UPL": {
592
+ "prediction": "DOWN",
593
+ "features": {
594
+ "ret_5m": -0.005484610347085641,
595
+ "gap": 0.001229407425620851,
596
+ "candle_shape": -0.6146788989697619,
597
+ "close_to_high": 0.3486238531470553,
598
+ "vol_5m_ratio": 0.0005007944701025012,
599
+ "hl_spread": 0.008922724296005314,
600
+ "prev_ret": -0.009659090909090983
601
+ },
602
+ "rule_used": "ret_5m > -0.0024 AND gap > 0.0029"
603
+ },
604
+ "WIPRO": {
605
+ "prediction": "UP",
606
+ "features": {
607
+ "ret_5m": -0.0022063815342836975,
608
+ "gap": -0.033305988515176396,
609
+ "candle_shape": -0.22159090896499856,
610
+ "close_to_high": 0.7784090904668196,
611
+ "vol_5m_ratio": 0.007039389248394708,
612
+ "hl_spread": 0.009957003847024163,
613
+ "prev_ret": -0.00878191575865997
614
+ },
615
+ "rule_used": "candle_shape < 0.7496 AND close_to_high > 0.5824"
616
+ }
617
+ }
618
+ }