ToS Relative Strength (RS) Watchlist, Label, Scan For ThinkOrSwim

Batman

Member
What would be the right coding to turn the Relative Strength indicator into a crossover strategy? I'm thinking of a strategy that adds an up arrow when RS crosses above SRatio, and a down arrow when RS crosses below SRatio.

My theory is that once a stock starts outperforming or underperforming SPX, it's a good time to put it on a watchlist and watch for a consistent trend. But I'm having the hardest time converting that into a strategy.

The Relative Strength code is as follows:

#
# TD Ameritrade IP Company, Inc. (c) 2008-2021
#

declare lower;

input CorrelationWithSecurity = "SPX";
def close2 = close(CorrelationWithSecurity);

plot RS = if close2 == 0 then 0 else close/close2;
RS.setDefaultColor(GetColor(6));

def sr = CompoundValue("historical data" = RS, "visible data" = if isNaN(sr[1]) then RS else sr[1]);
plot SRatio = sr;
SRatio.setDefaultColor(GetColor(5));
 
Solution
What would be the right coding to turn the Relative Strength indicator into a crossover strategy? I'm thinking of a strategy that adds an up arrow when RS crosses above SRatio, and a down arrow when RS crosses below SRatio.

steps i did, to make this lower, an upper study
copy your code
disable declare lower
change original plots to def

add 2 formulas, to look for a crossing above and a crossing below
add plot commands for arrows, green when it crosses above, and red when it crosses below.

i rewrote the SR formula, to simplify things. ... i don't like CompoundValue() formulas, they seem confusing.

Ruby:
# relstr_crossing_00

def na = double.nan;

# Relative Strength
# TD Ameritrade IP Company, Inc. (c) 2008-2021
#declare...
What would be the right coding to turn the Relative Strength indicator into a crossover strategy? I'm thinking of a strategy that adds an up arrow when RS crosses above SRatio, and a down arrow when RS crosses below SRatio.

steps i did, to make this lower, an upper study
copy your code
disable declare lower
change original plots to def

add 2 formulas, to look for a crossing above and a crossing below
add plot commands for arrows, green when it crosses above, and red when it crosses below.

i rewrote the SR formula, to simplify things. ... i don't like CompoundValue() formulas, they seem confusing.

Ruby:
# relstr_crossing_00

def na = double.nan;

# Relative Strength
# TD Ameritrade IP Company, Inc. (c) 2008-2021
#declare lower;
input CorrelationWithSecurity = "SPX";
def close2 = close(CorrelationWithSecurity);

def RS = if close2 == 0 then 0 else close/close2;
#plot RS = if close2 == 0 then 0 else close/close2;
#RS.setDefaultColor(GetColor(6));
#RS.setDefaultColor(color.green);

#def sr = CompoundValue("historical data" = RS, "visible data" = if isNaN(sr[1]) then RS else sr[1]);
def sr = if barnumber() == 1 then rs else sr[1];
def SRatio = sr;
#plot SRatio = sr;
#SRatio.setDefaultColor(GetColor(5));
#sratio.setDefaultColor(color.red);

# ---------------------------

# upper stuff

def xup = if rs crosses above sr then 1 else 0;
def xdwn = if rs crosses below sr then 1 else 0;

plot z1 = if xup then low*0.997 else na;
plot z2 = if xdwn then high*1.003 else na;
z1.SetPaintingStrategy(PaintingStrategy.ARROW_UP);
z2.SetPaintingStrategy(PaintingStrategy.ARROW_DOWN);
z1.SetDefaultColor(Color.green);
z2.SetDefaultColor(Color.red);
z1.setlineweight(2);
z2.setlineweight(2);
z1.hidebubble();
z2.hidebubble();
#
 
Solution
Is there a way to scan for relative strength for a 3 month period? For example: a stock populates if the Relative Strength of the stock is greater than the SRatio but within the 3 month period for a daily chart. Is this something that needs to be coded? Thanks for any help!
 
Is there a way to scan for relative strength for a 3 month period? For example: a stock populates if the Relative Strength of the stock is greater than the SRatio but within the 3 month period for a daily chart. Is this something that needs to be coded? Thanks for any help!
I found a free stock list link on Twitter that is showing RS at new high. See the link below.

https://docs.google.com/spreadsheets/d/1D2XhbbQe4N9zcQ9RrKtE0Zu7pAMyX-7DqS6SX-BSW78/edit#gid=0
 
Something similar to this screenshot where you can input 8 tickers and it will compare its' strength against spy.

