Circuit Breaker Halt Indicator for ThinkorSwim

G

GetRichOrDieTrying

Member
Anyone know if a volatility circuit breaker halt indicator exists for thinkorswim?
 
horserider

horserider

Well-known member
VIP
Do you have a URL or a photo. The name means little in the crazy world of indicators.
 
zeek

zeek

Active member
2019 Donor
I am wondering the same, would be really useful to have.
 
G

GetRichOrDieTrying

Member
Do you have a URL or a photo. The name means little in the crazy world of indicators.
A volatility circuit breaker halt is when trading is temporarily suspended because price has increased more than 10% in 10 minutes before the first 15 minutes of the open market or 20% after the first 15 minutes to the closing bell.
 
horserider

horserider

Well-known member
VIP
You can get those in Trade Flash.
No idea how to make an indicator out of it. Somehow the market news would have to be monitored
 
G

GetRichOrDieTrying

Member
You can get a real time update when a circuit breaker halt is opened and closed by keeping the news tab open. However, I'm looking for the ability to have an indicator auto calculate and adjust the volatility circuit breaker halt level as it changes in real time and then display that price on the chart via a line, an arrow or something related.

Thanks for the recommendation on Trade Flash. Unfortunately, that won't do what I need. I'll look around the web. If I find something I'll update the thread.
 
W

Wannaspeed

New member
Any luck finding this? I too am searching for an indicator exactly like this. Das Trader pro will show on the level 2 the upper and lower halt circuit prices. The advantage of something like this is you can see how a price is reacting near these levels, as well as exit your position before the halt.
 
G

GetRichOrDieTrying

Member
Any luck finding this? I too am searching for an indicator exactly like this. Das Trader pro will show on the level 2 the upper and lower halt circuit prices. The advantage of something like this is you can see how a price is reacting near these levels, as well as exit your position before the halt.
No. Unfortunately I haven't.
 
W

Wannaspeed

New member
No. Unfortunately I haven't.
It should be doable making an indicator that's fairly accurate. I'm not great at Thinkscript. It would need to consider whether its normal trading hours and if it's before or after the first 15 minutes and before or after 25 mins before market close.

"The NASDAQ implements circuit breakers on stocks that quickly spike or fall beyond the 10% or 20% range threshold within a rolling five-minute time period for more than 15 seconds. "

It would also have to consider the closing price the previous day, is it between .75-3, is it under .75 or is it over $3. Then the rules for the prices and times. Based on the following chart. IE: Between .75-3 between 9:45-3:35 is 10% move in the last 5 mins. Now like I said, I'm not great at thinkscript, I might give it an attempt at some point, but probably someone that understands what they are doing can take this information and create an Indicator.
 
D

DojiDude

New member
Was also hoping that there was a script for Halt Levels.. Nothing worse than shorting into an upwards halt
 
W

Wannaspeed

New member
Alright I created the Indicator. It took a long time so feel free to send a donation if you find it useful.

Halt Indicator V2 https://tos.mx/woWh7eq
EDIT:Use this one, the code has been updated to fix a small issue on stocks under .75 https://tos.mx/AQBubMo

Source code:

