Double Inside Day Indicator + Scanner for ThinkorSwim

BenTen

BenTen

Administrative
Staff
VIP
Warehouse
Here is an indicator that shows Double Inside Bar setup on the Daily. There will also be a scanner included just in case you want to setup a scanner to quickly look for stocks with double inside bar on the daily timeframe.

All credit goes to Drew Griffith for creating the indicator as well as the scanner for ThinkorSwim.

thinkScript Code

Rich (BB code):
#hint: double inside day - next day look for the price to move big one way or another...
def lo = low;
def hi = high;
def vo = volume;

def s = if (hi[2] >= hi[1] and lo[2] <= lo[1]) and (hi[1] >= hi[0] and lo[1] <= lo[0])
and vo[2] >= vo[1] and vo[1] >= vo then 1 else 0;
plot did = s;
did.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN);
did.SetLineWeight(3);
did.AssignValueColor(Color.WHITE);

Scanner

Rich (BB code):
#DoubleInsideDay
#hint: SCAN (only) for "double inside day" - next day look for the price to move big one way or another...
def lo = low;
def hi = high;
def vo = volume;

def s = if (hi[2] >= hi[1] and lo[2] <= lo[1]) and (hi[1] >= hi[0] and lo[1] <= lo[0])
and vo[2] >= vo[1] and vo[1] >= vo then 1 else 0;
plot signal = s within 1 bars;

How to Trade the Double Inside Bar

Similar to the inside day bar, you go long (buy calls) on the breakout of the high of the inside bar and go short (buy puts) on the breakdown of the low of the inside bar.

When you go long stop loss would be the low of the Inside Day bar.

When shorting, stop loss would be the high of the Inside Day bar.
 
Last edited:
L

Likos

Member
VIP
@BenTen


It's missing a function or something? Am I doing this incorrectly?

 
Last edited:
BenTen

BenTen

Administrative
Staff
VIP
Warehouse
@Likos You didn't copy the whole thing. It's missing the following code:

Rich (BB code):
plot signal = s within 1 bars;
 
Last edited:
B

Bluephire1914

New member
VIP
Would it be possible to add an alert to the scanner?

 
Last edited:
BenTen

BenTen

Administrative
Staff
VIP
Warehouse
@Bluephire1914 You can save the scanner as a watchlist and have it displayed on the left sidebar &#128512;

 
Last edited:
dougn

dougn

New member
VIP
This forum is great and I've learned some great ideas here. Thanks!

Referring to this Double Inside script. Can it also be a Colorized Watchlist Column? Do-able probably ... but impossible for me. ;-) (The scanner script seems to work fine but only produces 1.0 and 0.0...not very attractive for a watchlist).

(Edit includes my solution)...
#DoubleInsideDay
#hint: SCAN (only) for "double inside day" - next day look for the price to move big one way or another...
def lo = low;
def hi = high;
def vo = volume;

def s = if (hi[2] >= hi[1] and lo[2] <= lo[1]) and (hi[1] >= hi[0] and lo[1] <= lo[0])
and vo[2] >= vo[1] and vo[1] >= vo then 1 else 0;
plot signal = s within 1 bars;

addlabel(1, if signal then "Di" else " ", color.green);
 
Last edited:

Top