ST.jpg
 
I added a simple label to the RelativeStrength indicator. It calculates the percent change between the RS and SRatio and displays it in a label. The default value for CorrelationWithSecurity is "SPX", but I will change that to the sector ETF that corresponds to whatever ticker I'm looking at.

For instance, if I'm looking at Apple, I'll change that input from SPX to XLK. So, I want the label to read something like, "RS is 32.45% Above XLK". The problem is, the CorrelationWithSecurity input isn't printing out. I don't get an error, just no value. I'm getting, "RS is 32.45% Above".

Is there something wrong in my code? I don't understand why the value of CorrelationWithSecurity isn't displaying. The AddLabel function is the only change I made to the original RelativeStrength indicator.

declare lower;

input show_lables = no;
input CorrelationWithSecurity = "SPX";
def close2 = close(CorrelationWithSecurity);

plot RS = if close2 == 0 then 0 else close/close2;
RS.setDefaultColor(GetColor(6));

def sr = CompoundValue("historical data" = RS, "visible data" = if isNaN(sr[1]) then RS else sr[1]);
plot SRatio = sr;
SRatio.setDefaultColor(GetColor(5));

AddLabel(yes, "RS is " + Round((AbsValue(SRatio - RS) / ((SRatio + RS) / 2)) * 100, 2) + "%" + if (RS >= SRatio) then " Above " else " Below " + CorrelationWithSecurity, if (RS >= SRatio) then Color.GREEN else Color.RED);
 
AddLabel(yes, "RS is " + Round((AbsValue(SRatio - RS) / ((SRatio + RS) / 2)) * 100, 2) + "%" + (if (RS >= SRatio) then " Above " else " Below ") + CorrelationWithSecurity, if (RS >= SRatio) then Color.GREEN else Color.RED);
 
Something similar to this screenshot where you can input 8 tickers and it will compare its' strength against spy.


this compares 8 stocks to 1 stock, to calculate the relative strength (a ratio of each pair)
default compare stock , SPY


Code:
# compare_8stocks_rel_str_00

#https://usethinkscript.com/threads/a-chart-that-compares-relative-strength-against-spy.12637/
#UnAnswered A chart that compares relative strength against spy
# Thread starterpoopyhead5928  Start dateSep 12, 2022

#Something similar to this screenshot where you can input 8 tickers and it will compare its' strength against spy.


# copy formulas from  RelativeStrength , TD Ameritrade

declare lower;

input CorrelationWithSecurity = "SPY";
def cls_corr = close(CorrelationWithSecurity);
#plot RS = if close_corr == 0 then 0 else close / close_corr;
#RS.SetDefaultColor(GetColor(6));
#def sr = CompoundValue("historical data" = RS, "visible data" = if IsNaN(sr[1]) then RS else sr[1]);
#plot SRatio =  sr;
#SRatio.SetDefaultColor(GetColor(5));

#----------------

input Symbol1 = "AAPL";
def cls1 = close(Symbol1);
def rs1 = if cls_corr == 0 then 0 else cls1/cls_corr;
plot z1 = rs1;

input Symbol2 = "META";
def cls2 = close(Symbol2);
def rs2 = if cls_corr == 0 then 0 else cls2/cls_corr;
plot z2 = rs2;

input Symbol3 = "PYPL";
def cls3 = close(Symbol3);
def rs3 = if cls_corr == 0 then 0 else cls3/cls_corr;
plot z3 = rs3;

input Symbol4 = "AMD";
def cls4 = close(Symbol4);
def rs4 = if cls_corr == 0 then 0 else cls4/cls_corr;
plot z4 = rs4;

input Symbol5 = "TSLA";
def cls5 = close(Symbol5);
def rs5 = if cls_corr == 0 then 0 else cls5/cls_corr;
plot z5 = rs5;

input Symbol6 = "AMZN";
def cls6 = close(Symbol6);
def rs6 = if cls_corr == 0 then 0 else cls6/cls_corr;
plot z6 = rs6;

input Symbol7 = "MSFT";
def cls7 = close(Symbol7);
def rs7 = if cls_corr == 0 then 0 else cls7/cls_corr;
plot z7 = rs7;

input Symbol8 = "QQQ";
def cls8 = close(Symbol8);
def rs8 = if cls_corr == 0 then 0 else cls8/cls_corr;
plot z8 = rs8;

#------------------------------

# draw bubbles , to the right of last bar, with symbol name
def off = 5;
def x = (!isnan(close[off]) and isnan(close[off-1]) );

