66-Day Quant Training Journal: From SMA to Ichimoku — Building a Solid Technical Indicator Foundation in Seven Days
This post documents Day 4 through Day 10 of a 66-day quantitative trading training program. Over seven days, we progressed from the most fundamental Simple Moving Average (SMA) through Bollinger Bands, MACD, ADX, and the Ichimoku Cloud system, concluding with a million-dollar lesson in risk management. Every indicator was validated through actual backtesting — not just theory.
1. The Seven-Day Learning Map
| Day | Core Topic | Indicator Type | Key Insight |
|---|---|---|---|
| Day 4 | SMA Strategy + IBKR Integration | Trend Following | Moving average crossovers, data extraction pipeline |
| Day 5 | SMA Intraday Trading Adaptation | Trend Following (Short-term) | Timeframe switching, SMA parameter sensitivity |
| Day 6 | Bollinger Bands | Volatility + Mean Reversion | The 95% rule, the cost of overfitting |
| Day 7 | MACD Golden Cross | Momentum | Lagging indicator behavior, histogram slope filter |
| Day 8 | ADX Trend Strength | Trend Strength Filter | Direction vs. strength, false signal filtering |
| Day 9 | Ichimoku Cloud | All-in-One System | Five-line integration, the cloud as a no-trade zone |
| Day 10 | Risk Management Mindset | Psychology & Discipline | Independent stop-losses, risk of ruin, positive expectancy |
2. Deep Dive into Each Indicator
Day 4–5: SMA — Where Every Trend Strategy Begins
The Simple Moving Average (SMA) is the most classic tool in technical analysis. Its logic is beautifully straightforward: compute the arithmetic mean of the past closing prices.
The SMA's value isn't in predicting the future — it's in smoothing out noise so you can see where price is actually heading. When price crosses the moving average, it may signal a trend shift.
What We Learned in Practice
- Day 4: We used the IBKR API to extract historical data for the MAG7 stocks (MSFT, AAPL, TSLA, NVDA, META, GOOGL, AMZN) and found the optimal SMA window for each stock individually. This taught us that different assets have different optimal rhythms — one-size-fits-all rarely works.
- Day 5: We converted a daily SMA 200 strategy into a 1-minute SMA 5 intraday script. Shortening the timeframe made signals more responsive but dramatically increased false signals — the double-edged sword of short-term trading.
SMA 5 on a 1-minute chart is extremely jittery. Faster pace does not equal higher returns; it demands even stricter entry/exit discipline.
Day 6: Bollinger Bands — Measuring Volatility with Statistics
Bollinger Bands consist of three lines:
- Middle Band: SMA (typically 20-day)
- Upper Band: SMA + (typically )
- Lower Band: SMA -
Where is the standard deviation of closing prices.
Under a normal distribution, approximately 95% of price action falls within ±2 standard deviations. When price breaks through the bands, it enters what is statistically a "tail event." This doesn't guarantee a reversal, but it means the price is in an unusual position.
Backtest Results and Reflection
Using AAPL with a "buy at lower band, sell at upper band" mean-reversion logic over ten years:
| Metric | In-Sample (2016–2021) | Out-of-Sample (2022–2026) |
|---|---|---|
| CAGR | 25.99% | 8.85% |
| Sharpe | 1.20 | 0.59 |
| Max Drawdown | -31.43% | -16.61% |
- The grid search's best parameters
(SMA=20, σ=3.0)produced a Sharpe 2.05× above the mean — a classic overfitting red flag. - The 3σ bandwidth was rarely touched (only 1 trade out-of-sample), meaning the strategy sat in cash most of the time — low drawdown but also low returns.
- AAPL exhibited a strong uptrend over 2016–2026; a pure mean-reversion strategy sold too early at the upper band, missing extended trend gains.
Optimal parameters ≠ future-optimal parameters. The champion combination in backtesting often performs mediocrely in live trading. This is the textbook case of overfitting.
Day 7: MACD — Your Ticket into the World of Momentum
MACD stands for Moving Average Convergence Divergence. It measures momentum through the relationship between two exponential moving averages.
- Golden Cross: MACD line crosses above the signal line → bullish momentum is building
- Death Cross: MACD line crosses below the signal line → bearish momentum is taking over
Advanced Technique: Histogram Slope Filter
Pure crossover signals are prone to whipsaws in ranging markets. Adding a histogram slope filter:
- Only allow buy entries when the histogram is rising
- Only allow sell entries when the histogram is falling
This extra confirmation layer effectively reduces false signals, but it also delays your entry — an inherent characteristic of lagging indicators. Trading is always a tradeoff between confirmation and timeliness.
Day 8: ADX — It Doesn't Tell You Where, It Tells You Whether It's Worth Going
The ADX (Average Directional Index) is a uniquely specialized indicator. Unlike SMA or MACD, which generate buy/sell signals, ADX answers a more fundamental question: "Is there a trend right now? Is it strong enough to trade?"
How ADX Is Calculated
ADX isn't derived directly from price — it goes through multiple layers of processing. The full calculation chain breaks down into five steps:
Step 1: Directional Movement (+DM / -DM)
For each bar, compare the current high/low against the previous bar:
In plain terms: +DM captures the magnitude of "upward breakouts," while -DM captures "downward breakouts."
Step 2: True Range (TR)
TR measures each bar's actual volatility range, accounting for gap openings.
Step 3: Wilder's Smoothing
Apply Wilder's smoothed moving average (typically ) to +DM, -DM, and TR separately:
Wilder's smoothing is equivalent to a period EMA. So ADX 14 actually decays at roughly the same rate as EMA 27 — slower than you might intuitively expect.
Step 4: Directional Indicators (+DI / -DI) and DX
+DI represents the proportion of upward momentum relative to total volatility; -DI represents the downward proportion. DX measures the "divergence" between the two.
Step 5: ADX = Smoothed DX
The final ADX applies one more round of smoothing to DX, making the trend-strength reading more stable and less reactive to single-day spikes.
In practice, one line of Python does the job: ta.trend.ADXIndicator(high, low, close, window=14). Understanding the math helps you appreciate why it's slow — after two layers of smoothing, ADX is inherently a lagging indicator, better suited for confirmation than prediction.
ADX Value Interpretation
| ADX Value | Trend Strength | Suggested Action |
|---|---|---|
| 0–20 | Weak / No Trend | Stay on the sidelines |
| 20–40 | Moderate Trend | Trend is forming |
| 40–60 | Strong Trend | Suitable for trend-following |
| 60–100 | Extreme Trend | Exceptionally strong momentum |
ADX works alongside +DI (Positive Directional Indicator) and -DI (Negative Directional Indicator):
- Buy: ADX > 25 and +DI crosses above -DI
- Sell: ADX > 25 and -DI crosses above +DI
ADX is best used as a filter, not a signal generator. Think of it as a traffic light: green (ADX > 25) means you can proceed, but you still need other indicators to tell you which direction to go.
Day 9: Ichimoku Cloud — An Entire Trading System on One Chart
The Ichimoku Kinko Hyo is one of the few indicators that simultaneously displays trend direction, momentum strength, and support/resistance levels on a single chart. It consists of five lines:
| Component | Calculation | Role Analogy |
|---|---|---|
| Tenkan-sen (Conversion Line) | (9-day High + 9-day Low) ÷ 2 | The Scout — quick, responsive short-term detection |
| Kijun-sen (Base Line) | (26-day High + 26-day Low) ÷ 2 | The General — stable, authoritative medium-term anchor |
| Senkou Span A (Leading Span A) | (Tenkan + Kijun) ÷ 2, shifted forward 26 periods | Upper or lower edge of the cloud |
| Senkou Span B (Leading Span B) | (52-day High + 52-day Low) ÷ 2, shifted forward 26 periods | The other edge of the cloud |
| Chikou Span (Lagging Span) | Current close, shifted backward 26 periods | The Second Confirmer |
The area between Senkou Span A and B forms the "cloud."
- Price above the cloud → bullish environment
- Price below the cloud → bearish environment
- Price inside the cloud → direction unclear, best to wait
Compared to a Single MA Strategy
While SMA only tells you "where price is relative to the average," Ichimoku simultaneously provides:
- Forward-looking perspective: The cloud extends into the future, letting you anticipate support and resistance zones
- Multi-dimensional confirmation: Tenkan/Kijun crossover + cloud position + Chikou Span — triple confirmation reduces false signals
- Built-in momentum reading: The distance between price and cloud indicates momentum strength; convergence signals weakening momentum
The tradeoff: signals are more conservative, trading frequency is lower, and opportunities in choppy markets are often missed.
Day 10: A Million-Dollar Lesson — The Risk Management Mindset
No code on this day. Just a real story: a trader built a quantitative strategy called Imhotep. His account ballooned to $1.88 million. Then, because his stop-loss code was untested, monitoring was absent, he was trading 100% of his capital with leverage, it all vanished overnight in a single liquidation event.
- Using leverage
- Not testing the stop-loss logic
- No proper monitoring or alert system
- Trading with 100% of his capital
- Believing he was invincible when things were going well
My Safety Net Framework
Drawing from The Trading Bible's core philosophy, I distilled three survival principles:
Principle 1: Drive Single-Trade Risk Toward Zero
- Maximum risk per trade ≤ 1% of total capital
- Calculate leverage based on actual exposure, not nominal position size
Principle 2: Maximize Your Survival in the Market
- Even after 20 consecutive stop-losses, the account retains 80%+ of its capital
- Separate "trading capital" from "reserve capital" — the reserve is never touched
Principle 3: Ensure Positive Expected Value
Where = win rate, = average gain, = loss rate, = average loss. Only strategies with positive expected value are worth executing.
Code can execute your logic, but only your risk awareness can keep you in the game.
3. Common Findings Across Seven Days of Backtesting
Overfitting Is Your Greatest Enemy
Every parameter optimization is a battle against overfitting. Across Day 6 (Bollinger Bands), Day 7 (MACD), Day 8 (ADX), and Day 9 (Ichimoku), we repeatedly confirmed the same truth:
The best parameters in-sample are almost never the best parameters out-of-sample.
How to cope:
- Always split data into in-sample (training) and out-of-sample (validation) periods
- When reading Sharpe heatmaps, choose the "plateau" over the "peak" — a stable parameter region is more reliable than a single optimal point
- When in-sample Sharpe dramatically exceeds out-of-sample, that's the overfitting red flag
The R.E.A.L. Backtesting Framework
All backtests followed the R.E.A.L. principles:
- Realistic: Include commissions ($0.005/share) and slippage (0.05%)
- Evidence-based: Validate phase by phase, never skip steps
- Avoiding Bias: Apply
signal.shift(1)— execute on the next bar's open to prevent look-ahead bias - Logged: Document observations in Markdown at every phase for reproducibility
4. Indicator Selection Quick Reference
| Market Condition | Well-Suited Indicators | Less Suitable Indicators |
|---|---|---|
| Clear Trend | SMA, MACD, Ichimoku | Bollinger Bands (mean reversion) |
| Range-Bound | Bollinger Bands, RSI | MACD, ADX |
| Uncertain Direction | ADX (to confirm whether it's worth trading) | All signal-type indicators |
| Need Comprehensive View | Ichimoku (trend + momentum + S/R) | Any single indicator alone |
Every indicator excels in specific market conditions. True skill isn't finding the strongest indicator — it's recognizing "what kind of market are we in right now" and then choosing the right tool.
5. Mindset Takeaways to Remember
- Simple strategies tend to be more robust. The more complex the system, the more likely it breaks in live trading.
- Backtests are maps, not territories. Historical data is perfect; markets are not.
- Risk management comes before everything. Survive first, profit second.
- Lagging isn't a flaw — it's a feature. An extra layer of confirmation means fewer false signals.
- Don't chase "optimal" — chase "robust." Peaks on a Sharpe heatmap are traps; plateaus are where you want to be.
Day 11 onward dives into RSI divergence and more advanced strategy combinations. With seven days of foundation laid, the journey continues.