TradingView
FourC
4 avr. 2022 03:28

4C Inside/Outside Bar 

Tesla, Inc.NASDAQ

Description

This indicator colors the candle body based on whether it closed as an Inside Bar (IB) or an Outside Bar (OB).
Inside and outside bars can be powerful triggers to enter or exit trades from, when price breaks above or below the candle.
The coloring of only the body and not the border of the candle makes it possible to still know whether the candle was bullish/bearish.

This indicator has the unique ability to add/hide labels for each IB and OB.
Small labels are printed on the chart directly below the candle. (See below)


It also has the unique ability to paint the chart background when an IB forms directly after an OB.
This is a special combination of the two, and can also be a powerful signal.
This feature can be turned on/off. (See below)


Thanks to Craig Stine, as some parts of this indicator were adapted from Custom Candle color Inside/Outside candles, Highwave, Star Patt. by Craig_Stine

Notes de version

04/07/22 Version Update
Updated script to include a chart signal when the combination of an Outside Bar + Inside Bar occurs.
This can be another powerful signal, similar to the Inside Bar + Outside Bar occurs.
Ability to turn the chart signal on/off.

Notes de version

Update 04/08/22

Indicator updated to show 2 new candle combination chart signals:

1) Double Inside Bar: When a 2 inside bars form back to back, the chart paints a background color signal
2) Double Outside Bar: When a 2 outside bars form back to back, the chart paints a background color signal

Double inside and double outside bar combinations can be powerful price action signals.
The double inside bar combination is now the only signal that is turned on by default.

The indicator code was also organized a bit with the addition of these new signals

Notes de version

This new Update (04/11/22) includes several new features.
1) Updated to include labels on the chart for Inside/Outside bar combinations (can still turn on/off).
2) Updated to include labels in the Style Settings for the bar combinations and their background colors (see screenshot in comments)
3) Slightly changed default coloring schemes
4) Refined and reduced the code a bit
Commentaires
tecz0r
Hey there FourC,

Thank you for this great script.

Wanted to ask, is there a way to setup alerts whenever there is an INSIDE BAR on the 10 or 15 minute timeframe?

I see that there are alert settings but was wondering if there is one that will give alerts ONLY for an Inside Bar setting.

Thanks again, take care!
FourC
@tecz0r, Thanks for using the script and for the coin! I do not believe it is possible at this time to set up the alert like that with with Tradingview's default alert conditions. Most of them have to do with values/price 'crossing', 'greater than', etc versus just a "this part of the indicator just signaled" kind of alert. I may have to make some changes to the code or even mess around with changing some parts of it to a strategy (vs indicator) to find some sort of a work around... Not sure how easy that will be to be honest (for me anyways lol). But, i will put this on the to do list and see what i can figure out when i have a chance. Until then i hope you continue to find value with this indicator. Peace!
tecz0r
@FourC, Hi there, thank you for your quick reply!

Yes the script is excellent. I only day trade 0DTEs on SPX. Seeing inside bars on the 10min time frame is incredibly important. In fact, almost all inside 10min bars had a big move after the fact.

I agree with what you're saying with how current TradingView alert system works. I appreciate you putting it on your to do list!

Enjoy the rest of your week and Happy Thanksgiving! Take care!
FourC
@tecz0r, many thanks and enjoy. Happy Thanksgiving
jhedin1
Hi FourC.

Have had a lot of use for this in writing my first lines of code. Clean and clear!

How would you add an entry for example when there has been a double inside bar signal?

Thank you for this great indicator,

Best Johan
FourC
@jhedin1, Hi i am glad you are finding it useful. I am not clear on your question... Can you please ellaborate?
jhedin1
@FourC,

Do you know how make this indicator into a strategy and have alerts sent for algo/automated bot trading? I am new to this and trying to take the next step.
abbe13
Incredible! Thank you!
FourC
@abbe13, hey you're welcome! Hope you find it useful 🍻
Plus