OPEN-SOURCE SCRIPT
High Freq Buy The Dips Bull Market [Quant Trading]

STRATEGY OVERVIEW
This is a significantly enhanced and optimized version of the original "Buy The Dips in Bull Market" strategy from Coinrule (2020). The strategy has been completely rewritten in Pine Script v6 with substantial improvements in performance, risk management, and functionality. Based on extensive analysis of 2+ years of BTC hourly data, this optimized version delivers 312.6% better returns with a 74.8% win rate compared to the original implementation.
Key Philosophy: The strategy capitalizes on temporary price dips during bull market conditions by entering long positions when RSI indicates oversold conditions while maintaining a bullish market structure, then exiting when price recovers above key moving averages.
HOW IT WORKS
Entry Logic
The strategy enters long positions when ALL of the following conditions are met:
Exit Logic
Positions are closed when BOTH conditions are satisfied:
Optional Short Trading
When enabled, the strategy can also trade short positions using inverse logic:
KEY IMPROVEMENTS OVER ORIGINAL
1. Enhanced Risk Management
2. Optimized Parameters
3. Advanced Features
DEFAULT PARAMETERS EXPLAINED
RSI Settings
Moving Average Settings
Risk Management (ATR-Based)
Alternative Risk Management (Percentage-Based)
Trading Configuration
STRATEGY PERFORMANCE CHARACTERISTICS
Strengths
Considerations
RISK WARNINGS
RECOMMENDED USAGE
Optimal Market Conditions
Timeframes
Asset Classes
TECHNICAL REQUIREMENTS
This strategy represents a substantial evolution of the original concept, incorporating modern risk management techniques, optimized parameters based on extensive backtesting, and enhanced functionality while maintaining the core "buy the dips" philosophy that made the original strategy popular.
This is a significantly enhanced and optimized version of the original "Buy The Dips in Bull Market" strategy from Coinrule (2020). The strategy has been completely rewritten in Pine Script v6 with substantial improvements in performance, risk management, and functionality. Based on extensive analysis of 2+ years of BTC hourly data, this optimized version delivers 312.6% better returns with a 74.8% win rate compared to the original implementation.
Key Philosophy: The strategy capitalizes on temporary price dips during bull market conditions by entering long positions when RSI indicates oversold conditions while maintaining a bullish market structure, then exiting when price recovers above key moving averages.
HOW IT WORKS
Entry Logic
The strategy enters long positions when ALL of the following conditions are met:
- RSI Oversold Condition: RSI drops below the configurable threshold (default: 45)
- Bull Market Structure: Long-term MA (150) is below the slow MA (40), indicating overall bullish momentum
- Within Date Range: Trade occurs within the specified backtesting period
Exit Logic
Positions are closed when BOTH conditions are satisfied:
- Price Recovery: Current price moves above the fast MA (15-period)
- MA Alignment: Fast MA crosses above slow MA, confirming trend continuation
Optional Short Trading
When enabled, the strategy can also trade short positions using inverse logic:
- Short Entry: RSI overbought (above 55 by default) + bearish market structure
- Short Exit: Price decline below fast MA + bearish MA alignment
KEY IMPROVEMENTS OVER ORIGINAL
1. Enhanced Risk Management
- ATR-Based Stop Loss/Take Profit: Dynamic risk levels based on market volatility
- Configurable Risk-Reward Ratio: Default 2:1 ratio with full customization
- Alternative Percentage-Based Risk: Option to use fixed percentage stops instead of ATR
2. Optimized Parameters
- RSI Period: Increased to 14 (from original) for more reliable signals
- RSI Buy Signal: Optimized to 45 (from 35) reducing false signals
- Fast MA: Shortened to 15 periods (from 9) for quicker response
- Slow MA: Reduced to 40 periods (from 50) for improved trend detection
- Long MA: Reduced to 150 periods (from 200) for better bull market identification
3. Advanced Features
- Bi-directional Trading: Optional short selling capability
- Comprehensive Visualization: Enhanced plotting with risk level displays
- Flexible Date Range: Improved backtesting controls with visual indicators
- Modern Pine Script v6: Complete rewrite using latest Pine Script features
DEFAULT PARAMETERS EXPLAINED
RSI Settings
- RSI Period: 14 bars - Standard period providing balanced sensitivity
- RSI Buy Signal: 45 - Optimized threshold for bull market dip buying
Moving Average Settings
- Fast MA Length: 15 - Quick-response average for exit signals
- Slow MA Length: 40 - Medium-term trend confirmation
- Long MA Length: 150 - Long-term bull market structure identification
Risk Management (ATR-Based)
- ATR Period: 14 - Standard volatility measurement period
- ATR Stop Loss Multiplier: 2.0 - Conservative stop loss distance
- Risk Reward Ratio: 2.0 - Take profit at 2x the risk amount
Alternative Risk Management (Percentage-Based)
- Stop Loss: 5% - Fixed percentage stop loss
- Take Profit: 10% - Fixed percentage take profit target
Trading Configuration
- Initial Capital: $1,000
- Position Size: 100% of equity per trade
- Commission: 0.1% per trade
- Slippage: 3 ticks
STRATEGY PERFORMANCE CHARACTERISTICS
Strengths
- High Win Rate: 74.8% successful trades based on optimization analysis
- Bull Market Focused: Designed specifically for uptrending market conditions
- Volatility Adaptive: ATR-based risk management adjusts to market conditions
- False Signal Reduction: Optimized parameters minimize whipsaws
Considerations
- Bull Market Dependency: Performance may decline in prolonged bear markets
- Trend Following Nature: May experience drawdowns during strong trend reversals
- High Frequency: Generates multiple signals requiring active monitoring
RISK WARNINGS
Past performance does not guarantee future results. This strategy is optimized for bull market conditions and performance may vary significantly in different market environments. Always use appropriate position sizing and risk management. Real trading results may differ due to execution costs, slippage, and market conditions.
RECOMMENDED USAGE
Optimal Market Conditions
- Bull market or strong uptrending conditions
- Medium to high volatility environments
- Markets with clear trend structure
Timeframes
- Optimized for hourly charts
- Can be adapted for other timeframes with parameter adjustment
Asset Classes
- Originally optimized for Bitcoin
- Suitable for other trending cryptocurrencies and traditional assets
- Test parameters on specific assets before live implementation
TECHNICAL REQUIREMENTS
- Pine Script Version: v6
- Strategy Type: Long/Short (configurable)
- Overlay: Yes - plots directly on price chart
- Real-time Alerts: Compatible with TradingView alert system
This strategy represents a substantial evolution of the original concept, incorporating modern risk management techniques, optimized parameters based on extensive backtesting, and enhanced functionality while maintaining the core "buy the dips" philosophy that made the original strategy popular.
Açık kaynak kodlu komut dosyası
Gerçek TradingView ruhuna uygun olarak, bu komut dosyasının oluşturucusu bunu açık kaynaklı hale getirmiştir, böylece yatırımcılar betiğin işlevselliğini inceleyip doğrulayabilir. Yazara saygı! Ücretsiz olarak kullanabilirsiniz, ancak kodu yeniden yayınlamanın Site Kurallarımıza tabi olduğunu unutmayın.
Try our strategy optimizer at quanttradingpro.com
Developing free strategies weekly stay tuned...
Join our discord discord.gg/2systG9frc
We provide education & tools.
Developing free strategies weekly stay tuned...
Join our discord discord.gg/2systG9frc
We provide education & tools.
Feragatname
Bilgiler ve yayınlar, TradingView tarafından sağlanan veya onaylanan finansal, yatırım, işlem veya diğer türden tavsiye veya tavsiyeler anlamına gelmez ve teşkil etmez. Kullanım Şartları'nda daha fazlasını okuyun.
Açık kaynak kodlu komut dosyası
Gerçek TradingView ruhuna uygun olarak, bu komut dosyasının oluşturucusu bunu açık kaynaklı hale getirmiştir, böylece yatırımcılar betiğin işlevselliğini inceleyip doğrulayabilir. Yazara saygı! Ücretsiz olarak kullanabilirsiniz, ancak kodu yeniden yayınlamanın Site Kurallarımıza tabi olduğunu unutmayın.
Try our strategy optimizer at quanttradingpro.com
Developing free strategies weekly stay tuned...
Join our discord discord.gg/2systG9frc
We provide education & tools.
Developing free strategies weekly stay tuned...
Join our discord discord.gg/2systG9frc
We provide education & tools.
Feragatname
Bilgiler ve yayınlar, TradingView tarafından sağlanan veya onaylanan finansal, yatırım, işlem veya diğer türden tavsiye veya tavsiyeler anlamına gelmez ve teşkil etmez. Kullanım Şartları'nda daha fazlasını okuyun.