The inside bar range breakout strategy is a price action strategy that makes trading decisions based on inside bar patterns. It occurs when the range of the current bar, measured by the difference between high and low, is smaller than that of the previous bar, indicating consolidation or indecision in the market. A breakout above or below the previous bar’s high or low provides a potential entry signal in the direction of the breakout.
The strategy utilizes the following indicators and variables:
Entry decisions are based on Range breakouts beyond previous bar’s high/low. Specifically, long entry when upward breakout happens and current low is above liquidityDown, and short entry when downward breakout happens and current high is below liquidityUp.
Stop loss uses ATR multiplied by Range. Take profit uses ATR multiplied by Range.
The advantages of this strategy include:
Risks of this strategy:
Areas of optimization:
The inside bar range breakout strategy capitalizes on range expansion from consolidation by entering when price breaks out of previous bar’s range. Liquidity levels avoid getting trapped. Reasonable stop loss and take profit settings allow riding the momentum after breakout to reach profit target. The strategy can yield good results on intermediate time frames. Further enhancing advantages and system robustness can be achieved through parameter optimization and improving entry filters.
/*backtest start: 2022-12-04 00:00:00 end: 2023-12-10 00:00:00 period: 1d basePeriod: 1h exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}] */ // This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/ // © ilikelyrics560 //@version=5 strategy("Inside Bar Range Breakout Strategy", overlay=true) // Inputs lookback = input.int(20, "Lookback Period", minval=1) atrMult = input.float(1.5, "ATR Multiplier", step=0.1) atrLen = input.int(14, "ATR Length", minval=1) slMult = input.float(2, "Stop Loss Multiplier", step=0.1) tpMult = input.float(3, "Take Profit Multiplier", step=0.1) // Variables atr = ta.atr(atrLen) Range = high - low insideBar = Range < Range[1] breakoutUp = close > high[1] breakoutDown = close < low[1] liquidityUp = ta.highest(high, lookback) liquidityDown = ta.lowest(low, lookback) longEntry = breakoutUp and low > liquidityDown shortEntry = breakoutDown and high < liquidityUp longExit = close < low[1] shortExit = close > high[1] // Plotting plot(liquidityUp, "Liquidity Up", color.new(color.green, 30), 1) plot(liquidityDown, "Liquidity Down", color.new(color.red, 30), 1) bgcolor(longEntry ? color.new(color.green, 30) : na, title="Long Entry") bgcolor(shortEntry ? color.new(color.maroon, 30) : na, title="Short Entry") // Trading if (longEntry) strategy.entry("Long", strategy.long) strategy.exit("Long Exit", "Long", stop=low - slMult * atr, limit=high + tpMult * atr) if (shortEntry) strategy.entry("Short", strategy.short) strategy.exit("Short Exit", "Short", stop=high + slMult * atr, limit=low - tpMult * atr)