MengNotes
BlogTagsAbout
Home/Blog/66-Day Quant Training Journal: From RSI Divergence to VWAP — Seven Days Crossing the Volume-Price Threshold
Quant-Trading

66-Day Quant Training Journal: From RSI Divergence to VWAP — Seven Days Crossing the Volume-Price Threshold

Documenting Day 11 through Day 17 of a 66-day quantitative trading training program, covering RSI divergence, Hammer, Bullish Engulfing, Volume Spike Reversal, VWAP pullback strategy, and key lessons from one year of quant trading.

March 12, 20263,107 words16 min read
#quant-trading#technical-indicators#backtesting#66-days-training#week-summary

66-Day Quant Training Journal: From RSI Divergence to VWAP — Seven Days Crossing the Volume-Price Threshold

Summary

This post documents Day 11 through Day 17 of a 66-day quantitative trading training program. Over seven days, we progressed from RSI divergence analysis through quantitative candlestick pattern detection (Hammer, Bullish Engulfing), crossed the "volume-price integration" threshold (Volume Spike Reversal, VWAP), and concluded with a deep reflection on a quant trader's hard-won lessons. Every strategy underwent a rigorous nine-phase backtesting pipeline — from signal detection through parameter optimization to out-of-sample validation, skipping nothing.


1. The Seven-Day Learning Map

DayCore TopicIndicator / ToolKey Insight
Day 11RSI Bullish DivergenceRSI DivergencePrice-momentum disagreement signals reversal
Day 12RSI Bearish DivergenceRSI Divergence (Bearish)Short-side logic to capture bull exhaustion
Day 13Hammer + RSIHammer + RSIQuantitative candlestick detection, triple-condition entry
Day 14Bullish Engulfing + SMA FilterBullish Engulfing + SMA(50)Pattern + trend filter reduces false signals
Day 15Volume Spike ReversalVolume Spike + Reversal CandleVolume is the real driver behind every breakout
Day 16VWAP Pullback StrategyVWAP + SMATrading alongside institutions' "fair value"
Day 17Quant Trading Mindset—Risk management, parameter simplicity, second-order derivatives

2. Deep Dive into Each Indicator

Day 11–12: RSI Divergence — When Price and Momentum Disagree

The RSI (Relative Strength Index), introduced by J. Welles Wilder in 1978, is a momentum oscillator that measures the relative strength of recent gains versus losses, not the direction of price itself.

RSI=100−1001+RSRSI = 100 - \frac{100}{1 + RS}RSI=100−1+RS100​

Where RS=Average GainAverage LossRS = \frac{\text{Average Gain}}{\text{Average Loss}}RS=Average LossAverage Gain​ (typically calculated over 14 periods).

The classic RSI application is overbought (>70) and oversold (<30) zone identification. But where RSI truly shines is in divergence — when price action and the RSI reading tell conflicting stories.

Core Concept

Divergence reveals that price appearance and underlying momentum are decoupling. When price makes a new high but RSI doesn't follow, it's like a car still accelerating forward while the engine RPM is already declining — a slowdown is inevitable.

The Four Types of Divergence

Divergence TypePrice ActionRSI ActionSignalTrend Nature
Classic BullishLower Low (LL)Higher Low (HL)BuyReversal
Classic BearishHigher High (HH)Lower High (LH)SellReversal
Hidden BullishHigher Low (HL)Lower Low (LL)BuyContinuation
Hidden BearishLower High (LH)Higher High (HH)SellContinuation
The Golden Rule: Highs for Bearish, Lows for Bullish

For bullish signals, only compare lows (both price and RSI). For bearish signals, only compare highs. Mixing these up is the most common divergence analysis mistake.

Day 11: Bullish Divergence in Practice

The strategy logic: use scipy.signal.argrelextrema to identify swing lows. When price prints a Lower Low but RSI prints a Higher Low, a bullish divergence signal fires, and we enter at the next bar's open.

The core experiment was comparing three exit rules:

  1. RSI Overbought Take-Profit: Exit when RSI ≥ 70
  2. Fixed Percentage Stop-Loss: Exit when close drops below entry × (1 − 5%)
  3. Time Stop: Forced exit after 20 trading days

Different exit mechanisms produced dramatically different risk-return profiles from the same entry signal — a lesson often overlooked in quantitative backtesting.

Day 12: Bearish Divergence — Catching Bull Exhaustion

Day 12 flipped the perspective: detecting bearish divergence (price making higher highs while RSI prints lower highs) and entering with short-side logic.

The key technical difference was swing high detection using argrelextrema(order=5), with constraints on the distance between the two highs to filter out too-close false signals and too-distant stale signals.

Real-World Divergence Trading

