Opening Range Breakout Strategy with Market Volatility for ThinkorSwim

We're releasing our first algo for ThinkorSwim based on the Opening Range Breakout indicator. Although calling it an algo, it's simply just a strategy that plot buy and sell signals on your chart. Auto trade isn't supported in ThinkorSwim at the moment so you still have to execute the trade on your own.

The indicator and strategy were developed to solve our own problem. Using the standard ORB indicator, we saw that there were a lot of false breakouts. So we asked ourselves how can we solve this problem.

How Did We Get to This Point?

The biggest issue with the Opening Range indicator is false breakouts and breakdowns. To do so, we added additional indicators into it.

Here is what we added:
Those 3 important components allowed us to trim down a lot of fake breakouts.

We learned that when a breakout or breakdown happen while the market is calm or quiet (not trending) then most likely it's going to be a false signal. As a result, using the Market Volatility that we found was the perfect solution.

Next, sometimes a stock would breakout or breakdown near market close. We don't want that. So we added a time filter into the indicator. This would tell the algo to stop giving us signals an hour before the market closing time.

Lastly, using EMA crossover also helps to confirm the trend indicated by the algo. If there is no crossover then there is no trade. Ultimately, all 3 components have to agree in order for the buy and sell signals to be produced.

Meet the Enhanced ORB Strategy

Rich (BB code):
# 30 min opening range Market Volatility V1.1
# Robert Payne
# Adapted to strategy by WalkingBallista and BenTen
# https://usethinkscript.com/threads/opening-range-breakout-strategy-with-market-volatility-for-thinkorswim.164/

script MV {

input atrlength = 14;

input avglength = 500;

input plotlower = {default "yes", "no"};

def vol = reference ATR(atrlength, averageType = AverageType.SIMPLE);

def avgvol = Average(vol, avglength);

def calm = vol < avgvol - (avgvol * .1);

def neutral = avgvol + (avgvol * .1) > vol > avgvol - (avgvol * .1);

def Volatile = vol > avgvol + (avgvol * .1);

AddLabel(yes, Concat("Market is Currently ", (if calm then "Calm" else if neutral then "Neutral" else if Volatile then "Volatile" else "Neutral")),  if calm then Color.GREEN else if neutral then Color.BLUE else if Volatile then Color.RED  else Color.GRAY);

declare lower;

plot window =  vol - avgvol;

window.SetPaintingStrategy(PaintingStrategy.HISTOGRAM);

window.AssignValueColor(if Volatile then Color.RED else if calm then Color.GREEN else if neutral then Color.BLUE else Color.GRAY);

plot zeroline = 0;

};

def volatile = MV().volatile;

def OpenRangeMinutes = 30;
def MarketOpenTime = 0930;
def LastBar = SecondsFromTime(1530) == 0;
input TimeToStopSignal = 1525;
def TradeTimeFilter = SecondsFromTime(TimeToStopSignal);
input ShowTodayOnly = no;
input UseEMACross = yes;
input ema1_len = 8;
input ema2_len = 13;
AddVerticalLine(SecondsFromTime(0930)==0,"Open",Color.Gray,Curve.SHORT_DASH);
AddVerticalLine(!TradeTimeFilter,"Last Signal",Color.Dark_Gray,Curve.SHORT_DASH);
def Today = if GetDay() == GetLastDay() then 1 else 0;
def FirstMinute = if SecondsFromTime(MarketOpenTime) < 60 then 1 else 0;
def OpenRangeTime = if SecondsFromTime(MarketOpenTime) < 60 * OpenRangeMinutes then 1 else 0;

def ORHigh =  if FirstMinute then high else if OpenRangeTime and high > ORHigh[1] then high else ORHigh[1];
def ORLow = if FirstMinute then low else if OpenRangeTime and low < ORLow[1] then low else ORLow[1];

