Double Inside Day Indicator + Scanner for ThinkorSwim

BenTen

Administrative
Staff member
Staff
VIP
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:

Likos

Member
2019 Donor
@BenTen
Vql7yiH.png


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

 
Last edited:

BenTen

Administrative
Staff member
Staff
VIP
@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:

BenTen

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

 
Last edited:

dougn

Member
2019 Donor
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)...
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;

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

mbarcala

Member
VIP
Hi, I'm new to this site and this post got my attention. Would it be possible for any of you to share a picture on how this indicator actually works in the graphic chart or Watchlist when the indication is happening?
 

mbarcala

Member
VIP
No I haven't tried it yet. Just to have an idea how it looks in a photo.

What I'm looking for is a watchlist indicator that tells me which company hits a low or high price hourly.
 

tomsk

Well-known member
VIP
@mbarcala Here is a High Low Watchlist column code that works on daily, hourly or whatever aggregation you may be interested in. Just make sure you select that when you configure your watchlist

Code:
# High Low Watchlist
# tomsk
# 1.23.2020

def cond = if high == close then 1 else if low == close then -1 else 0;
AddLabel(1, if cond == 1 then "High" else if cond == -1 then "Low" else "Range", Color.Black);
AssignBackgroundColor(if cond == 1 then Color.Green else if cond == -1 then Color.Red else Color.Gray);
# End High Low Watchlist
 

Similar threads

Top