RSI divergence is a "condition," not a "guarantee." In backtesting, divergence signals typically show a win rate of only 40–50%, but with sensible exit mechanics, positive expectancy is absolutely achievable. The key: you don't need to be right every time — you just need to win more when you're right than you lose when you're wrong.

The consensus from both academic research and the trading community: RSI divergence is most reliable on daily timeframes and above. On 5-minute or 1-minute charts, the false positive rate rises significantly.


Day 13: The Hammer — Defining a "Reversal Candle" with Math

Candlestick pattern analysis dates back centuries to 18th-century Japanese rice markets. But most textbooks only teach you to "eyeball" a hammer shape — that doesn't work in programmatic backtesting. We need precise mathematical definitions.

Quantitative Hammer Conditions

For a bar to qualify as a Hammer, it must satisfy all of the following:

body = abs(close - open)
lower_shadow = min(open, close) - low
upper_shadow = high - max(open, close)

Condition 1: lower_shadow >= body × 2    (lower shadow at least 2× the body)
Condition 2: upper_shadow <= body × 0.3  (minimal upper shadow)
Condition 3: body > 0                     (exclude doji candles)
What the Pattern Really Means

The Hammer tells a simple story: during a decline, sellers aggressively pushed the price down within the bar (creating the long lower shadow), but buyers mounted a fierce counterattack and pulled price back near the open. This candle records the aftermath of an intense bull-bear battle where buyers narrowly prevailed.

But entering on a single candle pattern alone is too risky. Day 13's strategy added two layers of confirmation:

  1. RSI Oversold Confirmation: RSI ≤ 40 (a relaxed threshold balancing signal frequency with quality)
  2. Downtrend Confirmation: Close < SMA(20), ensuring the reversal signal appears within an actual downtrend

All three conditions must fire simultaneously — better to miss a trade than to take a bad one.

Candlestick Pattern Reliability

According to Thomas Bulkowski's classic Encyclopedia of Candlestick Charts and recent quantitative backtest studies, single candlestick patterns have modest reliability (roughly 50–60%). However, when combined with volume confirmation, trend filters, or momentum indicators, accuracy improves significantly. This is exactly why we insist on multi-condition entries.


Day 14: Bullish Engulfing — The Buyers' Complete Takeover

The Bullish Engulfing is considered one of the most powerful bullish reversal patterns in candlestick analysis. It consists of two bars where the second bullish candle's body completely "engulfs" the first bearish candle's body.

Quantitative Detection Conditions

Condition 1: prev_close < prev_open         (prior bar is bearish)
Condition 2: curr_close > curr_open          (current bar is bullish)
Condition 3: curr_open <= prev_close         (current open ≤ prior close)
Condition 4: curr_close >= prev_open         (current close ≥ prior open)
Condition 5: body > 0                        (exclude doji candles)

Visually, the second candle "swallows" the first entirely, representing buyers overpowering sellers within a single session. In backtest research, the Bullish Engulfing near support levels with high volume confirmation ranks among the most reliable candlestick patterns.

The SMA(50) Trend Filter

Day 14 introduced SMA(50) as a trend filter: long signals are only allowed when close > SMA(50). The underlying logic:

We only want to catch short-term pullback rebounds within a medium-term uptrend, not "catch falling knives" in a downtrend.

Parameter optimization tested 36 combinations (SMA period × stop-loss percentage × holding days), which led us to a crucial lesson:

The Power of Holding Period

In many strategies, the holding period has a far greater impact on performance than you'd expect. Day 14's backtests showed that 3-day vs. 20-day holding periods could produce Sharpe Ratio differences of 2× or more. Exit timing often matters more than entry conditions.


Day 15: Volume Spike Reversal — Volume Is the Real Star

From Day 4 through Day 14, we relied exclusively on price-derived indicators (SMA, RSI, candlestick patterns) for entry signals. Day 15 marked a turning point — we formally brought volume into the strategy framework.

Quote

Price tells you what the market is doing. Volume tells you how serious the market is about it.

Defining a Volume Spike

The quantitative definition is straightforward:

Volume Spike:Volumetoday>SMA20(Volume)×k\text{Volume Spike}:Volume_{today} > SMA_{20}(Volume) \times kVolume Spike:Volumetoday​>SMA20​(Volume)×k