Code:
#Created By Brent Vogl (Wannaspeed, Brent V)
#Do not Distribute without Creator's Permission
#Do you love my indicator? Help me out with a paypal donation by copy/Paste the link below!
#Paypal Donate: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=4CRL8BNAESUHW&source=url
#Date created 11/19/19
#Version 2.1
#Shows Estimated Halt High or Halt Low
################ Inputs (choose what you want to display)
Input showPriorclose = yes;
Input showFiveMinutePrice = yes;
Input showHaltHighPlot = yes;
Input showHaltLowPlot = yes;
#input lowLimit = 0.75;
#input highLimit = 3;
################ Prior Close Price
def aggregationPeriod = AggregationPeriod.DAY;
def displace = -1;
def Priorclose =close(period =aggregationPeriod)[-displace];
################ Definitions
def isopen=if secondsFromTime(0945)>=0 and secondstillTime(1535)>=0 then 1 else 0;
#def beforeStart = GetTime() < RegularTradingStart(getYYYYMMDD());
#def isopen=if secondsFromTime(0930)>=0 and secondstillTime(0945)>=0 and secondsFromTime(1535) and secondsTillTime(1600) then 1 else 0;
def FiveMinPrice = close(period = AggregationPeriod.min)[5];
Def HaltHigh = (if isopen then FiveMinPrice * 1.10 else FiveMinPrice *1.20);
Def HaltLow = if isopen then FiveMinPrice / 1.10 else FiveMinPrice /1.20;
Def HaltHighBetween = (if isopen and priorclose between .75 and 3 then FiveMinPrice * 1.20 else FiveMinPrice *1.40);
Def HaltLowBetween = if isopen and priorclose between .75 and 3 then FiveMinPrice / 1.20 else FiveMinPrice /1.40;
Def HaltHighUnder = if isopen and priorclose is less than 0.75 then FiveMinPrice * 1.75 else FiveMinPrice *2.5;
Def HaltLowUnder = if isopen and priorclose <= 0.75 then FiveMinPrice / 1.75 else FiveMinPrice /2.5;
Def HaltHigh15 = if isopen and priorclose <= 0.75 then fiveMinPrice + 0.15 else fiveMinPrice + 0.30;
Def HaltLow15 = if isopen and priorclose <= 0.75 then fiveMinPrice - 0.15 else fiveMinPrice - 0.30;
################ Labels & Plots
Addlabel (showPriorclose, + Priorclose, color.dark_GRAY);
Addlabel (ShowFiveMinutePrice, + FiveMinPrice, color.DaRK_GRAY);
Addlabel (Priorclose >=3, HaltHigh, color.light_GREEN);#For stocks over $3
#Addlabel (yes, HaltHigh, color.light_GREEN);
Addlabel (Priorclose between 0.75 and 3, HaltHighBetween, color.light_GREEN);#For stocks between .75-3
Addlabel (Priorclose between 0.75 and 3, HaltLowBetween, color.pink);#For stocks between .75-3
Addlabel (Priorclose >=3, HaltLow, color.pINK); #Fors stocks over $3
#Addlabel (Priorclose <=0.75, HaltHighUnder, color.light_Green); #Fors stocks under .75
Addlabel (Priorclose <=0.75, if HaltHighUnder > HaltHigh15 then HaltHigh15 else haltHighUnder, color.light_Green); #Stocks under .75
#Addlabel (Priorclose <=0.75, HaltLowUnder, color.pINK); #Fors stocks under .75
Addlabel (Priorclose <=0.75, if HaltLowUnder < HaltLow15 then HaltLow15 else haltLowUnder, color.pink);#Stocks Under .75 ###check 
#Addlabel (yes, HaltLow, color.pINK);
plot HHighOver3 = if ShowHalthighPlot > 0 and Priorclose >=3 then Halthigh else Double.NaN;
plot HLowOver3 = if ShowHaltLowPlot > 0 and Priorclose >=3 then HaltLow else Double.NaN;
plot HhighBEtween = if ShowhaltHighPlot > 0 and between(PriorClose, .75, 3) then HaltHighBetween else Double.NaN;
#plot HHighBetween = if ShowhaltHigh > 0 and priorclose >= lowLimit and priorclose <= highLimit then HaltHighBetween else Double.NaN;
plot HLowBEtween = if ShowhaltLowPlot > 0 and between(PriorClose, .75, 3) then HaltLowBetween else Double.NaN;
#plot HHighUnder = if ShowhaltHighPlot > 0 and Priorclose <= .75 then HaltHighUnder else Double.NaN;
plot HHighUnder = if ShowhaltHighPlot > 0 and Priorclose <= 0.75 then Min(HaltHighUnder, HaltHigh15) else Double.NaN;
#plot HLowUnder = if ShowhaltLowPlot > 0 and Priorclose <= 0.75 then HaltLowUnder else Double.NaN;
plot HLowUnder = if ShowhaltLowPlot > 0 and Priorclose <= 0.75 then Max(HaltLowUnder, HaltLow15) else Double.NaN;###Check
############
It only works on a 1 minute chart, because of limitations with the aggregation period. I don't know if there's a different way to find out the price for 5 minutes ago on other chart time periods. but if anyone knows how I can try to implement it.

By default it shows yesterday's close price, and the close price from 5 mins ago. These can be turned off. It has an upper and lower halt indicator in light green and pink, It also shows an upper/lower Plot by default, which can also be turned off individually. Just because the price touches or overlaps the halt price does not mean the stock will halt, it has to stay at that level for 15 seconds. Also the stock may halt if there's huge volatility between the bid and the ask. This Indicator only compares the close price 5 mins ago to the current price, so it's only a guideline (though it should be pretty accurate). This indicator will not work for tier 1 stocks, though I don't think this is too necessary because they rarely have Volatility Halts. I may try to implement a daily average volume parameter that factors the lower 5/10% for tier 1 stocks at a later date, but its low priority for me because I rarely trade them.

