SSR (Short Sale Restriction) Label for ThinkorSwim

zeek

Active member
2019 Donor
Wondering if there`s any script avaliable that shows if a stock currently has the SSR (short sale restriction) on? If not, can this be coded into a label that simply says SSR when the rule gets active and when the rule is no longer active, the label does not show.

Found it myself from this thinkscript coder on Twitter. If you like it, go over there and give him a follow. Best part about this indicator is that it does not just put the SSR label on the chart but it also auto plots the price line where SSR will trigger. Very useful!

Code:
#yakBro SSR alerts and plot line

def agPeriod = AggregationPeriod.DAY;
def lod = low(period=agPeriod); #low of the day
def cod = close(period=agPeriod);#close of the day

#check previous day SSRon or not
def PDC = lod[1]<=.90*cod[2];
#check Today SSRon or not
def Today =lod<=.90*cod[1];

#check if SSR triggered today or yesterday
def SSRon= PDC or Today;

def showLine = lod <= cod[1]*.91 && !PDC ;
#returns true if (close < 9% negativeVolumeIndex (SSR didnt trigger previous day)

plot SSRLine = if showLine then cod[1]*.90 else Double.NaN; #plots line if price is below 9% from previous close

SSRLine.setPaintingStrategy(PaintingStrategy.line);
SSRLine.setDefaultColor(color.red);

#labels....
Alert(SSRon,"SSR Triggered" +""+ getsymbol() +"@"+ asDollars(SSRLine), Alert.ONCE, Sound.Bell);

AddLabel (SSRon,("SSR !!!"), Color.RED );
AddLabel (showLine,("Trigger @ "+asDollars(SSRLine)), Color.RED );
 

tomsk

Well-known member
VIP
All the SSR does is to flag if price has dropped 10% from the prior close Here's a label you can place on your chart - if the stock did not drop 10%, no label is displayed. In other words the label is only displayed if the SSR condition holds true.

Code:
def c = close(period = AggregationPeriod.Day);
def P = (c - c[1]) / c[1];
def SSR = P < -0.10;
AddLabel(SSR, "SSR Alert: Percent Chg = " + P, Color.CYAN);
 

zeek

Active member
2019 Donor
Wondering if anyone can help create a custom watchlist column for SSR. Basically, i want a column that shows if the stock currently has SSR active and if that is true, can say "SSR ON" and color the field red, otherwise if SSR is not currently on, can say "SSR OFF" and color green.

I am hoping someone can create this with the help of the code above, thanks in advance.
 

Len20

Member
I just became aware of this SSR Rule. Couldn't find exactly what I was looking for, so here's my take:
Code:
# SSR Label (Short Sale Restriction rule)
# Len20

# RULES:
# Short Sale-Related Circuit Breaker: The circuit breaker would be triggered for a security any day in which the price declines by 10 percent or more from the prior day's closing price.
# Duration of Price Test Restriction: Once the circuit breaker has been triggered, the alternative uptick rule would apply to short sale orders in that security for the remainder of the day as well as the following day.

def c = close(period = AggregationPeriod.DAY);
def l = low(period = AggregationPeriod.DAY);
def changeToday = (l - c[1]) / c[1];
def changeYest  = (l[1] - c[2]) / c[2];
def SSRactive = changeToday < -0.1 or changeYest < -0.1;
AddLabel(SSRactive, "SSR Active", Color.CYAN);


@zeek I realize you posted about the watchlist column 4 months ago but if still need it here's my version:
Code:
# SSR Watchlist Column (Short Sale Restriction rule)
# Len20
# SET COLUMN AGGREGATION TO DAILY

# RULES:
# Short Sale-Related Circuit Breaker: The circuit breaker would be triggered for a security any day in which the price declines by 10 percent or more from the prior day's closing price.
# Duration of Price Test Restriction: Once the circuit breaker has been triggered, the alternative uptick rule would apply to short sale orders in that security for the remainder of the day as well as the following day.

def c = close;
def l = low;
def changeToday = (l - c[1]) / c[1];
def changeYest  = (l[1] - c[2]) / c[2];
def SSRactive = changeToday < -0.1 or changeYest < -0.1;
AddLabel(1, If SSRactive then "SSR ON" else " ", Color.CYAN);
set column aggregation to DAILY
 

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.
Top