addchartbubble(x, rs1[off], Symbol1, z1.TakeValueColor(), yes);
addchartbubble(x, rs2[off], Symbol2, z2.TakeValueColor(), yes);
addchartbubble(x, rs3[off], Symbol3, z3.TakeValueColor(), yes);
addchartbubble(x, rs4[off], Symbol4, z4.TakeValueColor(), yes);
addchartbubble(x, rs5[off], Symbol5, z5.TakeValueColor(), yes);
addchartbubble(x, rs6[off], Symbol6, z6.TakeValueColor(), yes);
addchartbubble(x, rs7[off], Symbol7, z7.TakeValueColor(), yes);
addchartbubble(x, rs8[off], Symbol8, z8.TakeValueColor(), yes);


def offc = off + 24;
def xc = (!isnan(close[offc]) and isnan(close[offc-1]) );
def minc = min(rs1,min(rs2,min(rs3,min(rs4,min(rs5,min(rs6,min(rs7,rs8)))))));
addchartbubble(xc, minc[offc], 
"Compared\n" +
"     to\n" +
"     " + 
CorrelationWithSecurity 
, Color.yellow, yes);
#
#

fL7Ldkh.jpg
 
an updated version, that normalizes the RS's

this calculates the relative strength of a stock compared to another (default, SPY)
the first stock RS sets the size of the plots.
can enter up to 7 more stocks. they are scaled to the first stock.


Code:
# rs_normalize_compare_00

#https://usethinkscript.com/threads/normalized-scale-for-relative-strength-rs.12072/
# How can I normalize the stocks' RS ratios to compare them?

#==========================================

# compare_8stocks_rel_str_00
#https://usethinkscript.com/threads/a-chart-that-compares-relative-strength-against-spy.12637/
#UnAnswered A chart that compares relative strength against spy

declare lower;

def na = double.nan;

#=======================================

script normalizePlot {
  input data = close;
  input newRngMin = 0;
  input newRngMax = 100;
  def HHData = HighestAll(data);
  def LLData = LowestAll(data);
  plot nr = (((newRngMax - newRngMin)*(data - LLData))/(HHData - LLData)) + newRngMin;
}

#def a = normalizePlot(data, newmin, newmax);

#=======================================

input CorrelationWithSecurity = "SPY";
def cls_corr = close(CorrelationWithSecurity);
#plot RS = if close_corr == 0 then 0 else close / close_corr;
#RS.SetDefaultColor(GetColor(6));
#def sr = CompoundValue("historical data" = RS, "visible data" = if IsNaN(sr[1]) then RS else sr[1]);
#plot SRatio =  sr;
#SRatio.SetDefaultColor(GetColor(5));

#----------------

# symbol1 is the main stock.
# all others will be scaled to stock1 data
# use symbol  ZZ  for non entries

input Symbol1_primary = "AAPL";
#hint Symbol1_primary: This stock determines the min and max boundries. the other stocks will be scaled to be within the limits of this stock. This symbol needs to be entered.

def cls1 = close(Symbol1_primary);
def rs1 = if isnan(cls1) then na else if cls_corr == 0 then na else cls1/cls_corr;
def n1 = rs1;
plot z1 = n1;
z1.hidebubble();

def s1hi = highestall(rs1);
def s1lo = lowestall(rs1);
def s1rng = s1hi - s1lo;

input show_upper_lower_lines = yes;
plot s1top = if show_upper_lower_lines and !isnan(close) then s1hi else na;
plot s1bot = if show_upper_lower_lines and !isnan(close) then s1lo else na;
s1top.setdefaultcolor(color.gray);
s1bot.setdefaultcolor(color.gray);
s1top.hidebubble();
s1bot.hidebubble();


#---------------------------
#def a = normalizePlot(data, newmin, newmax);

input Symbol2 = "MSFT";
#hint symbol2: Enter a stock symbol for any of the symbols 2 to 8. \nIf you don't want to enter a stock, use ZZ.
def cls2 = close(Symbol2);
#def rs2 = if cls_corr == 0 then 0 else cls2/cls_corr;
def rs2 = if isnan(cls2) then na else if cls_corr == 0 then na else cls2/cls_corr;
def n2 = normalizePlot(rs2, s1lo, s1hi);
plot z2 = n2;
z2.hidebubble();

input Symbol3 = "WMT";
def cls3 = close(Symbol3);
def rs3 = if isnan(cls3) then na else if cls_corr == 0 then na else cls3/cls_corr;
def n3 = normalizePlot(rs3, s1lo, s1hi);
plot z3 = n3;
z3.hidebubble();