This Indicator does take into account the first 15 minutes of the day and the last 25 minutes, and increases the ranges respectively. It also factors in the price (over $3, Between .75-3 and under .75) and will do the lesser of either 15/30 cents or 75%/150% for stocks under .75. It does continue to show the Halt prices, and plots for Premarket and Post market although there are no halts during this time. I will try to implement a toggle to disable for Aftermarket hours.

I have no idea the characteristics of the Halt indicator during the first 5 minutes of market open. I'm not sure how the SEC handles it either... (is it based on Open price or premarket prices? This indicator will be based on premarket data. Though Im sure it could be adapted if it needs different data during this period. Anyway, if you have any questions, tips, or notice any bugs or odd behavior feel free to let me know.

 
Last edited:
W

Wannaspeed

New member
Well it seems to work well, its accurately detected 2 halts so far this morning. Only thing I noticed is the bars wont be accurate for 5 minutes after a halt, since TOS doesn't count the time halted as 1 min bars. I'm not sure how to get around that. Only thing I could think of is if volume is 0 for 3 minutes then start counting from last price until volume resumes and 5 minutes passes. Unfortunately my thinkscript coding skills at the moment are not advanced enough to implement that sort of condition.

 
Last edited:
zeek

zeek

Active member
2019 Donor
Thanks @Wannaspeed for creating this(y)

Just so i get it right, the price needs to touch and hold the halt price shown in the labels/plot for at least 15 seconds but only if it happens within the current 1min bar right? Or do i misunderstand it then?
 
W

Wannaspeed

New member
Thanks @Wannaspeed for creating this(y)

Just so i get it right, the price needs to touch and hold the halt price shown in the labels/plot for at least 15 seconds but only if it happens within the current 1min bar right? Or do i misunderstand it then?
There's a certain amount of leeway around the lines, but yes once the current price starts touching the indicator line, and maybe in some cases is close to it you need to start thinking of a potential halt. Since the indicator is only updated every minute and not real time as in the case of the SEC triggers its only a close guideline and there will be slight variances. But the general idea is if a stock moves X % in a rolling 5 minute period and stays above or below X for 15 secs it will halt. I hope that clears it up.

EDIT: If you look at ARAV has halted 2 times so far today, there was a couple times it dipped into the halt indicator but wasn't halted. And comparing it to the other Halt stock I posted earlier, it got deeper into the line before a halt. The Blue arrows are areas where it touched or crossed the halt line but didn't halt. I think there's more flexibility near market open because there's a lot of volatility and price discovery. The purple arrows are where it did halt. Keep in mind right after a halt the information won't be very accurate for about 5 mins. The orange arrows are where the stock played around in the indicator but not long enough, and the last orange arrow I attribute to the delayed nature of the indicator. When I looked at a 10 second chart the price fluctuations from the previous 5 minutes put it between 9-10% depending on which part of the candle you look at. Which is definitely getting close to being halted but apparently not quite enough. I think the SEC must take into account a bit more than ONLY price movement. In the end it's a tool that can only signal a potential halt, not a guaranteed halt. And I'm sure with more experience with the indicator and halted stocks the behavior will be more easily identified by the end user.

 
Last edited:
W

Wannaspeed

New member
I had to tweak the code on the indicator for stocks that closed under .75 cents. basically just had to swap < for > in a couple areas because it was choosing the wrong formula to plot/indicate. The updated Indicator is here https://tos.mx/AQBubMo

Also updated the original post source code and added link to the new Indicator.

Also if anyone could help with code to make the indicator stop using 5 minutes after a halt resumes that would be appreciated. I was thinking the indicator could check volume, and if less than 0 use last price. then once volume > 0 continue using halt resume price for 5 minutes then switch back to the normal previous 5 minute price. Or if anyone has a better idea, i'm all ears.

Basically what happens is when a stock halts thinkorswim stops counting ticks as minutes so it's still using the price from before the halt, but it should be using the halt resumed price until 5 mins passes. The price difference from 5 minutes before a halt and right after a halt can be significant.

