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!
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 );