input Symbol4 = "ZZ";
def cls4 = close(Symbol4);
def rs4 = if isnan(cls4) then na else if cls_corr == 0 then na else cls4/cls_corr;
def n4 = normalizePlot(rs4, s1lo, s1hi);
plot z4 = n4;
z4.hidebubble();

input Symbol5 = "ZZ";
def cls5 = close(Symbol5);
def rs5 = if isnan(cls5) then na else if cls_corr == 0 then na else cls5/cls_corr;
def n5 = normalizePlot(rs5, s1lo, s1hi);
plot z5 = n5;
z5.hidebubble();

input Symbol6 = "ZZ";
def cls6 = close(Symbol6);
def rs6 = if isnan(cls6) then na else if cls_corr == 0 then na else cls6/cls_corr;
def n6 = normalizePlot(rs6, s1lo, s1hi);
plot z6 = n6;
z6.hidebubble();

input Symbol7 = "ZZ";
def cls7 = close(Symbol7);
def rs7 = if isnan(cls7) then na else if cls_corr == 0 then na else cls7/cls_corr;
def n7 = normalizePlot(rs7, s1lo, s1hi);
plot z7 = n7;
z7.hidebubble();

input Symbol8 = "ZZ";
def cls8 = close(Symbol8);
def rs8 = if isnan(cls8) then na else if cls_corr == 0 then na else cls8/cls_corr;
def n8 = normalizePlot(rs8, s1lo, s1hi);
plot z8 = n8;
z8.hidebubble();

#------------------------------

# draw bubbles , to the right of last bar, with symbol name
input show_name_bubbles = yes;

def off = 5;
def x = show_name_bubbles and (!isnan(close[off]) and isnan(close[off-1]) );

addchartbubble(x, rs1[off], Symbol1_primary, z1.TakeValueColor(), yes);
addchartbubble(x, n2[off], Symbol2, z2.TakeValueColor(), yes);
addchartbubble(x, n3[off], Symbol3, z3.TakeValueColor(), yes);
addchartbubble(x, n4[off], Symbol4, z4.TakeValueColor(), yes);
addchartbubble(x, n5[off], Symbol5, z5.TakeValueColor(), yes);
addchartbubble(x, n6[off], Symbol6, z6.TakeValueColor(), yes);
addchartbubble(x, n7[off], Symbol7, z7.TakeValueColor(), yes);
addchartbubble(x, n8[off], Symbol8, z8.TakeValueColor(), yes);

#-----------------------------

input show_labels = yes;
addlabel(show_labels, " ", color.black);
addlabel(show_labels and !isnan(rs1), Symbol1_primary, z1.TakeValueColor());
addlabel(show_labels and !isnan(rs2), Symbol2, z2.TakeValueColor());
addlabel(show_labels and !isnan(rs3), Symbol3, z3.TakeValueColor());
addlabel(show_labels and !isnan(rs4), Symbol4, z4.TakeValueColor());
addlabel(show_labels and !isnan(rs5), Symbol5, z5.TakeValueColor());
addlabel(show_labels and !isnan(rs6), Symbol6, z6.TakeValueColor());
addlabel(show_labels and !isnan(rs7), Symbol7, z7.TakeValueColor());
addlabel(show_labels and !isnan(rs8), Symbol8, z8.TakeValueColor());

addlabel(show_labels, " ", color.black);
addlabel(show_labels, "RS of " + CorrelationWithSecurity, color.yellow);


def offc = off + 30;
def xc = (!isnan(close[offc]) and isnan(close[offc-1]) );
#def minc = min(rs1,min(rs2,min(rs3,min(rs4,min(rs5,min(rs6,min(rs7,rs8)))))));
# doesnt work, some values are na, so result is na
#def minc = min(n1,min(n2,min(n3,min(n4,min(n5,min(n6,min(n7,n8)))))));

input show_compare_stock_bubble = yes;
addchartbubble(show_compare_stock_bubble and xc, s1lo,
"Relative\nStrength\nof stocks\ncompared\nto  " + 
CorrelationWithSecurity + "\n" +
"chart is scaled\nto Stock1\n" + Symbol1_primary
, Color.yellow, yes);
#


