Picking Stocks at the Second-Wave Breakout: Big Prior Rally, Low-Volume Consolidation, Then a High-Volume Long Red Candle

TL;DR: To catch the second-wave breakout point of a strong stock, you must first describe the pattern of a big prior rally, low-volume consolidation and a high-volume long red candle item by item in plain language, because only then can it be turned into a stock-screening program; ideas based on intuition alone are hard to convert directly into code.

Key ideas

  • The target pattern has 3 parts: the prior-wave high is the highest point within 300 days with a gain of 50% or more, the consolidation zone lasts 30 days or less with shrinking volume, and the last day is a high-volume red candle that makes a 3-day high; each part must be quantified into conditions that can be checked.
  • Before writing code, describe the pattern in plain language, because many people's ideas are subjective and intuitive and not thought through from a programming angle, so they often can't be converted into code; the more detailed the conditions, the easier they are to code.
  • The implementation order is to first find the prior-wave high and the heavy volume there, then check in sequence the gain, the number of consolidation days, the volume contraction and the pullback size, and only last check today's candlestick; today's candle is excluded when finding the high, and heavy volume is found by comparing the volume of the 3 candles around the high (before, at and after).
  • The data length must be set explicitly: the wave length plus the longest consolidation of 30 days plus a 10-day buffer, so 40 extra days are fetched; otherwise the fetched data may be wrong and different people running the same program will get different results.
  • The pullback is limited to within 20% in order to exclude A-shaped reversal patterns; the selected stocks can then be screened further on fundamentals and financials, saving time in finding stocks on technicals.
量化交易科學園區 - 江加宏Length 12:20Quant Trading Science Park
Episodes
  1. Mon, Nov 28Custom SwingHighBar: Finding Perfect Peaks with Rising Left Side and Falling Right Side
  2. Sat, Dec 31Automatically Detecting an M-Top with XScript: Swing Highs, Neckline and Multiple Filter Conditions
  3. Thu, Mar 16Detecting Volume-Price Divergence with Code: Comparing Price and Volume at Two Swing Highs
  4. Wed, Mar 29Recreating the Day-Trading Three Lines and a Short Alert for Breakouts That Fall Back, Using XS
  5. Tue, Apr 11RSI Bearish Divergence Algorithm and Tolerant Sampling: Syncing Price Highs with Indicator Highs
  6. Thu, Apr 20Measuring Bullish Strength from a Single Candlestick
  7. Fri, Apr 28Manual Entry, Automatic Exit: Using XQ Semi-Automated Trading to Free Up Office Workers
  8. Sun, May 14Automated Trading Without Coding Skills: Split a Strategy into Four Building Blocks of Stock Selection, Entry, Exit and Position Control
  9. Mon, Jun 5Is a High-Volume Long Upper Shadow a Reversal or a Bullish Shakeout? A 3-Year Backtest
  10. Sat, Jun 17Picking Stocks at the Second-Wave Breakout: Big Prior Rally, Low-Volume Consolidation, Then a High-Volume Long Red Candle
  11. Wed, Sep 23Disposition stocks no longer pull back under the new rules: buy those that close strong on day 1 and sell on day 5
  12. Wed, Oct 7A Live Trading Strategy Under the New Disposition Stock Rules: Buy on Day 1, Sell on the Last Day, and Use Stop-Losses
  13. Wed, Oct 21Foreign Capital Rotates Into Defensive Stocks, and a Review of Live Disposition Stock Trades
  14. Wed, Oct 28SDT Shared Variables: Fixed Memory That Saves Resources and Lets Instruments in the Same Strategy Pass Data to Each Other
  15. Wed, Nov 4Disposition Stock Strategy Flips From Bull to Bear: Why It Is Paused When the Market Weakens
  16. Wed, Nov 18Auditing Online Course Strategies with AI: Out-of-Sample Backtesting and Building Your Own XQ Minute-Bar Database
  17. Wed, Nov 25Options Long Straddle Backtest: Trading It Every Day Loses Over the Long Run, With Chances to Profit Only in High-Volatility Periods
▶ Watch the original on YouTube
Ask AI about this episode

Copy the prompt, paste it into an AI service, and add the question. The AI reads the notes on this site and links to the page and the video timestamps.

Or open directly:ChatGPTClaudeGrokPerplexity

Section summaries

  1. 0:05Describing the Post-Consolidation High-Volume Long Red Candle in Plain Language

    This explains how to catch a red candle where volume returns after a big prior rally and a low-volume consolidation, which is a possible second-wave breakout position. The approach is that you must first describe the pattern conditions item by item in plain language, and then convert them into code, rather than judging by intuition alone.

    ▶ Watch from here
    Slide: Describing the Post-Consolidation High-Volume Long Red Candle in Plain Language
  2. 2:35How to Write the Screening Conditions and a Hands-On Demonstration

    First set the wave-period parameter and use two variables to record the position of the prior-wave high and the heavy volume there; the data length is set to the wave length plus 40 days (consolidation of at most 30 days, plus a 10-day buffer) to avoid fetching wrong data. Today's candle is excluded when finding the high, and heavy volume is found by comparing the volume of the 3 candles: the one before the high, the high itself and the one after. Then check in sequence: the prior-wave gain exceeds 50%, consolidation lasts 5 to 30 days, the average volume in the consolidation zone is 30% or less of the maximum volume, the pullback does not exceed 20%, and finally confirm that today is a red candle, with volume at least 50% higher than in the consolidation zone, making a 3-day high. Once the program is added to the stock screener, the stocks it finds can be screened further on fundamentals and financials.

    ▶ Watch from here
    Slide: How to Write the Screening Conditions and a Hands-On Demonstration

This page summarizes the video; it is not an official transcript. Original video: Picking Stocks at the Second-Wave Breakout: Big Prior Rally, Low-Volume Consolidation, Then a High-Volume Long Red Candle (量化交易科學園區 - 江加宏), copyright belongs to the original creator.