Triple Inside Bars Indicator and Scanner for ThinkorSwim

BenTen

BenTen

Administrative
Staff
VIP
Warehouse
Inspired by the Double Inside Day and Narrow Range 4 (NR4) indicators. These patterns are quite popular among traders, especially those who mainly use price action to trade breakouts. Here is the triple inside bars study for ThinkorSwim.

When you have multiple inside bars, it means the stock the currently consolidating. It has 3 candles and each of them are smaller than the previous one.

You can use this indicator to plot triple inside bars on your chart and scan for stocks that are consolidating at the moment. Either trade between the consolidation zone or wait for a breakout/breakdown to happen.





thinkScript Code

Code:
# Triple Inside Day Bars
# Author: Kory Gill, [USER=212]@korygill[/USER]
# Common variables. Using variables reduces calls to TOS iData server.

declare upper;
declare once_per_bar;

def vHigh = high;
def vLow = low;
def nan = Double.NaN;

def range = vHigh - vLow;
def isInsideBar = if range < range[1] and vHigh < vHigh[1] and vLow > vLow[1]
                  then 1
                  else 0;

def triplebar = isInsideBar and isInsideBar[1] and isInsideBar[2];
plot signal = triplebar;
signal.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN);
signal.SetLineWeight(2);
signal.AssignValueColor(Color.WHITE);
plot signal2 = triplebar;
signal2.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);
signal2.SetLineWeight(2);
signal2.AssignValueColor(Color.WHITE);

Shareable Link


Credit:
- @korygill
 
Last edited:
N

NoDough

New member
Hi Ben,
Not sure why my chart doesn't look like the above. All I see is a aqua line. Any suggestions?
Thanks!
 
BenTen

BenTen

Administrative
Staff
VIP
Warehouse
@NoDough Please share a screenshot
 

Top