plot OpenRangeHigh = if ShowTodayOnly and !Today then Double.NaN else if !OpenRangeTime then ORHigh else Double.NaN;
plot OpenRangeLow = if ShowTodayOnly and !Today then Double.NaN else if !OpenRangeTime then ORLow else Double.NaN;

OpenRangeHigh.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
OpenRangeHigh.SetDefaultColor(Color.YELLOW);
OpenRangeHigh.SetLineWeight(2);
OpenRangeLow.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
OpenRangeLow.SetDefaultColor(Color.YELLOW);
OpenRangeLow.SetLineWeight(2);

def dailyRange = high(period = "day" )[1] - low(period = "day" )[1];
def range = Average(dailyRange, 10);

plot ema1 = MovAvgExponential(length=ema1_len);
plot ema2 = MovAvgExponential(length=ema2_len);

# Bullish
AddOrder(OrderType.BUY_TO_OPEN, ((!UseEmaCross AND close crosses above OpenRangeHigh) OR (UseEMACross AND ema1 crosses above OpenRangeHigh)) and TradeTimeFilter < 1 and volatile, tradeSize = 100, tickcolor = GetColor(1), arrowcolor = GetColor(1), name = "TC_O");

AddOrder(OrderType.SELL_TO_CLOSE, ema1 crosses below ema2 or (close < OpenRangeHigh) or LastBar, tickcolor = GetColor(1), arrowcolor = GetColor(1), name = "TC_C");

# Bearish
AddOrder(OrderType.SELL_TO_OPEN, ((!UseEmaCross AND close crosses below OpenRangeLow) OR (UseEMACross AND ema1 crosses below OpenRangeLow)) and TradeTimeFilter < 1 and volatile, tradeSize = 100, tickcolor = GetColor(2), arrowcolor = GetColor(2), name = "TC_O");

AddOrder(OrderType.BUY_TO_CLOSE, ema1 crosses above ema2 or (close > OpenRangeLow) or LastBar, tickcolor = GetColor(2), arrowcolor = GetColor(2), name = "TC_C");

I'm happy to share with you some outstanding results.

f63nTev.png


tXupNeE.png


Over to You!

Those are just some of the most successful plays we had from last week. But don't get too excited just yet because like any other indicators, this one also has its own weakness.

By adding 3 additional conditions into the indicator, we were able to produce a great trading strategy. However, you may still be able to spot some fake breakouts and breakdowns on the chart. Now it's up to you to use your skills to identify these false signals and not to take the trade.

Additionally, we also implemented the EMA crossover rule so that even if the algo is wrong it will still be able to cut losses early.

zEndL6c.png


We recommend that you take partial profit to avoid incident like this.

lsl6iRh.png


If you have any issues, recommendations, or questions while using the algo please comment down below.

Credits:
  • I can't thank @WalkingBallista enough for helping me code all of my ideas into one script. Sometimes we would be up until 1-2 am working on the strategy. If you're in our Discord chatroom please drop him a like &#128512;.
  • Robert Payne for the original ORB indicator


I have copied/pasted this code and nothing appears. Anyone else have this issue?
 
@FVerdy and @jdouglas2002 Are you two Copying & Pasting the code in the first post as a Strategy, which it is, or are you incorrectly saving it as a Study...??? I just went to quickly create it again and mistakenly created a new Study and got a circled ! in the upper left corner of the Chart which, when clicked on, told me the error of my ways... 💡
 
