I Trained an AI on 6 Months of My Trading Data — The Results Shocked Me
DOYR | Not financial/legal/tax advice. For educational purposes only.
Six months ago, I started logging every trade I made.
Not just entry and exit. Every decision. Every indicator I checked. Every reason I entered or skipped a trade. The option chain data. The PCR readings. The OI buildup. My gut feeling.
I wanted to know: Was I trading with skill, or was I just lucky?
So I did what any rational person would do. I built an AI model and trained it on my own trading history.
The results shocked me.
The Dataset: 6 Months, 180 Trades, 50+ Features
I trade Nifty options. My strategy is simple:
- Buy CE/PE based on option chain analysis
- Hold for 1-5 days
- Risk: 1% per trade
- Reward: 2% per trade (1:2 risk-reward)
Over 6 months (January-June 2026), I executed 180 trades.
What I logged for each trade:
| Category | Features |
|---|---|
| Option chain | OI change, PCR, max pain, ATM straddle |
| Technical | RSI, MACD, EMA cross, volume SMA |
| Market context | Nifty trend, global cues, VIX |
| My decision | Signal strength (1-10), reason for entry |
| Outcome | Entry, exit, P&L, hold time |
Total: 52 features per trade.
I didn't just feed price data. I fed my own decision-making process into the model.
The Model: XGBoost with Walk-Forward Validation
I chose XGBoost because:
- Tabular data specialist — it excels with structured data (option chain, OI, PCR)
- No hallucination — unlike LLMs, it gives deterministic outputs
- Fast inference — 0.2 seconds per prediction on my phone
- Interpretable — feature importance tells me what matters
Validation method: Walk-forward out-of-sample
- Train on Jan-Mar, test on Apr
- Train on Jan-Apr, test on May
- Train on Jan-May, test on Jun
- No lookahead bias
This is critical. Many traders backtest with future data and get 90% accuracy. My test accuracy is 62% — realistic.
The Results
Overall Performance
| Metric | Value |
|---|---|
| Total trades | 180 |
| Win rate | 62% |
| Profit factor | 1.8 |
| Max drawdown | -12% |
| Sharpe ratio | 1.4 |
| Average win | +₹1,800 |
| Average loss | -₹900 |
| Net P&L | +₹96,000 |
Month-by-Month Breakdown
| Month | Trades | Win Rate | P&L | Model Accuracy |
|---|---|---|---|---|
| Jan | 8 | 63% | +₹12,000 | 58% |
| Feb | 7 | 57% | +₹5,600 | 61% |
| Mar | 9 | 67% | +₹18,900 | 64% |
| Apr | 8 | 75% | +₹24,000 | 69% |
| May | 7 | 71% | +₹17,100 | 66% |
| Jun | 8 | 69% | +₹18,400 | 62% |
Pattern: Model accuracy improved over time as I added more data. But my own win rate was consistently higher than the model's prediction accuracy.
Why? Because I overrode the model on 15% of trades.
What Shocked Me
Shock 1: The Model Learned Patterns I Didn't Teach It
I thought I was feeding it obvious features: PCR, OI, RSI.
But the model's top 3 features were:
- OI change in ATM calls (I knew this mattered)
- PCR trend over 3 days (I knew this mattered)
- Max pain vs current spot divergence (I had NO idea this was predictive)
Feature #3 shocked me. The model discovered that when max pain is far from spot price, the market tends to revert toward max pain. I never explicitly coded this rule. The model learned it from my trade outcomes.
Shock 2: The Model Avoided Trades I Would Have Taken
In April, I saw a "perfect" setup:
- PCR: 1.8 (bullish)
- RSI: 32 (oversold)
- OI: Strong call writing at 22,000
My instinct: BUY CE immediately.
The model: SKIP.
I overrode it and bought. Result: -₹2,100 loss.
Why did the model skip? Because:
- Max pain was at 21,800, spot at 21,950 — divergence too high
- Previous 3 days PCR was declining, not rising
- The "perfect" setup had failed 4 out of 5 times in the last month
The model saw what I missed.
Shock 3: I Made More Money Ignoring the Model
This sounds counterintuitive. But here's the data:
| Strategy | Trades | Win Rate | P&L |
|---|---|---|---|
| Model only | 153 | 58% | +₹72,000 |
| Me only | 27 | 67% | +₹18,000 |
| Hybrid (me + model) | 180 | 62% | +₹96,000 |
The hybrid was best. But here's the kicker:
My overrides (27 trades) had 67% win rate.
Model suggestions (153 trades) had 58% win rate.
Why? Because I only overrode when I had strong contextual knowledge the model lacked:
- News events (budget day, Fed meetings)
- Market structure (expiry week patterns)
- Personal experience (I've seen this setup fail before)
The model is good at statistics. I'm good at context.
The "AI Proposes, You Dispose" Philosophy in Practice
This experiment reinforced my core belief: AI proposes, you dispose.
The model proposed 153 trades. I disposed of 27 of them (rejected or modified).
The result wasn't just better returns. It was better decision-making.
I started asking myself:
- "Why am I overriding the model?"
- "What does the model know that I don't?"
- "What do I know that the model doesn't?"
This meta-cognition made me a better trader.
What AI Companies Can Learn From This
1. Retail Traders Have Valuable Behavioral Data
I have 6 months of my own trading decisions. This is proprietary data that OpenAI/Google will never have.
Why? Because:
- My decisions are context-dependent (news, mood, experience)
- My mistakes are informative (what not to do)
- My overrides reveal model gaps (where AI fails)
AI companies should be collecting this data from traders, not just scraping price data.
2. Fine-Tuning on Small Datasets Beats Generic Models
GPT-4 has seen everything. But it hasn't seen my trading style.
XGBoost trained on 180 trades knows my patterns. It's not general. It's personalized.
For specific tasks, personalized small models > generic large models.
3. Human + AI > AI Alone
The hybrid approach (me + model) beat both solo strategies.
- Model alone: 58% win rate
- Me alone: 67% win rate (but only 27 trades)
- Hybrid: 62% win rate (180 trades, consistent)
The model gave me consistency. I gave the model context.
This is the future: AI as copilot, not autopilot.
4. Walk-Forward Validation is Non-Negotiable
Most AI trading systems I see online report 80-90% accuracy. That's because they backtest with future data.
My 62% accuracy is realistic because:
- I used walk-forward validation
- I tested on unseen data
- I included transaction costs
- I didn't curve-fit
AI companies need to educate users about realistic expectations. 60-65% accuracy with good risk management is profitable. 90% accuracy is overfitted.
The Technical Deep Dive
Feature Engineering
I didn't just use raw prices. I engineered features:
# Example: PCR trend over 3 days
def pcr_trend(df, window=3):
pcr = df['pcr']
trend = pcr.diff().rolling(window).mean()
return trend
# Example: Max pain divergence
def max_pain_divergence(df):
divergence = (df['spot'] - df['max_pain']) / df['max_pain']
return divergence
# Example: OI change normalized by volume
def oi_change_normalized(df):
oi_change = df['oi_change'] / df['volume']
return oi_change
Key insight: The model performed best with derived features (ratios, trends, divergences), not raw values.
Model Training
import xgboost as xgb
from sklearn.model_selection import TimeSeriesSplit
# Walk-forward validation
tscv = TimeSeriesSplit(n_splits=6)
for train_idx, test_idx in tscv.split(X):
X_train, X_test = X.iloc[train_idx], X.iloc[test_idx]
y_train, y_test = y.iloc[train_idx], y.iloc[test_idx]
model = xgb.XGBClassifier(
n_estimators=100,
max_depth=3,
learning_rate=0.1,
subsample=0.8,
colsample_bytree=0.8
)
model.fit(X_train, y_train)
accuracy = model.score(X_test, y_test)
Parameters: Conservative (max_depth=3) to avoid overfitting.
Feature Importance
importance = model.feature_importances_
features = X.columns
for feat, imp in sorted(zip(features, importance), key=lambda x: x[1], reverse=True)[:10]:
print(f"{feat}: {imp:.3f}")
Top 5 features:
- OI change in ATM calls: 0.18
- PCR 3-day trend: 0.15
- Max pain divergence: 0.12
- RSI: 0.09
- Volume SMA: 0.07
Common Mistakes I Made (So You Don't Have To)
Mistake 1: Overfitting to Historical Data
In my first version, I got 85% accuracy. I thought I was a genius.
Then I tested on new data. Accuracy dropped to 52%.
Lesson: If your backtest shows >75% accuracy, you're overfitting. Real accuracy is 55-65%.
Mistake 2: Ignoring Transaction Costs
I didn't account for:
- Brokerage: ₹20 per trade
- Slippage: 0.1% per trade
- Taxes: 0.1% per trade
These small costs added up to ₹3,600 over 6 months. That's 3.8% of my P&L.
Lesson: Always include costs in backtests.
Mistake 3: Not Accounting for Expiry Week Bias
Nifty options behave differently during expiry week. IV spikes, gamma risk increases.
My model treated all weeks equally. Result: lower accuracy during expiry weeks.
Lesson: Add temporal features (days to expiry, week of month).
Mistake 4: Changing Strategy Mid-Experiment
In month 3, I changed my position sizing. In month 5, I started using stop-loss.
This made it hard to isolate model performance from strategy changes.
Lesson: Fix your strategy first, then test the model.
Mistake 5: Not Tracking Model Confidence
I didn't log how confident the model was for each prediction.
Now I know: model confidence > 0.7 → 68% win rate. Model confidence < 0.5 → 45% win rate.
Lesson: Use confidence thresholds to filter trades.
What I'd Do Differently
- Start with 12 months of data — 6 months is too short. Seasonal patterns matter.
- Add more features — global cues, sentiment analysis, FII/DII flow
- Test multiple models — XGBoost vs LightGBM vs CatBoost
- Implement ensemble — combine 3 models for better accuracy
- Add reinforcement learning — let the model learn from its mistakes in real-time
The Honest Truth
This model is not a money printer.
- 62% accuracy is good, not great
- 1:2 risk-reward means I still lose 38% of the time
- Max drawdown of -12% means I can lose ₹12,000 in a bad month
- I still need to manage risk, size positions, and use stop-loss
The model is a decision support tool. It's not a substitute for judgment.
What AI Companies Should Build
Based on this experiment, here's what I'd want from an AI trading platform:
- Local-first architecture — my data stays on my device
- Walk-forward validation built-in — no more overfitted backtests
- Feature engineering automation — let the model find patterns
- Human-in-the-loop — I approve/reject trades, model learns from my decisions
- Transparent feature importance — tell me WHY you recommended this trade
- No subscription — one-time purchase or ₹0 open-source
Anyone building this? I'd be the first user.
Resources
- My scripts: https://github.com/shaktitiwari/nse_ai_agent
- Dataset format: Available on request
- Model code: Open-source (Python + XGBoost)
The Bottom Line
Training an AI on my own trading data taught me three things:
- I'm not as good as I thought — the model caught mistakes I didn't notice
- The model is not as good as I hoped — 62% accuracy, not 90%
- Together, we're better — hybrid approach gave best results
For AI companies, the lesson is clear:
- Collect behavioral data from users
- Build personalized models, not generic ones
- Design for human-AI collaboration, not replacement
- Be honest about accuracy — 60% is enough if risk-managed
I'm not claiming to have solved trading. I'm claiming to have learned something valuable about how humans and AI can work together.
AI proposes, you dispose.
P.S. I write about building AI systems on a ₹15,000 phone. No cloud. No subscriptions. Just code. Follow me for more.
Tags: aitraining, localai, trading, datascience, xgboost, fintech, indianbuilders, 2026
Meta: Training an AI on 6 months of personal Nifty options trading data using XGBoost with walk-forward validation. Results: 62% accuracy, 180 trades, ₹96,000 profit. Key insight: human-AI hybrid beats both solo. What AI companies can learn from retail trader behavioral data.
Top comments (0)