Inside Bar Breakout Strategy [with EMA Filter] by asifhkin
By asifhkin
Performance Metrics
- Author: asifhkin
- Symbol: BITSTAMP:BTCUSD
- Timeframe: 15 minutes
- Win Rate: 36.5%
- Profit Factor: 1.183
Description
OverviewThis script implements a fully automated, backtestable Inside Bar Breakout Strategy optimized for Pine Script v6. The inside bar is a classic price action pattern representing a period of market contraction and consolidation. Volatility compression naturally leads to expansion; this strategy aims to capture the immediate momentum when the market breaks out of this tight range.To minimize false breakouts and maximize your win rate, this script incorporates a directional trend filter and a strict order invalidation window.How to Trade This Strategy1. Entry RulesLong Entry: When a bullish inside bar forms, the script places a pending buy-stop order at the High of the Mother Bar.Short Entry: When a bearish inside bar forms, the script places a pending sell-stop order at the Low of the Mother Bar.2. Trend Filtering (The Edge)Entering breakouts blindly can result in whipsaws during choppy markets. This strategy utilizes a built-in Exponential Moving Average (EMA) filter:Long positions are only permitted if the price breaks out while trading above the EMA.Short positions are only permitted if the price breaks out while trading below the EMA.3. Strict Risk ManagementStop Loss (SL): Placed automatically at the opposite invalidation level of the Mother Bar.Take Profit (TP): Calculated dynamically using a fixed Risk-to-Reward ratio (default is 1:2).Time Invalidation: If the market fails to trigger the pending breakout order within a designated number of bars (default is 2), the order is automatically purged. This prevents entering stale setups when the initial momentum has faded.Suitable Timeframes & AssetsScalping & Intraday (5-Minute / 15-Minute): Excellent for capturing rapid, short-term volume spikes. When trading lower timeframes, consider shortening the EMA filter to 50 or 100 to stay aligned with swift intraday trend changes.Day Trading (1-Hour): The optimal timeframe for balanced accuracy. It allows you to catch major session trends (e.g., London or New York expansions) while filtering out minor market noise.Swing Trading (4-Hour / Daily): Provides the highest statistical reliability. Setups are less frequent but present much cleaner breakouts with fewer false moves.Applicable Assets: Highly effective across highly liquid instruments including major currency pairs, indices, large-cap equities, and gold.