Im writing something similar to this but only using the ORB break at my entry. Im having an issue with my entry being on the bar after it should be (bar high takes out orb, then next bar signal to buy/sell shows up. is there a way to fix this? @BenTen
 
We're releasing our first algo for ThinkorSwim based on the Opening Range Breakout indicator. Although calling it an algo, it's simply just a strategy that plot buy and sell signals on your chart. Auto trade isn't supported in ThinkorSwim at the moment so you still have to execute the trade on your own.

The indicator and strategy were developed to solve our own problem. Using the standard ORB indicator, we saw that there were a lot of false breakouts. So we asked ourselves how can we solve this problem.

How Did We Get to This Point?

The biggest issue with the Opening Range indicator is false breakouts and breakdowns. To do so, we added additional indicators into it.

Here is what we added:
Those 3 important components allowed us to trim down a lot of fake breakouts.

We learned that when a breakout or breakdown happen while the market is calm or quiet (not trending) then most likely it's going to be a false signal. As a result, using the Market Volatility that we found was the perfect solution.

Next, sometimes a stock would breakout or breakdown near market close. We don't want that. So we added a time filter into the indicator. This would tell the algo to stop giving us signals an hour before the market closing time.

Lastly, using EMA crossover also helps to confirm the trend indicated by the algo. If there is no crossover then there is no trade. Ultimately, all 3 components have to agree in order for the buy and sell signals to be produced.

Meet the Enhanced ORB Strategy

Rich (BB code):
# 30 min opening range Market Volatility V1.1
# Robert Payne
# Adapted to strategy by WalkingBallista and BenTen
# https://usethinkscript.com/threads/opening-range-breakout-strategy-with-market-volatility-for-thinkorswim.164/

script MV {

input atrlength = 14;

input avglength = 500;

input plotlower = {default "yes", "no"};

def vol = reference ATR(atrlength, averageType = AverageType.SIMPLE);

def avgvol = Average(vol, avglength);

def calm = vol < avgvol - (avgvol * .1);

def neutral = avgvol + (avgvol * .1) > vol > avgvol - (avgvol * .1);

def Volatile = vol > avgvol + (avgvol * .1);

AddLabel(yes, Concat("Market is Currently ", (if calm then "Calm" else if neutral then "Neutral" else if Volatile then "Volatile" else "Neutral")),  if calm then Color.GREEN else if neutral then Color.BLUE else if Volatile then Color.RED  else Color.GRAY);

declare lower;

plot window =  vol - avgvol;

window.SetPaintingStrategy(PaintingStrategy.HISTOGRAM);

window.AssignValueColor(if Volatile then Color.RED else if calm then Color.GREEN else if neutral then Color.BLUE else Color.GRAY);

plot zeroline = 0;

};

def volatile = MV().volatile;

def OpenRangeMinutes = 30;
def MarketOpenTime = 0930;
def LastBar = SecondsFromTime(1530) == 0;
input TimeToStopSignal = 1525;
def TradeTimeFilter = SecondsFromTime(TimeToStopSignal);
input ShowTodayOnly = no;
input UseEMACross = yes;
input ema1_len = 8;
input ema2_len = 13;
AddVerticalLine(SecondsFromTime(0930)==0,"Open",Color.Gray,Curve.SHORT_DASH);
AddVerticalLine(!TradeTimeFilter,"Last Signal",Color.Dark_Gray,Curve.SHORT_DASH);
def Today = if GetDay() == GetLastDay() then 1 else 0;
def FirstMinute = if SecondsFromTime(MarketOpenTime) < 60 then 1 else 0;
def OpenRangeTime = if SecondsFromTime(MarketOpenTime) < 60 * OpenRangeMinutes then 1 else 0;

def ORHigh =  if FirstMinute then high else if OpenRangeTime and high > ORHigh[1] then high else ORHigh[1];
def ORLow = if FirstMinute then low else if OpenRangeTime and low < ORLow[1] then low else ORLow[1];

plot OpenRangeHigh = if ShowTodayOnly and !Today then Double.NaN else if !OpenRangeTime then ORHigh else Double.NaN;
plot OpenRangeLow = if ShowTodayOnly and !Today then Double.NaN else if !OpenRangeTime then ORLow else Double.NaN;

OpenRangeHigh.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
OpenRangeHigh.SetDefaultColor(Color.YELLOW);
OpenRangeHigh.SetLineWeight(2);
OpenRangeLow.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
OpenRangeLow.SetDefaultColor(Color.YELLOW);
OpenRangeLow.SetLineWeight(2);

def dailyRange = high(period = "day" )[1] - low(period = "day" )[1];
def range = Average(dailyRange, 10);

plot ema1 = MovAvgExponential(length=ema1_len);
plot ema2 = MovAvgExponential(length=ema2_len);

# Bullish
AddOrder(OrderType.BUY_TO_OPEN, ((!UseEmaCross AND close crosses above OpenRangeHigh) OR (UseEMACross AND ema1 crosses above OpenRangeHigh)) and TradeTimeFilter < 1 and volatile, tradeSize = 100, tickcolor = GetColor(1), arrowcolor = GetColor(1), name = "TC_O");

AddOrder(OrderType.SELL_TO_CLOSE, ema1 crosses below ema2 or (close < OpenRangeHigh) or LastBar, tickcolor = GetColor(1), arrowcolor = GetColor(1), name = "TC_C");

# Bearish
AddOrder(OrderType.SELL_TO_OPEN, ((!UseEmaCross AND close crosses below OpenRangeLow) OR (UseEMACross AND ema1 crosses below OpenRangeLow)) and TradeTimeFilter < 1 and volatile, tradeSize = 100, tickcolor = GetColor(2), arrowcolor = GetColor(2), name = "TC_O");

AddOrder(OrderType.BUY_TO_CLOSE, ema1 crosses above ema2 or (close > OpenRangeLow) or LastBar, tickcolor = GetColor(2), arrowcolor = GetColor(2), name = "TC_C");

I'm happy to share with you some outstanding results.

f63nTev.png


tXupNeE.png


Over to You!

Those are just some of the most successful plays we had from last week. But don't get too excited just yet because like any other indicators, this one also has its own weakness.

By adding 3 additional conditions into the indicator, we were able to produce a great trading strategy. However, you may still be able to spot some fake breakouts and breakdowns on the chart. Now it's up to you to use your skills to identify these false signals and not to take the trade.

Additionally, we also implemented the EMA crossover rule so that even if the algo is wrong it will still be able to cut losses early.

zEndL6c.png


We recommend that you take partial profit to avoid incident like this.

lsl6iRh.png


If you have any issues, recommendations, or questions while using the algo please comment down below.

Credits:
  • I can't thank @WalkingBallista enough for helping me code all of my ideas into one script. Sometimes we would be up until 1-2 am working on the strategy. If you're in our Discord chatroom please drop him a like &#128512;.
  • Robert Payne for the original ORB indicator

There is a piece of code in here I am trying to decipher and use in a strategy of my own.

How could I maybe pull out a snippet so that my strategy would only open orders between 930am and 1pm?

Thank you!!!
 
There is a piece of code in here I am trying to decipher and use in a strategy of my own.

How could I maybe pull out a snippet so that my strategy would only open orders between 930am and 1pm?

Thank you!!!

Ruby:
Def openOrderWindow = secondsfromTime(0930) >= 0 and secondsTillTime(1100) >= 0;
AddOrder(orderType.BUY_TO_OPEN, orderOpenWindow and <other trigger>, etc)
 
thanks, @BenTen (and @WalkingBallista) for the enhanced ORB trading algo. What could the changes if I want it as an alert in the watchlist column script? I made an attempt to modify it but it is displaying "loading". Following is the modified code

Code:
# 30 min opening range Market Volatility V1.1
# Robert Payne
# Adapted to strategy by WalkingBallista and BenTen
# https://usethinkscript.com/threads/opening-range-breakout-strategy-with-market-volatility-for-thinkorswim.164/
# Modified (not functioning yet) to accommodate in watchlist column 'scan and alert' | Date: 08052021

script MV {
def atrlength = 14;
def avglength = 500;
#def plotlower = {default "yes", "no"};
def vol = reference ATR(atrlength, averageType = AverageType.SIMPLE);
def avgvol = Average(vol, avglength);
def calm = vol < avgvol - (avgvol * .1);
def neutral = avgvol + (avgvol * .1) > vol > avgvol - (avgvol * .1);
def Volatile = vol > avgvol + (avgvol * .1);
AddLabel(yes, Concat("Market is Currently ", (if calm then "Calm" else if neutral then "Neutral" else if Volatile then "Volatile" else "Neutral")),  if calm then Color.GREEN else if neutral then Color.BLUE else if Volatile then Color.RED  else Color.GRAY);
#declare lower;
#def window =  vol - avgvol;
#window.SetPaintingStrategy(PaintingStrategy.HISTOGRAM);
#window.AssignValueColor(if Volatile then Color.RED else if calm then Color.GREEN else if neutral then Color.BLUE else Color.GRAY);
#def zeroline = 0;
};

def volatile = MV().volatile;
def OpenRangeMinutes = 30;
def MarketOpenTime = 0930;
def LastBar = SecondsFromTime(1530) == 0;

def TimeToStopSignal = 1525;

def TradeTimeFilter = SecondsFromTime(TimeToStopSignal);

def  audibleAlerts = Yes;
def ShowTodayOnly = no;
def UseEMACross = yes;
def ema1_len = 8;
def ema2_len = 13;

#AddVerticalLine(SecondsFromTime(0930)==0,"Open",Color.Gray,Curve.SHORT_DASH);
#AddVerticalLine(!TradeTimeFilter,"Last Signal",Color.Dark_Gray,Curve.SHORT_DASH);

def Today = if GetDay() == GetLastDay() then 1 else 0;
def FirstMinute = if SecondsFromTime(MarketOpenTime) < 60 then 1 else 0;
def OpenRangeTime = if SecondsFromTime(MarketOpenTime) < 60 * OpenRangeMinutes then 1 else 0;

def ORHigh =  if FirstMinute then high else if OpenRangeTime and high > ORHigh[1] then high else ORHigh[1];
def ORLow = if FirstMinute then low else if OpenRangeTime and low < ORLow[1] then low else ORLow[1];


def OpenRangeHigh = if ShowTodayOnly and !Today then Double.NaN else if !OpenRangeTime then ORHigh else Double.NaN;
def OpenRangeLow = if ShowTodayOnly and !Today then Double.NaN else if !OpenRangeTime then ORLow else Double.NaN;

def dailyRange = high(period = "day" )[1] - low(period = "day" )[1];
def range = Average(dailyRange, 10);

def ema1 = MovAvgExponential(length=ema1_len);
def ema2 = MovAvgExponential(length=ema2_len);

def bullish = if (!UseEmaCross AND close crosses above OpenRangeHigh) OR (UseEMACross AND ema1 crosses above OpenRangeHigh) and TradeTimeFilter < 1 and volatile then 1 else 0;
def bearish = if (!UseEmaCross AND close crosses below OpenRangeLow) OR (UseEMACross AND ema1 crosses below OpenRangeLow) and TradeTimeFilter < 1 and volatile then 1 else 0;

AddLabel(bullish , "Bullish ORB", color.black);
AddLabel(bearish, "Bearish ORB", color.black);
AddLabel(!bullish and !bearish, " ", color.black);

AssignBackgroundColor(if bullish then color.green else if bearish then color.red else color.black);

Alert(audibleAlerts and bullish, "Bullish ORB", Alert.BAR, Sound.Ding);
Alert(audibleAlerts and bearish, "Bearish ORB", Alert.BAR, Sound.Ring);
 
thanks, @BenTen (and @WalkingBallista) for the enhanced ORB trading algo. What could the changes if I want it as an alert in the watchlist column script? I made an attempt to modify it but it is displaying "loading". Following is the modified code

Code:
# 30 min opening range Market Volatility V1.1
# Robert Payne
# Adapted to strategy by WalkingBallista and BenTen
# https://usethinkscript.com/threads/opening-range-breakout-strategy-with-market-volatility-for-thinkorswim.164/
# Modified (not functioning yet) to accommodate in watchlist column 'scan and alert' | Date: 08052021

script MV {
def atrlength = 14;
def avglength = 500;
#def plotlower = {default "yes", "no"};
def vol = reference ATR(atrlength, averageType = AverageType.SIMPLE);
def avgvol = Average(vol, avglength);
def calm = vol < avgvol - (avgvol * .1);
def neutral = avgvol + (avgvol * .1) > vol > avgvol - (avgvol * .1);
def Volatile = vol > avgvol + (avgvol * .1);
AddLabel(yes, Concat("Market is Currently ", (if calm then "Calm" else if neutral then "Neutral" else if Volatile then "Volatile" else "Neutral")),  if calm then Color.GREEN else if neutral then Color.BLUE else if Volatile then Color.RED  else Color.GRAY);
#declare lower;
#def window =  vol - avgvol;
#window.SetPaintingStrategy(PaintingStrategy.HISTOGRAM);
#window.AssignValueColor(if Volatile then Color.RED else if calm then Color.GREEN else if neutral then Color.BLUE else Color.GRAY);
#def zeroline = 0;
};

def volatile = MV().volatile;
def OpenRangeMinutes = 30;
def MarketOpenTime = 0930;
def LastBar = SecondsFromTime(1530) == 0;

def TimeToStopSignal = 1525;

def TradeTimeFilter = SecondsFromTime(TimeToStopSignal);

def  audibleAlerts = Yes;
def ShowTodayOnly = no;
def UseEMACross = yes;
def ema1_len = 8;
def ema2_len = 13;

#AddVerticalLine(SecondsFromTime(0930)==0,"Open",Color.Gray,Curve.SHORT_DASH);
#AddVerticalLine(!TradeTimeFilter,"Last Signal",Color.Dark_Gray,Curve.SHORT_DASH);

def Today = if GetDay() == GetLastDay() then 1 else 0;
def FirstMinute = if SecondsFromTime(MarketOpenTime) < 60 then 1 else 0;
def OpenRangeTime = if SecondsFromTime(MarketOpenTime) < 60 * OpenRangeMinutes then 1 else 0;

def ORHigh =  if FirstMinute then high else if OpenRangeTime and high > ORHigh[1] then high else ORHigh[1];
def ORLow = if FirstMinute then low else if OpenRangeTime and low < ORLow[1] then low else ORLow[1];


def OpenRangeHigh = if ShowTodayOnly and !Today then Double.NaN else if !OpenRangeTime then ORHigh else Double.NaN;
def OpenRangeLow = if ShowTodayOnly and !Today then Double.NaN else if !OpenRangeTime then ORLow else Double.NaN;

def dailyRange = high(period = "day" )[1] - low(period = "day" )[1];
def range = Average(dailyRange, 10);

def ema1 = MovAvgExponential(length=ema1_len);
def ema2 = MovAvgExponential(length=ema2_len);

def bullish = if (!UseEmaCross AND close crosses above OpenRangeHigh) OR (UseEMACross AND ema1 crosses above OpenRangeHigh) and TradeTimeFilter < 1 and volatile then 1 else 0;
def bearish = if (!UseEmaCross AND close crosses below OpenRangeLow) OR (UseEMACross AND ema1 crosses below OpenRangeLow) and TradeTimeFilter < 1 and volatile then 1 else 0;

AddLabel(bullish , "Bullish ORB", color.black);
AddLabel(bearish, "Bearish ORB", color.black);
AddLabel(!bullish and !bearish, " ", color.black);

AssignBackgroundColor(if bullish then color.green else if bearish then color.red else color.black);

Alert(audibleAlerts and bullish, "Bullish ORB", Alert.BAR, Sound.Ding);
Alert(audibleAlerts and bearish, "Bearish ORB", Alert.BAR, Sound.Ring);

@debanjan.goswami LOVE the ORB strategy. I am using the older version of ORB with minor mod, which works fine for my style. You mentioned the watchlist column. The code below is a column on my watchlist that will indicate above/inside, or below the ORB. This will quick glance/sort by this column if a stock is breaking out. Apologies in advance if my indicators or chart is blinding. Good Luck! @cabe1332

# ORB Watch List Column
# cabe1332 20210321

# ORB strategy
# Column on watchlist will show green "A" if above ORH, or yellow "I" between ORH and ORL, and red "B" if below ORL

# start code
input StartTime = 0930;
input EndTime = 0945;
def h = high;
def l = low;
def c = close;
def ORActive = if SecondsFromTime(StartTime) > 0 and
SecondsTillTime(EndTime) >= 0
then 1
else 0;
def ORH = if ORActive and !ORActive[1]
then h
else if ORActive and
h > ORH[1]
then h
else ORH[1];
def ORL = if ORActive and !ORActive[1]
then l
else if ORActive and
l < ORL[1]
then l
else ORL[1];
def ORhigh = if !ORActive
then ORH
else Double.NaN;
def ORlow = if !ORActive
then ORL
else Double.NaN;

AddLabel(1, if close > ORhigh
#then "Above"
then "A "
else if close < ORlow
#then "Below"
then "B "
#else "Inside"
else "I ",
if close > ORhigh
then color.green
else if close < ORlow
then color.red
else color.yellow);

# end code
 
Last edited by a moderator:
There are many flavors of ORB studies. Not just the 1st post of those and this thread but sprinkle throughout those and this thread.
Plug&Play with them. Watch them on your favorite equities/futures and on your favorite time frames. Read through the threads to become familiar how other members are using the many variations and why and what the caveats are with these many versions.
 
After reading this thread, I hope I'm not showing up with stupid questions.

Question #1: Please confirm: I'm assuming this strategy uses these parameters (IF emacross is set to YES), please confirm:
1. ema crossover (OK-understood)
2. price crosses the range (OK-understood)
3. the time is prior to 1525 (OK-understood)
4. volatility > 110% (not well understood, leads to more questions below ...)

Question #2: Let me get this straight, this volatility is being calculated from the 500-period ATR of whatever time frame your chart is displaying?
e.g.: I'm looking at 2 minute chart, so the volatility calculation is based on 500 2-minute candles.

Question #3: Is there a reason that ATR was chosen for the volatility calculation instead of the high-low range of the candles? (I was thinking there'd be possibly of gaps throwing off the calculations, since ATR includes gaps, but now I'm thinking that maybe gapping increasing the calculations would be a good thing, since usually things with orders queued up in the pre-market have some measure of momentum to them, and tend to gap up, thus resulting in price action being more volatile than normal.

Question #4: What is the point of this code snippet below ? I can't find where it's used in the strategy. Since I read through the code from top-down, I was anticipating that it would be also used as a validity constraint, i.e.: don't take the trade if the opening range is too large a percentage of the average daily range, but as I looked through the rest of the code, it didn't appear to be used.

Code:
def dailyRange = high(period = "day" )[1] - low(period = "day" )[1];
def range = Average(dailyRange, 10);
 
After reading this thread, I hope I'm not showing up with stupid questions.

Question #1: Please confirm: I'm assuming this strategy uses these parameters (IF emacross is set to YES), please confirm:
1. ema crossover (OK-understood)
2. price crosses the range (OK-understood)
3. the time is prior to 1525 (OK-understood)
confirm

4. volatility > 110% (not well understood, leads to more questions below ...)

Question #2: Let me get this straight, this volatility is being calculated from the 500-period ATR of whatever time frame your chart is displaying?
e.g.: I'm looking at 2 minute chart, so the volatility calculation is based on 500 2-minute candles.
yes

Question #3: Is there a reason that ATR was chosen for the volatility calculation instead of the high-low range of the candles? (I was thinking there'd be possibly of gaps throwing off the calculations, since ATR includes gaps, but now I'm thinking that maybe gapping increasing the calculations would be a good thing, since usually things with orders queued up in the pre-market have some measure of momentum to them, and tend to gap up, thus resulting in price action being more volatile than normal.
ATR is the industry-standard for the definition of volatility. But there are a 1000 other definitions offered up on this forum. I believe there is one that uses Moon phases.

Question #4: What is the point of this code snippet below ? I can't find where it's used in the strategy. Since I read through the code from top-down, I was anticipating that it would be also used as a validity constraint, i.e.: don't take the trade if the opening range is too large a percentage of the average daily range, but as I looked through the rest of the code, it didn't appear to be used.

Code:
def dailyRange = high(period = "day" )[1] - low(period = "day" )[1];
def range = Average(dailyRange, 10);
The above code does not do anything. Feel free to delete. This study has been bouncing around for almost 2 decades. As things are changed and modified, orphan code snippets are not unusual.
 
it might be a noob question. Can you please tell me what does TC-100, TC0 means and how they are used for trading options?
 
it might be a noob question. Can you please tell me what does TC-100, TC0 means and how they are used for trading options?
Not sure what you are asking. If you read through the 7 pages, you should be able to get a basic understanding of this indicator.
Recommend you put it on your chart. Nothing beats personal experience ;) The only way you will know what works best for you is to play with the settings and see how the indicator line up w/ your strategy and with your other indicators. To determine if this indicator brings value, analyze it over different timeframes, across history and with multiple instruments.

