I have now written about thirteen model families for trading in this series. The inevitable question is: which one should you use?
The honest answer is that the question is malformed. "Which model is best" has no answer, because models are not ranked in the abstract — they are ranked against a task, a dataset size, a horizon, and a cost model. A model that wins on 500k rows of order flow loses on 3,000 rows of daily bars. A model that wins on 20-step shape loses on 1-step direction.
This final article is the decision framework. It covers the decision tree, the ensemble question (including why most stacks fail), the reinforcement-learning question, and the checklist I actually use before shipping anything.
Quick answer
- Task type decides the model class, not the other way round.
- 1-step direction → gradient boosting. Always start here.
- Multi-step shape → PatchTST, TCN or N-BEATS.
- Volatility → ARIMA/ETS or a foundation model.
- Calendar/seasonality → Prophet as a feature.
- Multi-task or high-cardinality → deep tabular.
- RL → almost never. It fails on data volume and reward specification.
- Ensembles → only when base models are individually good and decorrelated.
Step 1: name the task precisely
Most model-selection failures are task-definition failures. "Predict the market" is not a task. These are:
| Task | Output | Metric | Candidate models |
|---|---|---|---|
| 1-step direction | P(up) | AUC, net P&L | XGBoost, LightGBM, CatBoost, logistic |
| k-step direction | P(up at t+k) | AUC by horizon | XGBoost, TCN |
| Path shape | normalised 20-bar path | MAE | PatchTST, N-BEATS, TCN |
| Volatility | σ over next k bars | R², QLIKE | ARIMA, ETS, Chronos |
| Regime label | discrete state | F1, stability | TCN, HMM, clustering |
| Sizing | position fraction | Sharpe, drawdown | calibrated tree output |
| Option premium | premium change | MAE, P&L | XGBoost regression |
Write the task in that format before touching code. If you cannot fill the metric column, you are not ready to choose a model.
Step 2: the decision tree
Is the target a single number from a tabular row? ├─ yes → Is the signal sequential/event-based? │ ├─ no → GRADIENT BOOSTING (XGBoost / LightGBM / CatBoost) │ └─ yes → Do you have >30k sequences? │ ├─ no → GRADIENT BOOSTING on engineered lags │ └─ yes → TCN, then feed embedding to a tree └─ no → Is the target a path/shape? ├─ yes → PATCHTST (multi-channel) or N-BEATS (single, interpretable) └─ no → Is the target a smooth positive series (vol, volume)? ├─ yes → ARIMA / ETS baseline, then Chronos └─ no → stop and re-define the task Three properties of this tree are deliberate:
- Trees are the default, not the fallback. You must justify leaving them.
- Sequence models require a data threshold. Below it, they lose for structural reasons.
- There is an exit. "Stop and re-define" is a legitimate outcome, and the most common correct one.
Step 3: the four filters every candidate must pass
Filter 1: Does it beat the dumb baseline?
Before XGBoost, run logistic regression and persistence. If logistic gets 0.51 and your model gets 0.52, the useful signal is 0.01 AUC and your capacity is doing very little.
Filter 2: Does it survive purged walk-forward?
Not a single split. Six folds with a purge gap. Report the median and the standard deviation, not the max.
scores = [score(fold) for fold in folds] print(f"AUC {np.median(scores):.3f} ± {np.std(scores):.3f}") If the std is larger than the gap to the baseline, you have no result.
Filter 3: Does it survive costs?
A 53% directional accuracy at 8 bps per round trip is often negative. Model the cost explicitly:
def net_pnl(p, y, threshold=0.55, cost_bps=8, size=1.0): pos = np.where(p > threshold, 1, np.where(p < 1 - threshold, -1, 0)) gross = pos * y cost = (pos != 0) * (cost_bps / 10_000) return float(np.sum(gross - cost) * size) The threshold is part of the model. A model that is only profitable at a threshold you tuned on the test set has not been validated.
Filter 4: Does it survive a regime split?
Score each fold separately and look at the worst one. A model that makes all its money in one regime is a regime bet, not an edge.
| Fold | Period | AUC | Net P&L |
|---|---|---|---|
| 1 | 2021 bull | 0.57 | +3.1% |
| 2 | 2022 chop | 0.52 | +0.4% |
| 3 | 2022 drawdown | 0.54 | +1.2% |
| 4 | 2023 range | 0.51 | −0.3% |
| 5 | 2024 trend | 0.56 | +2.6% |
| 6 | 2025 vol spike | 0.53 | +0.8% |
This table is more informative than any single average. Fold 4 is flat, which is honest; a model that is profitable in every regime is usually leaking.
The ensemble question
Everyone eventually asks: "can I just average all the models?"
Sometimes. Usually not. The reason is a single statistical fact: ensembling reduces variance, not bias.
When ensembles work
Averaging helps when:
- Each base model is individually better than the baseline.
- Their errors are decorrelated.
- You weight them out-of-sample, not in-sample.
Check condition 2 before building anything:
residuals = np.column_stack([m.resid for m in models]) corr = np.corrcoef(residuals.T) print(corr) If the off-diagonal correlations are above ~0.85, the models are making the same mistakes and the ensemble is a more expensive version of one model.
When ensembles fail
In my tests, XGBoost + LightGBM + LSTM + TCN residuals correlated at 0.88–0.94. They all saw the same features and failed on the same regime shifts. The stack performed at or below the best single model:
| Model | AUC | Net P&L |
|---|---|---|
| XGBoost | 0.550 | +6.8% |
| LightGBM | 0.550 | +6.5% |
| TCN | 0.523 | +2.6% |
| Simple average | 0.541 | +4.2% |
| Weighted (in-sample) | 0.556 | +7.1% |
| Weighted (out-of-sample) | 0.512 | +1.9% |
Read the last two rows. The in-sample weights look great and the out-of-sample weights collapse. That is the ensemble trap: the weights themselves are a fitted parameter, and with six weak, correlated models, the fit is noise.
The stack that does work
The productive ensemble is not a weighted average of predictions. It is a feature stack:
XGBoost on: raw features + ARIMA volatility forecast + Chronos volatility forecast + PatchTST shape embedding (32 dims) + Prophet seasonal component + TCN regime probability Here the base models contribute information, not votes, and the tree learns when to trust each. This pattern has a much better track record because each input is individually interpretable and individually validatable.
What about reinforcement learning?
RL is the most over-sold approach in trading ML, and the failure is structural rather than implementational.
The three problems
1. Sample efficiency. A PPO agent needs millions of episodes to learn a policy. You have 1,700 daily bars. Even with augmentation, you are three orders of magnitude short. On intraday data you can generate more episodes, but they are highly correlated — effective sample size stays small.
2. Reward specification. The reward is P&L, which is a noisy, delayed, non-stationary signal. The agent will find the reward hack: holding a leveraged position through a bull run, then never trading again. This is the classic "do nothing and win" degenerate policy.
3. Non-stationarity. The environment changes. A policy trained on 2021 is wrong for 2022. RL assumes a stationary MDP or a slowly changing one; markets violate both.
Where RL is defensible
- Execution: optimal order placement given a fixed alpha signal. This is genuine RL territory — the state is the order book, the action is placement, the reward is slippage. It is also a well-studied problem where simple heuristics (VWAP, TWAP) are strong baselines.
- Position sizing with a known signal: a small action space, dense rewards, and a fixed alpha. Still risky, but bounded.
- Portfolio allocation: with a small asset universe and a risk penalty.
Where it is not
- Learning alpha from raw prices
- Learning to trade options end-to-end
- Anything with fewer than ~100k environment steps
A defensible framing
# Do not learn alpha with RL. Learn sizing. # State: current position, vol regime, signal strength, drawdown # Action: {0, 0.25, 0.5, 1.0} of max size # Reward: -drawdown_penalty * dd - transaction_cost + pnl Even here, compare against a fixed-fraction baseline. In most tests, a calibrated probability threshold with fixed sizing matches or beats the learned policy, and it is auditable.
The pre-shipment checklist
This is the list I actually run. It has caught more bugs than any model improvement.
[ ] Task and metric written down before modelling [ ] Baseline (logistic / persistence) scored [ ] Purged walk-forward, 6 folds minimum [ ] Median and std reported, not the best fold [ ] Scaler fit on train only [ ] No shuffled CV anywhere [ ] Label timestamp strictly after feature timestamp [ ] Past-vs-future correlation check on every feature [ ] Costs modelled at realistic bps [ ] Threshold chosen on validation, not test [ ] Calibration fit on validation, not test [ ] Worst-fold P&L is not catastrophic [ ] Feature importance computed on test folds [ ] Model version and config logged [ ] Regime split reviewed Fifteen lines. Most published trading-ML results would fail at least three.
Model-by-model summary
| Model | Best task | Strength | Fatal weakness | Verdict |
|---|---|---|---|---|
| Logistic | direction | interpretable | no interactions | baseline |
| XGBoost | direction | robust, fast | no sequence | default |
| LightGBM | direction | speed at scale | similar to XGB | tie |
| CatBoost | direction + categoricals | ordered statistics | slow | niche |
| LSTM/GRU | event sequences | variable-length | no edge on tabular | hybrid only |
| TCN | local patterns | causal, parallel | needs data | good seq default |
| PatchTST | shape | cheap attention | weak direction | best shape |
| Transformer zoo | — | benchmark wins | doesn't transfer | skip |
| TabNet/FT-Trans | large tabular | multi-task | data hungry | niche |
| N-BEATS | interpretable shape | decomposition | trend extrapolation | single series |
| ARIMA/ETS | volatility | cheap, strong | no direction | use for vol |
| Prophet | calendar | seasonality | price levels | feature only |
| Foundation models | vol, cold start | zero-shot | no regime adaptation | feature only |
| RL | execution, sizing | flexible | sample efficiency | narrow use |
| Ensembles | — | variance reduction | correlated errors | feature stack only |
The uncomfortable conclusion
After all thirteen families, the ranking is almost boring:
- Gradient boosting on good features wins direction.
- Sequence models win shape and add features.
- Classical models win volatility and seasonality.
- Everything else is either a niche tool or a way to overfit faster.
That is not because the field is stagnant. It is because the model is the smallest lever. In every honest test, the difference between the best and worst reasonable model was smaller than the difference between a clean split and a leaky one, or between a realistic cost model and none.
The traders who do well with ML are not the ones with the fanciest architecture. They are the ones who:
- define the label carefully,
- purge their folds,
- model costs honestly,
- calibrate before sizing,
- and delete models that do not earn their place.
That is a much less exciting article than "we beat the market with a Transformer". It is also the one that survives contact with live capital.
FAQ
Q: If I only learn one model, which?
XGBoost. It covers the most tasks, fails loudly, trains in seconds, and is the benchmark every other model must beat.
Q: Should I use deep learning at all?
Yes, for shape, embeddings, and multi-task structure. Not as a replacement for a tree on tabular direction.
Q: Are ensembles worth it?
A feature stack is. A weighted average of correlated models usually is not.
Q: Is RL worth learning?
For execution and sizing, yes. For alpha, no — the sample efficiency problem is unsolved at retail data volumes.
Q: How do I know my model is good enough to trade?
Positive net P&L in at least 4 of 6 purged folds, with a worst fold you can survive, and a threshold chosen before you looked at test. If you cannot state those three numbers, you are not ready.
Q: What is the biggest mistake in this field?
Optimising the model instead of the label, the split, and the cost model. The model is 10% of the outcome.
The takeaway
Choose the model class from the task. Validate with purged folds. Judge in rupees. Delete what does not earn its place.
Everything else — the architecture, the library, the paper — is detail. The discipline is the edge.
About the author
Shakti Tiwari is an AI/ML builder, author and NISM-Series-XII certified options educator, and the founder of Option Trading with AI (optiontradingwithai.in). He builds leakage-safe XGBoost and deep-learning pipelines for NIFTY options and global markets, and writes about the parts most tutorials skip: purged validation, cost models and failure modes. Books: Option Trading with AI and The AI Opportunity.
Educational research only. Not investment advice. Shakti Tiwari is NISM-Series-XII certified as an educator, not a SEBI-registered Research Analyst or Investment Adviser. Trading carries substantial risk of loss.