OPEN-SOURCE SCRIPT

Gap Down Reversal Strategy

█ STRATEGY OVERVIEW
The "Gap Down Reversal Strategy" capitalizes on price recovery patterns following bearish gap-down openings. This mean-reversion approach enters long positions on confirmed intraday recoveries and exits when prices breach previous session highs. This strategy is NOT optimized.

█ What is a Gap Down Reversal?
A gap down reversal occurs when:
  • An instrument opens significantly below its prior session's low (price gap)
  • Selling pressure exhausts itself during the session
  • Buyers regain control, pushing price back above the opening level
  • Creates a candlestick with:
    • Open < Prior Session Low (true gap)
    • Close > Open (bullish reversal candle)


█ SIGNAL GENERATION
1. LONG ENTRY CONDITION
  • Previous candle closes BELOW its opening price (bearish candle)
  • Current session opens BELOW prior candle's low (gap down)
  • Current candle closes ABOVE its opening price (bullish reversal)
  • Executes market order at session close


2. EXIT CONDITION
  • A Sell Signal is generated when the current closing price exceeds the highest high of the previous seven bars (`close > _highest[1]`). This indicates that the price has shown strength, potentially confirming the reversal and prompting the strategy to exit the position.


█ PERFORMANCE OVERVIEW
  • Ideal Market: High volatility instruments with frequent gaps
  • Key Risk: False reversals in sustained downtrends
  • Optimization Tip: Test varying gap thresholds (1-3% ranges)

כתב ויתור