Many members use the Blast-off Indicator if trading options. https://usethinkscript.com/threads/daily-watchlist-of-stocks-questions.7585/
 
@BenTen Thank you very much for this strategy. I have been having some success using it while paper trading. One thing I am interest in is setting up alerts against a signal for BUY_TO_OPEN or SELL_TO_OPEN. I have tried adding this to the script but it keeps alerting over and over against old signals for BUY_TO_OPEN or SELL_TO_OPEN. Can you help provide some guidance on how this can be accomplished?
 
@BenTen Thank you very much for this strategy. I have been having some success using it while paper trading. One thing I am interest in is setting up alerts against a signal for BUY_TO_OPEN or SELL_TO_OPEN. I have tried adding this to the script but it keeps alerting over and over against old signals for BUY_TO_OPEN or SELL_TO_OPEN. Can you help provide some guidance on how this can be accomplished?
https://usethinkscript.com/threads/...latility-for-thinkorswim.164/page-4#post-8457
 

Join useThinkScript to post your question to a community of 21,000+ developers and traders.

Similar threads

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

87k+ Posts
520 Online
Create Post

Similar threads

Similar threads

The Market Trading Game Changer

Join 2,500+ subscribers inside the useThinkScript VIP Membership Club
  • Exclusive indicators
  • Proven strategies & setups
  • Private Discord community
  • ‘Buy The Dip’ signal alerts
  • Exclusive members-only content
  • Add-ons and resources
  • 1 full year of unlimited support

Frequently Asked Questions

What is useThinkScript?

useThinkScript is the #1 community of stock market investors using indicators and other tools to power their trading strategies. Traders of all skill levels use our forums to learn about scripting and indicators, help each other, and discover new ways to gain an edge in the markets.

How do I get started?

We get it. Our forum can be intimidating, if not overwhelming. With thousands of topics, tens of thousands of posts, our community has created an incredibly deep knowledge base for stock traders. No one can ever exhaust every resource provided on our site.

If you are new, or just looking for guidance, here are some helpful links to get you started.

What are the benefits of VIP Membership?
VIP members get exclusive access to these proven and tested premium indicators: Buy the Dip, Advanced Market Moves 2.0, Take Profit, and Volatility Trading Range. In addition, VIP members get access to over 50 VIP-only custom indicators, add-ons, and strategies, private VIP-only forums, private Discord channel to discuss trades and strategies in real-time, customer support, trade alerts, and much more. Learn all about VIP membership here.
How can I access the premium indicators?
To access the premium indicators, which are plug and play ready, sign up for VIP membership here.
Back
Top