input shrink_the_plots = yes;
def zoom_per = 0.9;
def ztop = s1hi * ( 1 + (zoom_per/100));
def zbot = s1lo * ( 1 - (zoom_per/100));
plot zzt = if shrink_the_plots then ztop else na;
plot zzb = if shrink_the_plots then zbot else na;
zzt.setdefaultcolor(color.black);
zzb.setdefaultcolor(color.black);
zzt.hidebubble();
zzb.hidebubble();


addchartbubble(0,0,
n1 + "\n" +
n2 + "\n" +
n3 + "\n" +
n4 + "\n" +
n5 + "\n" +
n6 + "\n" +
n7 + "\n" +
n8
, color.yellow, no);
#

IQ1gdlD.jpg
 
Thanks! I'll gave this a try
an updated version, that normalizes the RS's

this calculates the relative strength of a stock compared to another (default, SPY)
the first stock RS sets the size of the plots.
can enter up to 7 more stocks. they are scaled to the first stock.


Code:
# rs_normalize_compare_00

#https://usethinkscript.com/threads/normalized-scale-for-relative-strength-rs.12072/
# How can I normalize the stocks' RS ratios to compare them?

#==========================================

# compare_8stocks_rel_str_00
#https://usethinkscript.com/threads/a-chart-that-compares-relative-strength-against-spy.12637/
#UnAnswered A chart that compares relative strength against spy

declare lower;

def na = double.nan;

#=======================================

script normalizePlot {
  input data = close;
  input newRngMin = 0;
  input newRngMax = 100;
  def HHData = HighestAll(data);
  def LLData = LowestAll(data);
  plot nr = (((newRngMax - newRngMin)*(data - LLData))/(HHData - LLData)) + newRngMin;
}

#def a = normalizePlot(data, newmin, newmax);

#=======================================

input CorrelationWithSecurity = "SPY";
def cls_corr = close(CorrelationWithSecurity);
#plot RS = if close_corr == 0 then 0 else close / close_corr;
#RS.SetDefaultColor(GetColor(6));
#def sr = CompoundValue("historical data" = RS, "visible data" = if IsNaN(sr[1]) then RS else sr[1]);
#plot SRatio =  sr;
#SRatio.SetDefaultColor(GetColor(5));

#----------------

# symbol1 is the main stock.
# all others will be scaled to stock1 data
# use symbol  ZZ  for non entries

input Symbol1_primary = "AAPL";
#hint Symbol1_primary: This stock determines the min and max boundries. the other stocks will be scaled to be within the limits of this stock. This symbol needs to be entered.

def cls1 = close(Symbol1_primary);
def rs1 = if isnan(cls1) then na else if cls_corr == 0 then na else cls1/cls_corr;
def n1 = rs1;
plot z1 = n1;
z1.hidebubble();

def s1hi = highestall(rs1);
def s1lo = lowestall(rs1);
def s1rng = s1hi - s1lo;

input show_upper_lower_lines = yes;
plot s1top = if show_upper_lower_lines and !isnan(close) then s1hi else na;
plot s1bot = if show_upper_lower_lines and !isnan(close) then s1lo else na;
s1top.setdefaultcolor(color.gray);
s1bot.setdefaultcolor(color.gray);
s1top.hidebubble();
s1bot.hidebubble();


#---------------------------
#def a = normalizePlot(data, newmin, newmax);

input Symbol2 = "MSFT";
#hint symbol2: Enter a stock symbol for any of the symbols 2 to 8. \nIf you don't want to enter a stock, use ZZ.
def cls2 = close(Symbol2);
#def rs2 = if cls_corr == 0 then 0 else cls2/cls_corr;
def rs2 = if isnan(cls2) then na else if cls_corr == 0 then na else cls2/cls_corr;
def n2 = normalizePlot(rs2, s1lo, s1hi);
plot z2 = n2;
z2.hidebubble();

input Symbol3 = "WMT";
def cls3 = close(Symbol3);
def rs3 = if isnan(cls3) then na else if cls_corr == 0 then na else cls3/cls_corr;
def n3 = normalizePlot(rs3, s1lo, s1hi);
plot z3 = n3;
z3.hidebubble();

input Symbol4 = "ZZ";
def cls4 = close(Symbol4);
def rs4 = if isnan(cls4) then na else if cls_corr == 0 then na else cls4/cls_corr;
def n4 = normalizePlot(rs4, s1lo, s1hi);
plot z4 = n4;
z4.hidebubble();

input Symbol5 = "ZZ";
def cls5 = close(Symbol5);
def rs5 = if isnan(cls5) then na else if cls_corr == 0 then na else cls5/cls_corr;
def n5 = normalizePlot(rs5, s1lo, s1hi);
plot z5 = n5;
z5.hidebubble();

