From a working NIFTY 15m research build. These are the actual feature families that went

into a 117-column matrix — documented so you can steal the structure, not the bugs.


The Feature Contract Mindset


Before you compute anything, declare a **null policy** per feature. The old system lost

weeks to silent `fillna(0)` turning "missing" into "computed zero." Every feature here has

an explicit policy: `forward_fill_within_session`, `zero_is_valid_default`,

`require_and_drop_row`, or `median_impute_with_flag`.


The 12 Feature Families


1. Price Action (25 cols)

`rvol` (vol / 20-bar SMA), `atr` (14, Wilder), `effort = rvol × (c−o)/range`,

`close_loc = (c−l)/(h−l)`, `wick_bias`, `result = |c−o|/atr`, `upper/lower_wick`,

`range_high/low` (20-bar HH/LL), `accept_up/dn` (close breaks 5-bar HH/LL),

`accept_up/dn_mem` (3-bar persistence), `failed_up/dn`, `retest_sup/res`,

`dist_sup_atr/dist_res_atr`.


2. Market Microstructure (12)

`closeq_strong/weak`, `ib_up/dn` (inside-bar breaks), `velocity_fast/med`,

`trend_bull/bear`, `pressure_buy/sell` (composite: rvol×effort + close_loc×0.6 + wick×0.4).


3. Order Flow (10)

`harmony_expand/absorb`, `er/dir_er` (efficiency ratio), `absorb_up/dn_qty` (effort×vol×result),

`absorb_up/dn_spd` (3-EMA), `ofs_aggr/passive_up/dn`.


4. Operator Analysis (4)

`operator_expand_up/dn`, `operator_absorb_up/dn`.


5. S/R & Breakout Scoring (6)

`sr_score_support/resistance` [0-100], `break_prob_support/resistance` [5-95],

`bull_power/bear_power` [0-100], `trap_risk`, `net_power`.


6. Time (2)

`hour_sin`, `hour_cos` — cyclic encoding beats raw hour.


7. Lag (6)

`prev_return_1/3/5`, `prev_vol_1/3/5`, `prev_range_1/3/5`.


8. Multi-Timeframe (4)

`h1_close_vs_sma`, `h1_range_ratio`, `h1_vol_ratio`, `h1_trend`.


9. Volatility Regime (3)

`vol_regime` (atr14/atr20), `vol_contraction` (<0.85), `vol_expansion` (>1.15).


10. Side Score (12)

From `operator_side_score_snapshot`: `alignment_score`, `active_side_code`

(CE=1/PE=−1), `ce/pe_trade_score_final`, gate states, `entry_ready_code`,

`setup_label` (ordinal: NEUTRAL→FAILED_AUCTION).


11. Options (3)

`pc_vol_ratio` (PE_vol/CE_vol), `pc_oi_ratio`, `total_premium`.


12. Operator Anchor (12)

From `operator_underlying_15m`: anchor scores, accept zones, break level, liquidity

levels, numbered state codes.


What Actually Mattered


Feature importance was **well-distributed** — no single feature above 25%. Top regression

features: `prev_range_1` (34.6%), `prev_return_5` (21.3%), `range_low` (15.1%), `atr` (15.1%).

Across classifiers, `h1_trend` (multi-timeframe) and lag returns were consistently strong.


**Takeaway:** a broad, mechanically-derived feature set beat a handful of clever indicators.

The model learned from *effort, result, and regime* — not from one magic column.


*Research only. Not investment advice.*





More From Shakti Tiwari


  • 🌐 **Websites:** [shaktitiwari.github.io/shakti-tiwari-nse](https://shaktitiwari.github.io/shakti-tiwari-nse) · [OptionTradingWithAI.in](https://optiontradingwithai.in)
  • 📚 **Books:** *Build Your Own AI* · *Option Trading with AI* (on [Amazon India](https://www.amazon.in/)) — practical guides from a Nifty options trader and ML practitioner.
  • 💬 **Community:** [Join the Discord](https://discord.gg/shaktitiwari) for live discussion, code, and research.
  • 💻 **Code:** [GitHub/shaktitiwari](https://github.com/shaktitiwari) — open research, models, and tools.
  • Educational only — not SEBI-registered investment advice. NISM-Series-XII certified; not a SEBI-registered Research Analyst. Content is educational only.

    Home | About