Where kkk is the spike multiplier (default k=2k = 2k=2, meaning today's volume exceeds the 20-day average by at least 2×).

This signals an abnormally high level of trading activity — potentially institutional accumulation, panic selling, or a collective reaction to major news.

Triple Entry Conditions

Day 15's strategy required all three conditions simultaneously:

  1. Volume Spike: Volume > 20-day average volume × 2
  2. Reversal Candlestick: Hammer or Bullish Engulfing (integrating the detection logic from Days 13 and 14)
  3. Trend Filter: Close > SMA(50)

This was the first time we assembled knowledge modules from previous days into a complete strategy. Progress in quantitative trading often works this way — it's not about learning new indicators, but learning to combine existing tools.

Parameter Optimization Observations

Testing 48 parameter combinations (spike multiplier × SMA period × holding days):

  • Spike multiplier had the largest impact on strategy quality. Too low (1.5×) included too many "non-event" days; too high (3.0×) generated almost no signals
  • The most robust zone was 2.0–2.5×, which confirms an intuition: meaningful volume changes typically need to exceed at least twice the normal level
Volume Context

In the institutional world, a volume spike usually means big players are entering or exiting positions. Retail daily volume is negligible — the kind of activity that drives volume up several multiples almost always comes from institutions, hedge funds, or market makers. This is why "volume precedes price" has remained a timeless principle in technical analysis.


Day 16: VWAP — An Institutional-Grade Intraday Benchmark

VWAP (Volume Weighted Average Price) is the gateway from retail-level analysis to institutional-grade intraday trading. It isn't just another moving average — it is the volume-weighted consensus price that market participants have agreed upon.

The Formula

TP=High+Low+Close3TP = \frac{High + Low + Close}{3}TP=3High+Low+Close​ VWAP=∑(TP×Volume)∑VolumeVWAP = \frac{\sum(TP \times Volume)}{\sum Volume}VWAP=∑Volume∑(TP×Volume)​

A critical property: VWAP resets automatically at the start of each trading day, accumulating from zero. Early in the session the denominator is small, making VWAP highly sensitive to price changes; as the day progresses, the growing cumulative volume makes it increasingly stable.

VWAP's Market Significance

For institutional investors, VWAP is the benchmark for evaluating "execution quality." If your average buy price is below VWAP, you bought cheaper than the market average. This naturally makes VWAP an important intraday support/resistance level — large institutional orders cluster around VWAP.

Think of VWAP as the market's center of gravity for the day. Price can stretch away from it, but like a rubber band, it often snaps back.

The VWAP Pullback Strategy

The idea: in an uptrend (close > SMA(20)), when price pulls back from above VWAP to VWAP, treat it as a buying opportunity.

Entry Conditions:

  • Previous bar close > VWAP, current bar close ≤ VWAP (pullback detected)
  • Close > SMA(20) (trend filter)
  • Exclude the first 30 minutes after open (09:30–10:00, excessive volatility)

Exit Rule Comparison (three approaches):

  • Exit A: Hold for a fixed number of bars (e.g., 12 bars × 5 min = 1 hour)
  • Exit B: Fixed percentage take-profit (+2%)
  • Exit C: Exit when SMA(20) is breached

Backtest Performance and Key Findings

TickerParametersIS SharpeOOS SharpeKey Observation
AAPLSMA=50, Hold=36-3.810.39Drawdown control superior to Buy-and-Hold
SPYSMA=10, Hold=362.441.30Achieved excess returns; IS→OOS decay but remained positive
VWAP Limitations

In extremely strong uptrends, price can stay above VWAP for multiple consecutive days without a single pullback. If you insist on waiting to "buy below VWAP," you'll completely miss the rally. VWAP is an intraday tool — it should not be used for cross-day trend analysis.

The professional approach: pair VWAP with higher-timeframe trend analysis. VWAP tells you "where today's fair value is," but the trend direction needs daily or weekly indicators to determine.


Day 17: Pausing the Code, Listening to a Year of Lessons

Day 17 was a "no code" day. We read QFX Research's article "1 Year in Quant Trading — 24 Lessons I've Learned" and reflected deeply on three lessons that resonated most.

Lesson #9: Make Risk Management Your Top Priority

Your strategy should be able to handle waking up one morning to find the market has crashed 50%.

Losing 40% of your capital requires a 66.7% gain just to break even — the math is fundamentally asymmetric. Over the first 16 days of training, we'd generated impressive backtest numbers but never seriously asked: if the worst-case scenario hit, would the account survive?

A Risk Management Framework:

LevelPrincipleQuantitative Standard
Per TradeMaximum risk per trade≤ 1% of total capital
DailyMaximum daily loss≤ 3% of total capital
StrategyMaximum drawdown tolerance≤ 20%, pause if exceeded
AccountReserve fund isolation20% of capital never deployed

The primary goal isn't "to make money" — it's "to not go bankrupt." Survival comes first; compounding follows.

Lesson #10: Use Fewer Parameters, but Understand Them Deeply

My best-performing strategy had only 3 parameters. The worst mistake was probably letting an optimization script auto-generate parameter combinations.

During training, we often ran grid searches across SMA periods, RSI thresholds, and holding durations, finding the "best-looking" combination — without knowing why those parameters worked. This is essentially overfitting to historical data, not discovering genuine market structure.

Before adding any parameter, answer three questions:

  1. What market behavior does this parameter represent? (e.g., SMA 200 = long-term trend direction)
  2. Why should it affect strategy performance? (logic-driven, not data-driven)
  3. Does the strategy collapse if you change this value slightly? (robustness test)

Only when all three answers are clear does a parameter deserve a place in your strategy.

Lesson #20: The Derivative of the Derivative Is Where the Value Lies

If you strategically transform an indicator into a second-order derivative, strategy performance often improves significantly.

Don't rush to learn a new indicator. First ask: what is the second-order behavior of the indicator I already have?

  • RSI → Rate of change of RSI (momentum acceleration) → Consecutive positive slopes (trend confirmation)
  • MACD → Cumulative histogram area → Rate of area sign change
  • VWAP deviation → Standard deviation of deviation (intraday volatility rhythm) → Deviation mean-reversion speed
The Common Thread of All Three Lessons

Understand → Simplify → Survive → Derive

  1. Understand the market meaning of every parameter and indicator
  2. Simplify to the core logic you truly command
  3. Survive — it's the precondition for all compounding
  4. On top of understanding, derive more insightful features

Going deep on one indicator you understand beats spreading thin across ten you don't.


3. Common Findings Across Seven Days of Backtesting

Exits Matter More Than Entries

If there's only one takeaway from this week, it's this: exit rules have a greater impact on strategy performance than entry signals.

Day 11's three exit rule comparisons, Day 14's holding period sensitivity analysis, Day 16's three exit logic comparisons — each validated the same truth: the same entry signal paired with different exit mechanisms can produce Sharpe Ratio differences of 2× or more.

Ninety percent of strategy tutorials focus on "when to buy," but what truly determines your survival is "when to sell."

Multiple Conditions > Single Indicators

From Day 11's pure RSI divergence, to Day 13's triple conditions (pattern + RSI + trend), to Day 15's triple conditions (volume + pattern + trend), the design trajectory is clear:

Each meaningful filter layer reduces false signals, but also reduces signal frequency.

This is an eternal trade-off: confirmation vs. trading frequency. There's no right answer — only the answer that fits your capital size and risk tolerance.

From Daily Bars to Minute Bars

Day 16's VWAP strategy took us from daily charts into the 5-minute bar world for the first time. Intraday trading presents entirely different challenges:

  • Data volume explodes (78 five-minute bars per day)
  • Must account for "opening volatility periods" and "end-of-day forced liquidation"
  • VWAP resets daily — indicator logic is fundamentally different from daily indicators
  • Transaction costs consume a larger share (because expected profit per trade is smaller)

4. Strategy Toolbox Quick Reference

ToolTypeBest Use CaseCore Limitation
RSI DivergenceMomentum ReversalSwing high/low turning point detectionLow win rate, requires exit discipline
HammerCandlestick PatternReversal signal in downtrendsLow reliability when used alone
Bullish EngulfingCandlestick PatternStrong reversal confirmationRequires trend filter
Volume SpikeVolumeLocating abnormal trading activityMultiplier threshold varies by ticker
VWAPIntraday BenchmarkFair value anchor for day tradingIntraday only, resets daily
SMA FilterTrend ConfirmationFiltering counter-trend false signalsLagging by nature

5. Mindset Takeaways

  1. Exits determine survival. Entry is just the beginning of the story; exit is the ending. Time spent designing exit rules should at least match time spent on entry conditions.
  2. Multiple confirmations are your seatbelt. Single indicators are rarely reliable, but meaningful multi-condition combinations significantly reduce false signals.
  3. Risk management isn't optional — it's foundational. Losing 40% requires gaining 66.7% to recover. That math never changes.
  4. Less is more. Three parameters you understand beat ten parameters you've merely optimized.
  5. Go deep, not wide. Understanding one indicator's second-order behavior is worth more than learning ten new ones.
  6. Volume is the soul of price. A breakout without volume is a fake breakout; a reversal with volume deserves trust.

What's Next

Day 18 begins to explore more advanced strategy combinations and portfolio-level thinking. Armed with the new perspective of volume-price integration and the risk-first mindset framework, the journey continues.

Table of Contents

1. The Seven-Day Learning Map2. Deep Dive into Each IndicatorDay 11–12: RSI Divergence — When Price and Momentum DisagreeDay 13: The Hammer — Defining a "Reversal Candle" with MathDay 14: Bullish Engulfing — The Buyers' Complete TakeoverDay 15: Volume Spike Reversal — Volume Is the Real StarDay 16: VWAP — An Institutional-Grade Intraday BenchmarkDay 17: Pausing the Code, Listening to a Year of Lessons3. Common Findings Across Seven Days of BacktestingExits Matter More Than EntriesMultiple Conditions > Single IndicatorsFrom Daily Bars to Minute Bars4. Strategy Toolbox Quick Reference5. Mindset Takeaways
← Back to all posts

© 2024-2026 MengNotes | All Rights Reserved