Feature Engineering is 80% of Success
Feature engineering matters more than model choice. Here are 50 features that consistently improve predictions.
Price Features (10)
- Log returns
- Price ratio (close/open)
- High-low ratio
- Close-to-close range
- Gap (open vs previous close)
- Price momentum (5, 10, 20 days)
- Price acceleration
- Price volatility (5, 20 day)
- Price percentile (20 day)
- Distance from moving average
Volume Features (10)
- Volume ratio (current/average)
- On-Balance Volume (OBV)
- Volume-Price Trend (VPT)
- Accumulation/Distribution
- Chaikin Money Flow
- Volume-weighted average price (VWAP)
- Volume spike (2x average)
- Volume dry up (0.5x average)
- Volume trend (20 day)
- Volume correlation with price
Technical Indicators (15)
- RSI (14)
- MACD signal line
- MACD histogram
- Bollinger Band position
- ATR (14)
- Stochastic %K
- Stochastic %D
- Williams %R
- CCI
- ADX
- Parabolic SAR
- Ichimoku Cloud position
- CMF
- Force Index
- TRIX
Statistical Features (10)
- Skewness (20 day)
- Kurtosis (20 day)
- Z-score of returns
- Hurst exponent
- Autocorrelation (1 lag)
- Autocorrelation (5 lag)
- Entropy
- Correlation with market
- Beta
- Alpha
Time Features (5)
- Day of week
- Month
- Quarter
- Week of month
- Days to expiry
SEBI Disclaimer
Feature engineering for trading involves risk of loss. This article is for educational purposes only.
Validation: Feature Stability and Coverage
Before you model anything, every one of the 50 features must pass three mechanical checks. The first is coverage: the feature must be defined at every timestamp in the training window, with explicit rules for NaNs, bad ticks and truncated days. The second is stability: compute the feature's distribution per quarter; if the mean or variance shifts structurally, your model will silently retrain a wrong baseline. The third is look-back discipline: features must only see data available at the prediction time, which for a daily Indian model means closing at 15:30 IST, not the 17:00 revised feeds.
Leakage Audit: The Five Classic Leaks
A feature set is only as honest as its leakage audit:
- Same-bar leakage: using today's close to predict today's close; shift the target by one bar minimum.
- Rescaling leakage: standardising the whole series before splitting the train/test.
- Filter leakage: dropping rows using information from the full sample.
- Indicator leakage: indicators that internally use future values, such as rolling mean over the whole window.
- Target leakage in engineered bars: constructing the target from the same raw series used to build a feature.
Apply a strict rule at engineering time: write one function that takes a cutoff timestamp, not a full frame, and every feature is computed inside that function.
Feature Store and Reproducibility
Retail quants over-invest in model code and under-invest in the feature layer. A simple feature store with these properties removes weeks of debugging:
- Features are computed once and cached with a version hash tied to the source data snapshot.
- Recompute happens on a schedule, not on ad-hoc notebook runs.
- Every feature is documented with units, timeframe and a worked example.
A good rule is that your research should be reproducible by re-running one command; if you cannot do that, your machine-learning is anecdote, not analysis.
Interaction Blow-Up and Dimensionality Control
50 base features exploding into pair-wise products gives 1,275 interactions and a mountain of noise. Handle it in two stages:
- Rank base features first with a fast model's impurity importance.
- Only create interactions among the top 15, from different families, e.g. momentum crossed with volatility rather than two momentum variants.
For the Nifty daily frame, momentum-times-volatility and volume-change-times-return-imbalance are the interactions that consistently earn their complexity; the rest mostly add variance.
Production Recompute Rules
Research features and live features drift apart unless you enforce parity:
- Keep one shared code path; a notebook copy is the number one divergence source.
- Replay last week's features through the live path and diff against research output.
- Monitor per-feature drift with a Kolmogorov-Smirnov test against the training window, and alert on the top decile of drift.
Features are the thing you actually trade; the model is only a consumer of them. Treating the feature layer as production-grade infrastructure is what separates a 50-feature toy from a 50-feature system.
Proven Feature Families
Group features into five buckets: price transforms, volume patterns, volatility clusters, calendar effects and positioning signals. Keep each family capped so no single group dominates the model's variance. Feature selection should be stability-based, keeping only those that stay meaningful across three separate market regimes.
Start First with a Ten-Feature Kit
Before wiring all fifty, prove a minimal set on the daily Nifty frame: log return, distance from the 20-day mean, RSI-14, ATR(14), volume ratio to its 20-day average, 20-day realised volatility, return skewness, beta to the index, day of the week and days to expiry. These ten cover price, volume, volatility and calendar edges with the smallest leakage surface and the easiest reviews.
Keep the kit running for a full quarter and record each feature's quarterly mean and variance before adding any of the remaining forty. A distribution that silently reshapes itself in the first three months is a model risk, not a data quirk, and a feature that is unstable at ten will only be harder to trust at fifty. Depth built on a shaky foundation multiplies debugging hours, not accuracy; prove the ten before you spend on the forty.