Opening Range Breakout Strategy with Market Volatility for ThinkorSwim

BenTen

BenTen

Administrative
Staff
VIP
@DAJEWA What do you mean by that? If you don't know how to set up the scanner, then watch the video from this thread.
 
BenTen

BenTen

Administrative
Staff
VIP
@DAJEWA I already transferred all the conditions from the backtesting strategy into a separate indicator (posted in message #100). You should be able to compare and see that both the backtesting script and the regular indicator will match up. Not sure what exactly needs to be adjusted in this case.
 
BenTen

BenTen

Administrative
Staff
VIP
@DAJEWA The scanner from this post here will only look for stocks breaking above or below its ORB range. The strategy/indicator in this thread is more advanced because it includes additional filters such as EMA and the MarketVolatility indicator. Whichever you use is up to you. I already made the strategy into an indicator so that you can quickly scan for up and down arrows.
 
BenTen

BenTen

Administrative
Staff
VIP
@vince92615 How did you add the script? Can you share a screenshot of your chart?
 
V

vince92615

New member
VIP
@BenTen copy past the study and add to the 5 min chart. but nothing comes up. tried on different timeframe but still nothing comes up
 
BenTen

BenTen

Administrative
Staff
VIP
@vince92615 This is a backtesting strategy not a regular study. You have to add it as a Strategy. If you're looking for the ORB indicator, you can find it here.
 
K

K_O_Trader

Member
@BenTen Below is a range breakout that ive been using for awhile, is there a way you can add a cloud to it that i can change colors

Code:
#
def na=double.nan;
#
# Define time that OR begins (in hhmm format,
# 0930 is the default):
#
input ORBegin = 0400;
#
# Define time that OR is finished (in hhmm format,
# 10:00 is the default):
#
input OREnd = 0930;
#
# Input first and second fib extension levels
# (default 1.382, 1.621):
#
Input FibExt1=1.382;
Input FibExt2=1.621;
#
# Show Today only? (Default Yes)
#
input ShowTodayOnly={"No", default "Yes"};
def s=ShowTodayOnly;
#
# Show Second fib extension? (Default No)
#
input ShowFibExt2={default "No", "Yes"};
def sf2=ShowFibExt2;
#
# Create logic for OR definition:
#
Def ORActive = if secondstilltime(OREnd)>0 AND secondsfromtime(ORBegin)>=0 then 1 else 0;
#
# Create logic to paint only current day post-open:
#
def today=if s==0 OR getday()==getlastday() AND secondsfromtime(ORBegin)>=0 then 1 else 0;
#
# Track OR High:
#
Rec ORHigh = if ORHigh[1]==0 or ORActive[1]==0 AND ORActive==1 then high else if ORActive AND high>ORHigh[1] then high else ORHigh[1];
#
# Track OR Low:
#
Rec ORLow = if ORLow[1]==0 or ORActive[1]==0 AND ORActive==1 then low else if ORActive AND low<ORLow[1] then low else ORLow[1];
#
# Calculate OR width:
#
Def ORWidth = ORHigh - ORLow;
#
# Calculate fib levels:
#
Def fib_mid = (ORHigh+ORLow)/2;
Def fib_ext_up1 = ORHigh + ORWidth*(FibExt1 - 1);
Def fib_ext_down1 = ORLow - ORWidth*(FibExt1 - 1);
Def fib_ext_up2= ORHigh + ORWidth*(FibExt2 - 1);
Def fib_ext_down2 = ORLow - ORWidth*(FibExt2 - 1);
#
# Define all the plots:
#
Plot ORH=if ORActive OR today<1 then na else ORHigh;
Plot ORL=if ORActive OR today<1 then na else ORLow;
Plot FibMid=if ORActive OR today<1 then na else fib_mid;
Plot FibExtUp1=if ORActive OR today<1 then na else fib_ext_up1;
Plot FibExtDown1=if ORActive OR today<1 then na else fib_ext_down1;
Plot FibExtUp2=if ORActive OR today<1 OR sf2<1 then na else fib_ext_up2;
Plot FibExtDown2=if ORActive OR today<1 OR sf2<1 then na else fib_ext_down2;
#
# Formatting:
#
ORH.setdefaultcolor(color.green);
ORH.setStyle(curve.Long_DASH);
ORH.setlineweight(3);
ORL.setdefaultcolor(color.red);
ORL.setStyle(curve.Long_DASH);
ORL.setlineweight(3);
FibMid.setdefaultcolor(color.gray);
FibMid.setStyle(curve.SHORT_DASH);
FibMid.setlineweight(3);
FibExtUp1.setdefaultcolor(color.green);
FibExtUp1.setStyle(curve.SHORT_DASH);
FibExtUp1.setlineweight(2);
FibExtDown1.setdefaultcolor(color.red);
FibExtDown1.setStyle(curve.SHORT_DASH);
FibExtDown1.setlineweight(2);
FibExtUp2.setdefaultcolor(color.green);
FibExtUp2.setStyle(curve.SHORT_DASH);
FibExtUp2.setlineweight(1);
FibExtDown2.setdefaultcolor(color.red);
FibExtDown2.setStyle(curve.SHORT_DASH);
FibExtDown2.setlineweight(1);
 

Similar threads

Top