EDIT: On second thought, I'm not sure if volume would work, or tickcount or whatever since it would just look at the last candle for the data. Hmmm, not sure how to make it detect a halt..... unless it's something like if tick count, volume or whatever is unchanged for 3 minutes then wait until tick changes. Not sure if that's possible? Any ideas?
 
Last edited:
N

Newbie_789456

New member
@Wannaspeed, this is amazing and much appreciated, thanks! I have yet to trade it/make money with it, but would love to make a donation once I do :)..

In the mean time and in order to get there (and hopefully other participants to this thread) ; I wanted to ask if anyone knew how to setup a custom scanner to narrow down a list of potential stocks that are good candidates to be halted shortly (hence the 8%, and 16 % below respectively instead of the 10 % and 20% at which the stocks would be halted).. so as to have a look at these stocks from the watchlist using your indicator above on the chart...

a simplified version of the conditions would be :

Scan for either:
1) last price is higher or equal to $3 AND the high of the current 1 min candle is at least 8% higher than the low of any of the last 4 candles (1 min)

OR

2) last price is lower then $3 AND the high of the current 1 min candle is at least 16% higher than the low of any of the last 4 candles (1 min)

Appreciate any hints or help you might be able to provide..

Thanks and kind regards!

Newbie
 
W

Wannaspeed

New member
Thanks for the positive feedback. I plan at some point to add a visual for the amount the indicator is looking for with each stock. So if it's a 10% move or 20% 15 cents etc. This way immediately after a halt it can at least be somewhat manually calculated.
I already pretty much know for myself the amount since I had to do a lot of research on order to create the indicator but I think it would be helpful for others that aren't as familiar with what causes stocks to halt.

As far as a scanner to find stocks about to halt, I usually find them with momentum scanners, but I think it's doable to enter a criteria that will find them within TOS. It could be closely built on my scanner settings but instead of 15 cents,10, 20, 40% move in 5 mins it could be like 12 cents 7, 15, 35%. Something close enough to find the stocks moving but not kick out too many stocks. The only bad thing about TOS scanners is when using custom scans they have a delay, and from what I've heard the only way around it is to spam the scan button and even then you have delay from when it populates and from when you can scan again. IMO using TOS to scan for fast moving stocks isnt ideal, there are much better (faster) scanners out there.
 
N

Newbie_789456

New member
The only bad thing about TOS scanners is when using custom scans they have a delay, and from what I've heard the only way around it is to spam the scan button and even then you have delay from when it populates and from when you can scan again. IMO using TOS to scan for fast moving stocks isnt ideal, there are much better (faster) scanners out there.

Thanks for your reply.

Agreed - ToS is not ideal but its free :) I can't justify the cost of tradeideas scanner at this stage given my account size and inconsistent profitability..

Wishing you continued success in trading!
 
L

Len20

Member
I'm new to thinkscript so my code might not be ideal, but I wrote a script to calculate how many minutes each halt was. The code below will display a bubble on bars to show how many minutes the previous bar was halted.

I believe it may help calculate the 5 minutes after a halt in @Wannaspeed's script. Unfortunately, it's beyond my ability to combine them, but hopefully someone more skilled can make it work.

Btw, this can be modified to show the halt on the actual bar the halt happened if interested, but I thought the current code might apply more directly to fixing the 5 minutes post-halt.

Edit: see this code below instead to show likely halts on the bar it actually happened.



Code:
# Halt length detector by LennyP (Some lines credit to tomsk & RobertPayne)
# Indicates how many minutes the halt on previous bar was
# Works on 1 min chart only

declare hide_on_daily;
input Starttime = 0930;
input Endtime   = 1600;

def Active = SecondsFromTime(Starttime) >= 0 and SecondsTillTime(Endtime)-1 >= 0;
def Today  = GetDay() == GetLastDay();
def isMinuteAgg = (GetAggregationPeriod() == AggregationPeriod.MIN);
def Qualifies = Active and Today and isMinuteAgg;

def MinFromStart = rounddown(SecondsFromTime(Starttime)/60,0);

def minutesHalted = if Qualifies
    and MinFromStart > MinFromStart[1] + 1    #if current bar > 1min from previous bar
    then MinFromStart - MinFromStart[1]       #difference in minutes
    else 0;

AddChartBubble(if Qualifies
    and MinFromStart > MinFromStart[1] + 1
    then 1 else 0, high, minutesHalted + " min Halt", Color.orange, yes);
  
#############
 
Last edited:
Top