input Symbol6 = "ZZ";
def cls6 = close(Symbol6);
def rs6 = if isnan(cls6) then na else if cls_corr == 0 then na else cls6/cls_corr;
def n6 = normalizePlot(rs6, s1lo, s1hi);
plot z6 = n6;
z6.hidebubble();

input Symbol7 = "ZZ";
def cls7 = close(Symbol7);
def rs7 = if isnan(cls7) then na else if cls_corr == 0 then na else cls7/cls_corr;
def n7 = normalizePlot(rs7, s1lo, s1hi);
plot z7 = n7;
z7.hidebubble();

input Symbol8 = "ZZ";
def cls8 = close(Symbol8);
def rs8 = if isnan(cls8) then na else if cls_corr == 0 then na else cls8/cls_corr;
def n8 = normalizePlot(rs8, s1lo, s1hi);
plot z8 = n8;
z8.hidebubble();

#------------------------------

# draw bubbles , to the right of last bar, with symbol name
input show_name_bubbles = yes;

def off = 5;
def x = show_name_bubbles and (!isnan(close[off]) and isnan(close[off-1]) );

addchartbubble(x, rs1[off], Symbol1_primary, z1.TakeValueColor(), yes);
addchartbubble(x, n2[off], Symbol2, z2.TakeValueColor(), yes);
addchartbubble(x, n3[off], Symbol3, z3.TakeValueColor(), yes);
addchartbubble(x, n4[off], Symbol4, z4.TakeValueColor(), yes);
addchartbubble(x, n5[off], Symbol5, z5.TakeValueColor(), yes);
addchartbubble(x, n6[off], Symbol6, z6.TakeValueColor(), yes);
addchartbubble(x, n7[off], Symbol7, z7.TakeValueColor(), yes);
addchartbubble(x, n8[off], Symbol8, z8.TakeValueColor(), yes);

#-----------------------------

input show_labels = yes;
addlabel(show_labels, " ", color.black);
addlabel(show_labels and !isnan(rs1), Symbol1_primary, z1.TakeValueColor());
addlabel(show_labels and !isnan(rs2), Symbol2, z2.TakeValueColor());
addlabel(show_labels and !isnan(rs3), Symbol3, z3.TakeValueColor());
addlabel(show_labels and !isnan(rs4), Symbol4, z4.TakeValueColor());
addlabel(show_labels and !isnan(rs5), Symbol5, z5.TakeValueColor());
addlabel(show_labels and !isnan(rs6), Symbol6, z6.TakeValueColor());
addlabel(show_labels and !isnan(rs7), Symbol7, z7.TakeValueColor());
addlabel(show_labels and !isnan(rs8), Symbol8, z8.TakeValueColor());

addlabel(show_labels, " ", color.black);
addlabel(show_labels, "RS of " + CorrelationWithSecurity, color.yellow);


def offc = off + 30;
def xc = (!isnan(close[offc]) and isnan(close[offc-1]) );
#def minc = min(rs1,min(rs2,min(rs3,min(rs4,min(rs5,min(rs6,min(rs7,rs8)))))));
# doesnt work, some values are na, so result is na
#def minc = min(n1,min(n2,min(n3,min(n4,min(n5,min(n6,min(n7,n8)))))));

input show_compare_stock_bubble = yes;
addchartbubble(show_compare_stock_bubble and xc, s1lo,
"Relative\nStrength\nof stocks\ncompared\nto  " +
CorrelationWithSecurity + "\n" +
"chart is scaled\nto Stock1\n" + Symbol1_primary
, Color.yellow, yes);
#


input shrink_the_plots = yes;
def zoom_per = 0.9;
def ztop = s1hi * ( 1 + (zoom_per/100));
def zbot = s1lo * ( 1 - (zoom_per/100));
plot zzt = if shrink_the_plots then ztop else na;
plot zzb = if shrink_the_plots then zbot else na;
zzt.setdefaultcolor(color.black);
zzb.setdefaultcolor(color.black);
zzt.hidebubble();
zzb.hidebubble();


addchartbubble(0,0,
n1 + "\n" +
n2 + "\n" +
n3 + "\n" +
n4 + "\n" +
n5 + "\n" +
n6 + "\n" +
n7 + "\n" +
n8
, color.yellow, no);
#

IQ1gdlD.jpg
HI, is there a way we could have a scan for this ?
Thanks.
 

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