Double Inside Day Indicator + Scanner for ThinkorSwim

BenTen

BenTen

Administrative
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:
L

Likos

Member
2019 Donor
@BenTen


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

 
Last edited:
BenTen

BenTen

Administrative
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:
B

Bluephire1914

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

 
Last edited:
BenTen

BenTen

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

 
Last edited:
dougn

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:
M

mbarcala

New member
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?
 
BenTen

BenTen

Administrative
Staff
VIP
@mbarcala Did you try to add it on your chart? Are you having issues with the code?
 
M

mbarcala

New member
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.
 
T

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
 
BenTen

BenTen

Administrative
Staff
VIP
@mbarcala Recommend you put it on your chart first. Nothing beats personal experience ;)
 
M

mbarcala

New member
Thanks for the code and the tip, I will try tomorrow. Again thanks
 
M

mbarcala

New member
Hi Bent, I though this would be easy, put your code in a Watchlist to scan as I want to but I didn't found how to do it in reality. Would you mind to give me an idea how to use the code in a scan Watchlist?
 
J

jcga1981

New member
Good morning, why is it that on 08/04/20 there is an inside bar in D1 in AAPL or SPY and yet you do not recognize it? Thank you!
 

Top