ML-discovered Nifty day-structure rules (v3)
What this found (honest summary)
- Level / structure facts replicate; direction does not. Rules about where the day ends relative to the open, whether price returns to the open, and whether it reaches the prior-day high/low hold out-of-sample (most PASS rules). Many of these are close to mechanical: the bigger the move already made, or the nearer price already is to PDH/PDL, the likelier the level holds or gets touched.
- Continuation-vs-reversal rules (price further in the move's direction after +30m/+60m/13:00/close; MFE > MAE) almost all FAIL out-of-sample (see family table).
- Backtests are mostly negative after estimated costs even for PASS rules: a stable conditional probability of a level is not the same as a profitable entry at the decision-time price. Median OOS net per trade for PASS+WATCH: -5.7 pts; share with positive OOS net: 35%.
| family | PASS | WATCH | FAIL |
|---|---|---|---|
| direction (continuation / reversal) | 0 | 7 | 377 |
| level / structure | 276 | 98 | 214 |
All candidate rules (972)
Downloads: rules.csv · rules.json. Click a column header to sort; PASS/WATCH ids link to a rule page. "lift" = hit ÷ base. Placebo p = OOS matched-random (same count of days per year × move-direction stratum, 2000 draws). Corrected p: BH/Holm over all 972 OOS tests; train-side BH/Holm over all 9,242,869 hypotheses. By-year = hit/base % (n rule days). BT = spot-points backtest, net of estimated costs (IS = train, OOS = 2025–26).
| id | verdict | rule (plain words) | time | target | train n | train hit | base | train lift | OOS n | OOS hit | OOS base | OOS lift | placebo p | BH q (OOS, all) | BH q (OOS, family) | Holm (OOS) | BH q (train, all) | Holm (train, all) | stable | by year | BT IS n | IS win | IS avg pts | IS maxDD | BT OOS n | OOS win | OOS avg pts | OOS maxDD | method |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| loading rules.json … | |||||||||||||||||||||||||||||
Equity curves: top 20 by OOS avg net (≥20 OOS trades)
Selected by out-of-sample backtest result, so this gallery is optimistic by construction. Every PASS/WATCH rule page also has its own curve.




















PASS / WATCH rule pages
R0847 R0830 R0950 R0951 R0952 R0698 R0711 R0832 R0413 R0709 R0703 R0408 R0846 R0559 R0712 R0715 R0710 R0781 R0415 R0900 R0558 R0421 R0780 R0903 R0411 R0904 R0566 R0420 R0651 R0782 R0901 R0410 R0504 R0120 R0787 R0424 R0784 R0902 R0278 R0126 R0425 R0279 R0426 R0569 R0507 R0267 R0557 R0280 R0127 R0135 R0701 R0505 R0134 R0649 R0266 R0136 R0121 R0133 R0283 R0078 R0414 R0139 R0123 R0072 R0362 R0111 R0122 R0253 R0108 R0509 R0137 R0768 R0277 R0265 R0888 R0889 R0890 R0891 R0892 R0894 R0138 R0498 R0366 R0637 R0511 R0125 R0774 R0770 R0639 R0510 R0281 R0074 R0124 R0110 R0769 R0401 R0771 R0115 R0541 R0367 R0641 R0252 R0114 R0492 R0132 R0364 R0773 R0257 R0691 R0636 R0494 R0396 R0254 R0399 R0403 R0084 R0521 R0353 R0211 R0792 R0795 R0796 R0816 R0817 R0820 R0821 R0822 R0823 R0688 R0685 R0687 R0794 R0798 R0797 R0818 R0793 R0686 R0518 R0520 R0913 R0914 R0915 R0916 R0917 R0918 R0919 R0661 R0912 R0660 R0664 R0666 R0480 R0936 R0937 R0938 R0939 R0940 R0942 R0943 R0757 R0758 R0759 R0760 R0761 R0762 R0941 R0756 R0876 R0877 R0878 R0879 R0880 R0881 R0882 R0883 R0766 R0767 R0885 R0634 R0886 R0488 R0887 R0380 R0381 R0238 R0548 R0527 R0776 R0524 R0263 R0357 R0644 R0802 R0803 R0922 R0801 R0369 R0671 R0777 R0514 R0790 R0647 R0800 R0923 R0513 R0693 R0946 R0778 R0260 R0262 R0898 R0896 R0418 R0945 R0788 R0824 R0779 R0789 R0515 R0645 R0119 R0692 R0826 R0405 R0944 R0285 R0550 R0899 R0560 R0274 R0694 R0404 R0947 R0416 R0659 R0561 R0658 R0261 R0656 R0275 R0836 R0908 R0791 R0910 R0130 R0272 R0695 R0273 R0657 R0909 R0897 R0911 R0117 R0128 R0129 R0131 R0140 R0142 R0143 R0284 R0407 R0417 R0419 R0428 R0429 R0430 R0431 R0549 R0573 R0574 R0705 R0719 R0837 R0838 R0849 R0968 R0948 R0841 R0954 R0964 R0828 R0842 R0843 R0699 R0960 R0961 R0696 R0845 R0840 R0835 R0697 R0829 R0564 R0713 R0268 R0554 R0700 R0783 R0906 R0702 R0786 R0556 R0905 R0654 R0555 R0655 R0271 R0785 R0412 R0907 R0276 R0282 R0422 R0565 R0264 R0708 R0409 R0652 R0506 R0269 R0893 R0895 R0109 R0493 R0642 R0546 R0542 R0690 R0497 R0255 R0547 R0365 R0113 R0349 R0665 R0495 R0064 R0402 R0819 R0355 R0540 R0144 R0054 R0007 R0519 R0747 R0522 R0487 R0624 R0483 R0763 R0765 R0683 R0884 R0920 R0635 R0441 R0875 R0382 R0585 R0500 R0502 R0670 R0825 R0921 R0572 R0827 R0717 R0706 R0116 R0704 R0118 R0141 R0201 R0286 R0287 R0501 R0551 R0848 R0957 R0958
Verdict criteria
- PASS = all of: OOS lift in the same direction as train; OOS Wilson 95% CI excludes the OOS base rate; OOS BH q ≤ 0.05 both over all 972 OOS tests and within the rule's target family (level/structure vs direction; added so that many strong structural effects cannot make the BH threshold lenient for weak directional rules); train BH q ≤ 0.05 (over all 9,242,869 hypotheses searched); stable by year (same direction in ≥80% of years with ≥10 rule days and in every OOS year with ≥10); OOS matched-random placebo p ≤ 0.05; ≥20 OOS days.
- WATCH = OOS lift in the same direction with one-sided OOS p < 0.10, missing exactly one of the other criteria.
- FAIL = everything else.
Method & search log
- Data: Nifty 50 spot 1-min, 2022-01-03 → 2026-10-09 (1177 sessions; base parquet read-only to 2026-10-06, Oct 7–9 appended from live feeds the same way as the opening-30m-move generator). Train 2022-01-03 → 2024-12-31; OOS 2025-01-01 → 2026-10-09, evaluated once with frozen rules and thresholds.
- Decision times 09:20, 09:30, 09:45, 10:15, 11:00, 13:00, 14:30 IST; features use only bars that closed by then (bar-start timestamps; the 09:44 bar closes at 09:45). One row per day per decision time, so each day counts once per rule.
- Features: gap vs prior close; move from open to t (signed and absolute); opening-range size, break state and first-break direction (5-min OR for ≤09:30, 15-min at 09:45, 30-min after); price vs time-weighted VWAP (index volume is 0); prior-day range, position vs PDH/PDL and CPR, PDH/PDL touched so far; prior-day return; India VIX prior-day close and change (prior day only, no intraday timing assumed); day of week, days to weekly expiry (actual expiries from the options mirror from Oct-2024, Thursday rule before, Tuesday from Sep-2025); range so far and position in it; 1-min RSI/ADX/Bollinger %B/EMA9−21/ATR/Supertrend from Indicator Bot
features.compute_all(causal). - Targets (oriented to the direction of the move so far): continuation at +30m, +60m, 13:00, close; close beyond open ±0/50/100/150 pts; never trades back to the open; reaches PDH / PDL (days not yet there); MFE > MAE to close.
- Search: (1) exhaustive subgroup scan of 1–3 conditions over train-quintile bins (≤q20, ≤q40, ≥q60, ≥q80), sign splits and category levels, distinct features only, ≥30 train days; (2) depth-3 decision trees (min leaf 30), every node path a hypothesis; (3) RuleFit (40 depth-3 boosted trees → all paths ≤3 conditions → L1 logistic), every generated rule with ≥30 days a hypothesis. Two-sided exact binomial test vs the train base rate.
- Hypotheses by decision time:
Total 9,242,869; train BH survivors at q ≤ 0.05: 630,716; Holm survivors: 48,373.time conditions subgroup tree RuleFit 09:20 126 1,213,415 146 3,454 09:30 132 1,399,522 136 3,717 09:45 132 1,389,151 144 3,631 10:15 132 1,371,191 134 3,663 11:00 132 1,378,338 138 3,647 13:00 132 1,232,487 118 3,280 14:30 131 1,233,340 109 3,108 - Whole-pipeline placebo: train labels shuffled across days (all targets of a day move together), full subgroup scan rerun 100 times: hypotheses at or below the real BH cutoff p = 0.003: mean 11,961, max 23,742 per placebo run vs 630,716 in the real data; smallest placebo p median 1.3e-06.
- Candidate freezing: per (time, target) cell, BH survivors ranked by |log lift| (smoothed), up to 8 "higher" and 4 "lower" rules kept, near-duplicates (Jaccard ≥ 0.6 of train days) dropped.
- Backtest: enter at the decision-time price in the rule's implied direction (with the move for "higher" continuation/hold rules, against it for "lower" ones; long to PDH / short to PDL for reach rules), stop 0.4% of entry, exit at the target horizon (or close); Nifty futures cost model with STT by date + 0.5 pt slippage/side; spot as futures proxy.
Targets × verdicts
| target | PASS | WATCH | FAIL |
|---|---|---|---|
| price 30 min after 09:20 is further in the move's direction than at 09:20 | 0 | 0 | 12 |
| price 30 min after 09:30 is further in the move's direction than at 09:30 | 0 | 0 | 12 |
| price 30 min after 09:45 is further in the move's direction than at 09:45 | 0 | 0 | 12 |
| price 30 min after 10:15 is further in the move's direction than at 10:15 | 0 | 0 | 12 |
| price 30 min after 11:00 is further in the move's direction than at 11:00 | 0 | 0 | 12 |
| price 30 min after 13:00 is further in the move's direction than at 13:00 | 0 | 0 | 12 |
| price 30 min after 14:30 is further in the move's direction than at 14:30 | 0 | 0 | 12 |
| price 60 min after 09:20 is further in the move's direction than at 09:20 | 0 | 0 | 12 |
| price 60 min after 09:30 is further in the move's direction than at 09:30 | 0 | 0 | 12 |
| price 60 min after 09:45 is further in the move's direction than at 09:45 | 0 | 0 | 12 |
| price 60 min after 10:15 is further in the move's direction than at 10:15 | 0 | 0 | 12 |
| price 60 min after 11:00 is further in the move's direction than at 11:00 | 0 | 0 | 12 |
| price 60 min after 13:00 is further in the move's direction than at 13:00 | 0 | 0 | 12 |
| price at 13:00 is further in the move's direction than at 09:20 | 0 | 1 | 11 |
| price at 13:00 is further in the move's direction than at 09:30 | 0 | 1 | 11 |
| price at 13:00 is further in the move's direction than at 09:45 | 0 | 0 | 12 |
| price at 13:00 is further in the move's direction than at 10:15 | 0 | 1 | 11 |
| price at 13:00 is further in the move's direction than at 11:00 | 0 | 1 | 11 |
| price never trades back to the open after 09:20 | 7 | 4 | 1 |
| price never trades back to the open after 09:30 | 8 | 1 | 3 |
| price never trades back to the open after 09:45 | 7 | 1 | 4 |
| price never trades back to the open after 10:15 | 4 | 5 | 3 |
| price never trades back to the open after 11:00 | 9 | 1 | 2 |
| price never trades back to the open after 13:00 | 9 | 3 | 0 |
| price never trades back to the open after 14:30 | 12 | 0 | 0 |
| price reaches the prior-day high after 09:20 (days not yet at PDH) | 12 | 0 | 0 |
| price reaches the prior-day high after 09:30 (days not yet at PDH) | 7 | 4 | 1 |
| price reaches the prior-day high after 09:45 (days not yet at PDH) | 10 | 2 | 0 |
| price reaches the prior-day high after 10:15 (days not yet at PDH) | 5 | 3 | 4 |
| price reaches the prior-day high after 11:00 (days not yet at PDH) | 4 | 7 | 1 |
| price reaches the prior-day high after 13:00 (days not yet at PDH) | 5 | 3 | 4 |
| price reaches the prior-day high after 14:30 (days not yet at PDH) | 3 | 4 | 5 |
| price reaches the prior-day low after 09:20 (days not yet at PDL) | 11 | 1 | 0 |
| price reaches the prior-day low after 09:30 (days not yet at PDL) | 8 | 4 | 0 |
| price reaches the prior-day low after 09:45 (days not yet at PDL) | 9 | 1 | 2 |
| price reaches the prior-day low after 10:15 (days not yet at PDL) | 4 | 3 | 5 |
| price reaches the prior-day low after 11:00 (days not yet at PDL) | 6 | 3 | 3 |
| price reaches the prior-day low after 13:00 (days not yet at PDL) | 3 | 6 | 3 |
| price reaches the prior-day low after 14:30 (days not yet at PDL) | 1 | 3 | 8 |
| the best favourable excursion after 09:20 (in the move's direction, to close) exceeds the worst | 0 | 0 | 12 |
| the best favourable excursion after 09:30 (in the move's direction, to close) exceeds the worst | 0 | 0 | 12 |
| the best favourable excursion after 09:45 (in the move's direction, to close) exceeds the worst | 0 | 0 | 12 |
| the best favourable excursion after 10:15 (in the move's direction, to close) exceeds the worst | 0 | 0 | 12 |
| the best favourable excursion after 11:00 (in the move's direction, to close) exceeds the worst | 0 | 1 | 11 |
| the best favourable excursion after 13:00 (in the move's direction, to close) exceeds the worst | 0 | 0 | 12 |
| the best favourable excursion after 14:30 (in the move's direction, to close) exceeds the worst | 0 | 0 | 12 |
| the close is further in the move's direction than the 09:20 price (continuation to close) | 0 | 0 | 12 |
| the close is further in the move's direction than the 09:30 price (continuation to close) | 0 | 0 | 12 |
| the close is further in the move's direction than the 09:45 price (continuation to close) | 0 | 0 | 12 |
| the close is further in the move's direction than the 10:15 price (continuation to close) | 0 | 0 | 12 |
| the close is further in the move's direction than the 11:00 price (continuation to close) | 0 | 0 | 12 |
| the close is further in the move's direction than the 13:00 price (continuation to close) | 0 | 1 | 11 |
| the close is further in the move's direction than the 14:30 price (continuation to close) | 0 | 1 | 11 |
| the day closes more than 100 pts beyond the open in the direction of the move so far | 33 | 12 | 39 |
| the day closes more than 150 pts beyond the open in the direction of the move so far | 41 | 11 | 32 |
| the day closes more than 50 pts beyond the open in the direction of the move so far | 35 | 7 | 42 |
| the day closes on the same side of the open as the move so far | 23 | 9 | 52 |
Generated 2026-10-10 00:44 IST. Code: /workspace/nifty-rules/ml-discovered/. Research notes: nifty-market-games-knowledge/research/ml-rules/v3/.