OPEN-SOURCE SCRIPT

Hybrid Trend-Following Inside Bar Breakout

48
Hybrid Trend-Following Inside Bar Breakout Strategy

The Hybrid Trend-Following Inside Bar Breakout Strategy is a rule-based trading system designed to capture strong directional moves while controlling risk during uncertain market conditions. It combines trend-following, price action, and volatility-based risk management into a single robust framework.

Core Concept

The strategy trades inside bar breakouts only in the direction of the dominant market trend. Inside bars represent periods of consolidation, and when price breaks out of this consolidation in a trending market, it often leads to impulsive moves with favorable risk–reward characteristics.

Key Components
1. Trend Filter

  • Uses 50 EMA and 200 EMA to define the market trend.

  • Bullish bias: 50 EMA above 200 EMA

  • Bearish bias: 50 EMA below 200 EMA

This filter prevents counter-trend trades and improves trade quality.

2. Volatility Filter

  • Compares fast ATR (14) with slow ATR (50).

  • Trades are taken only when volatility is expanding or above a minimum threshold.

  • This avoids low-volatility, choppy market conditions.


3. Inside Bar Breakout

  • An inside bar forms when the current candle’s high is lower than the previous candle’s high and the low is higher than the previous candle’s low.

  • A trade is triggered only when price breaks above or below the inside bar range in the direction of the trend.


4. Candle Quality Filter

Requires a minimum body-to-range ratio, ensuring that the breakout candle has strong momentum and is not driven by weak wicks.

Risk Management & Trade Management

Stop Loss (SL)

  1. Placed using ATR-based dynamic stops, adapting to current market volatility.

  2. Prevents tight stops in volatile conditions and wide stops in calm markets.


Partial Profit Taking

  • 50% of the position is exited at 1.5R, locking in profits early.

  • This reduces psychological pressure and improves equity stability.


Trailing Stop

  • After partial profit is taken, the remaining position is managed with an ATR-based trailing stop.

  • Allows the strategy to capture large trend moves while protecting gains.


Cooldown Mechanism

  • After a losing trade, the system enters a cooldown period and skips a fixed number of bars.

  • This helps avoid revenge trading and overtrading during unfavorable market phases.


Why This Strategy Works

Trades only high-probability breakouts in trending markets

Adapts automatically to changing volatility

Combines price action precision with systematic risk control

Designed for consistent performance over long historical periods

Pernyataan Penyangkalan

Informasi dan publikasi ini tidak dimaksudkan, dan bukan merupakan, saran atau rekomendasi keuangan, investasi, trading, atau jenis lainnya yang diberikan atau didukung oleh TradingView. Baca selengkapnya di Ketentuan Penggunaan.