Multi Trend Breakout Momentum Trading Strategy
This strategy is a comprehensive trend-following system that combines multiple indicators to capture market trend opportunities through price breakouts, volume confirmation, and EMA alignment. The strategy monitors…

Overview
This strategy is a comprehensive trend-following system that combines multiple indicators to capture market trend opportunities through price breakouts, volume confirmation, and EMA alignment. The strategy monitors price breakouts of recent highs/lows, significant volume increases, and the arrangement of multiple Exponential Moving Averages (EMAs). It also includes an innovative narrow consolidation detection mechanism for capturing potential short opportunities.
Strategy Principles
The core logic of the strategy is based on the following key elements:
- Price Breakout System: Monitors price breakouts above/below the highs/lows of the past 20 periods
- Volume Confirmation: Requires breakout volume to be at least 2x the 20-period average volume
- EMA System: Uses 30/50/200 period EMAs to build a trend confirmation framework
- Long Conditions: Price breaks new high, volume increases, price above 200EMA, short-term EMA above medium-term EMA, and medium-term EMA above long-term EMA
- Short Conditions: Includes two entry mechanisms:
- Traditional Breakout Short: Price breaks new low, volume increases, bearish EMA alignment with downward sloping 200EMA
- Narrow Consolidation Short: Price forms a narrow consolidation below medium-term EMA, with range less than 0.5x ATR
Strategy Advantages
- Multiple Confirmation Mechanism: Enhances signal reliability through price breakout, volume, and EMA triple confirmation
- Flexible Short Entry: Provides two independent short entry methods, increasing trading opportunities
- Strong Adaptability: Uses ATR to define narrow consolidation, allowing adaptation to different market volatility environments
- Robust Risk Control: Uses 200EMA as stop-loss reference, providing clear exit mechanisms
- Parameter Adjustability: Key parameters can be optimized for different market characteristics
Strategy Risks
- False Breakout Risk: Markets may exhibit false breakouts leading to incorrect signals
- Slippage Risk: Significant slippage may occur during high-volume breakout moments
- Trend Reversal Risk: Using EMA-based stops may lead to premature exits in strong trend markets
- Parameter Sensitivity: Strategy performance is sensitive to parameter settings, requiring careful optimization
- Market Environment Dependency: May generate frequent false signals in ranging markets
Strategy Optimization Directions
- Introduce Trend Strength Filtering: Add indicators like ADX to filter signals in weak trend environments
- Optimize Stop-Loss Mechanism: Implement ATR-based dynamic stops for more flexible risk management
- Improve Position Management: Dynamically adjust position sizes based on breakout strength and market volatility
- Add Time Filtering: Implement intraday time filters to avoid trading during volatile opening and closing periods
- Incorporate Market Environment Classification: Dynamically adjust strategy parameters based on different market conditions (trending/ranging)
Summary
The Multi-Trend Breakout Momentum Trading Strategy is a comprehensive trend-following system that ensures signal reliability while providing flexible trading opportunities through the combination of multiple technical indicators. The strategy innovates by combining traditional breakout trading methods with a new narrow consolidation detection mechanism, making it adaptable to different market environments. While certain risks exist, the strategy has the potential to achieve stable performance in trending markets through proper parameter optimization and risk management measures.
Source Pine Script
/*backtest
start: 2024-02-21 00:00:00
end: 2025-02-18 08:00:00
period: 1d
basePeriod: 1d
exchanges: [{"eid":"Binance","currency":"BTC_USDT"}]
*/
//@version=5
strategy("Breakout Strategy (Long & Short) + Slope of 200 EMA", overlay=true)
// -------------------
// 1. Settings
// -------------------
breakout_candles = input.int(20, title="Number of Candles for Breakout")
range_candles = input.int(10, title="Number of Candles for Previous Range")
ema_long_period = input.int(200, title="Long EMA Period")
ema_medium_period = input.int(50, title="Medium EMA Period")
ema_short_period = input.int(30, title="Short EMA Period")
// Checkbox to allow/disallow short positions
allowShort = input.bool(true, title="Allow Short Positions")
// Inputs for the new Narrow Consolidation Short setup
consolidationBars = input.int(10, "Consolidation Bars", minval=1)
narrowThreshInAtr = input.float(0.5,"Narrowness (ATR Mult.)",minval=0.0)
atrLength = input.int(14, "ATR Length for Range")
// -------------------
// 2. Calculations
// -------------------
breakout_up = close > ta.highest(high, breakout_candles)[1]
breakout_down = close < ta.lowest(low, breakout_candles)[1]
prev_range_high = ta.highest(high, range_candles)[1]
prev_range_low = ta.lowest(low, range_candles)[1]
ema_long = ta.ema(close, ema_long_period)
ema_medium = ta.ema(close, ema_medium_period)
ema_short = ta.ema(close, ema_short_period)
average_vol = ta.sma(volume, breakout_candles)
volume_condition = volume > 2 * average_vol
// 200 EMA sloping down?
ema_long_slope_down = ema_long < ema_long[1]
// For the Narrow Consolidation Short
rangeHigh = ta.highest(high, consolidationBars)
rangeLow = ta.lowest(low, consolidationBars)
rangeSize = rangeHigh - rangeLow
atrValue = ta.atr(atrLength)
// Condition: Price range is "narrow" if it's less than (ATR * threshold)
narrowConsolidation = rangeSize < (atrValue * narrowThreshInAtr)
// Condition: All bars under Medium EMA if the highest difference (high - ema_medium) in last N bars is < 0
allBelowMedium = ta.highest(high - ema_medium, consolidationBars) < 0
// -------------------
// 3. Long Entry
// -------------------
breakout_candle_confirmed_long = ta.barssince(breakout_up) <= 3
long_condition = breakout_candle_confirmed_long
and volume_condition
and close > prev_range_high
and close > ema_long
and ema_short > ema_medium
and ema_medium > ema_long
and strategy.opentrades == 0
if long_condition
strategy.entry("Long", strategy.long)
// -------------------
// 4. Short Entries
// -------------------
// (A) Original breakout-based short logic
breakout_candle_confirmed_short = ta.barssince(breakout_down) <= 3
short_condition_breakout = breakout_candle_confirmed_short
and volume_condition
and close < prev_range_low
and close < ema_long
and ema_short < ema_medium
and ema_medium < ema_long
and ema_long_slope_down
and strategy.opentrades == 0
// (B) NEW: Narrow Consolidation Short
short_condition_consolidation = narrowConsolidation
and allBelowMedium
and strategy.opentrades == 0
// Combine them: if either short scenario is valid, go short
short_condition = (short_condition_breakout or short_condition_consolidation) and allowShort
if short_condition
// Use a different order ID if you want to distinguish them
// but "Short" is fine for a single position
strategy.entry("Short", strategy.short)
// -------------------
// 5. Exits
// -------------------
if strategy.position_size > 0 and close < ema_long
strategy.close("Long", qty_percent=100)
if strategy.position_size < 0 and close > ema_long
strategy.close("Short", qty_percent=100)
// ======================================================================
// 5. ADDITIONAL PARTIAL EXITS / STOPS
// ======================================================================
// You can add partial exits for shorts or longs similarly.
// For example:
// if strategy.position_size < 0 and close > stop_level_for_short
// strategy.close("Short", qty_percent=50)Published by ianzeng123 on the FMZ strategy square · last modified 2025-02-20. Collected in the Quant Trading Vault. Unvalidated research: re-test with your own data and costs before trusting it.
Build this with AgenKit
A spec is not a trading system. Paste this into your coding agent and AgenKit runs a specialist team — architecture, test-first build, risk gates, review — with paper trading on by default.
/agenkit build a production-grade trading bot with a backtest engine, risk controls and paper trading by default from strategies/Multi-Trend-Breakout-Momentum-Trading-Strategy.md- npx agenkit install engineering-kit in your project
- Paste the command into your agent and approve each phase
- Get tests, backtest, risk controls and a paper-trading switch
Understand it first
Before you run this, read the lesson behind the idea and how to backtest it honestly. Specs like this one are the survivors of an unknown number of trials; deflate their results accordingly.
Related specs
- Multi Filter Trend Breakthrough Smart Moving Average Trading StrategyPine Script · Breakout · 1h
- Multi Technical Indicator Trend Following Channel Breakout Trading Strategy with Candlestick Pattern Filtering SystemPine Script · Breakout · 1h
- Pivot Based Volume Weighted Breakout Reversal StrategyPine Script · Breakout · 1d
- Multi Strategy Adaptive Trend Following and Breakout Trading SystemPine Script · Breakout · 1d
- Multi Dimensional Technical Indicator Fusion Trend Breakthrough StrategyPine Script · Breakout · 1h
- Multi Indicator Trend Following and Volatility Breakout StrategyPine Script · Breakout · 2h