OPEN-SOURCE SCRIPT

Inside and Outside Bars

Inside Bar:

An inside bar forms when the high and low range of a candlestick is within the high and low range of the previous candlestick.
In other words, the current candlestick's high is lower than the previous candlestick's high, and the current candlestick's low is higher than the previous candlestick's low.
Inside bars indicate a period of consolidation or indecision in the market. They often occur after a strong move in price and can signal a potential reversal or continuation of the trend, depending on the context.

Outside Bar:

An outside bar (or engulfing bar) forms when the high and low range of a candlestick completely engulfs the high and low range of the previous candlestick.
In bullish outside bars, the current candlestick's high is higher than the previous candlestick's high, and the low is lower than the previous candlestick's low.
In bearish outside bars, the current candlestick's high is lower than the previous candlestick's high, and the low is higher than the previous candlestick's low.
Outside bars often indicate a significant shift in market sentiment. Bullish outside bars suggest increased bullish momentum, while bearish outside bars suggest increased bearish momentum.
Chart patterns

Open-source script

In true TradingView spirit, the author of this script has published it open-source, so traders can understand and verify it. Cheers to the author! You may use it for free, but reuse of this code in publication is governed by House rules. You can favorite it to use it on a chart.

Want to use this script on a chart?

Disclaimer