• Get $30 off VIP with code SUMMER30. Ends July 27. Happy trading!

Phoenix Finder Trend Strength Indicator for ThinkorSwim

cos251

Well-known member
Fresh version of the Phoenix Finder indicator for ThinkorSwim. Plots candles for 14 stocks based on Phoenix Strength. It can help track stocks in a specific sector and identify trends based on Phoenix Strength and overall conditions. Per request from @ace_wheelie

Found via Simpler Trading: https://simpler-trading.helpscoutdocs.com/article/905-how-to-set-up-phoenix-finder-trend-strength-watchlist

R13YdDd.png


Version 1.1 of the code:

Code:
#START OF Ticker Tracker for Thinkorswim
#
#CHANGELOG
# 2021.04.06 V1.1 @cos251 - Add matching trend color to ticker label per request from @air226rider
# 2020.12.21 V1.0 @cos251 - Created script to show candles based on strength formulate in lower study for 14
#                         - tickers at once
#                         - tickers can be selected in settings
#
#CREDITS
# Requested by @ace_wheelie
#
#LINK
# https://usethinkscript.com/threads/ttm-squeeze-fire-signal-another-take.4301/
# https://usethinkscript.com/threads/salty-phoenix-finder.4924/


declare lower;

input symbol1 = "QQQ";
input symbol2 = "SPY";
input symbol3 = "AAPL";
input symbol4 = "MSFT";
input symbol5 = "PLUG";
input symbol6 = "TSLA";
input symbol7 = "GOOG";
input symbol8 = "CRM";
input symbol9 = "NIO";
input symbol10 = "SNAP";
input symbol11 = "PTON";
input symbol12 = "ZM";
input symbol13 = "FSLY";
input symbol14 = "AMD";
def symbol1Signal = 1;
def symbol2Signal = 2;
def symbol3Signal = 3;
def symbol4Signal = 4;
def symbol5Signal = 5;
def symbol6Signal = 6;
def symbol7Signal = 7;
def symbol8Signal = 8;
def symbol9Signal = 9;
def symbol10Signal = 10;
def symbol11Signal = 11;
def symbol12Signal = 12;
def symbol13Signal = 13;
def symbol14Signal = 14;
plot break155 = 15.5;
plot break145 = 14.5;
plot break135 = 13.5;
plot break125 = 12.5;
plot break115 = 11.5;
plot break105 = 10.5;
plot break95 = 9.5;
plot break85 = 8.5;
plot break75 = 7.5;
plot break65 = 6.5;
plot break55 = 5.5;
plot break45 = 4.5;
plot break35 = 3.5;
plot break25 = 2.5;
plot break15 = 1.5;
break155.HideBubble();
break145.HideBubble();
break135.HideBubble();
break125.HideBubble();
break115.HideBubble();
break105.HideBubble();
break95.HideBubble();
break85.HideBubble();
break75.HideBubble();
break65.HideBubble();
break55.HideBubble();
break45.HideBubble();
break35.HideBubble();
break25.HideBubble();
break15.HideBubble();
break155.HideBubble();
break145.HideBubble();
break135.HideTitle();
break125.HideTitle();
break115.HideTitle();
break105.HideTitle();
break95.HideTitle();
break85.HideTitle();
break75.HideTitle();
break65.HideTitle();
break55.HideTitle();
break45.HideTitle();
break35.HideTitle();
break25.HideTitle();
break15.HideTitle();
break155.SetDefaultColor(Color.GRAY);
break145.SetDefaultColor(Color.GRAY);
break135.SetDefaultColor(Color.GRAY);
break125.SetDefaultColor(Color.GRAY);
break115.SetDefaultColor(Color.GRAY);
break105.SetDefaultColor(Color.GRAY);
break95.SetDefaultColor(Color.GRAY);
break85.SetDefaultColor(Color.GRAY);
break75.SetDefaultColor(Color.GRAY);
break65.SetDefaultColor(Color.GRAY);
break55.SetDefaultColor(Color.GRAY);
break45.SetDefaultColor(Color.GRAY);
break35.SetDefaultColor(Color.GRAY);
break25.SetDefaultColor(Color.GRAY);
break15.SetDefaultColor(Color.GRAY);


def x = -5;
def y = -2;
def Length1 = 5;
def Length2 = 8;
def Length3 = 13;
def Length4 = 21;
def Length5 = 34;   


################## -----------  SYMBOL #1
def ema1Symbol1 = expAverage(close(symbol1), Length1);
def ema2Symbol1 = expAverage(close(symbol1), Length2);
def ema3Symbol1 = expAverage(close(symbol1), Length3);
def ema4Symbol1 = expAverage(close(symbol1), Length4);

def u1Symbol1 = ema1Symbol1 > ema2Symbol1;
def u2Symbol1 = ema2Symbol1 > ema3Symbol1;
def u3Symbol1 = ema3Symbol1 > ema4Symbol1;

def d1Symbol1 = ema1Symbol1 < ema2Symbol1;
def d2Symbol1 = ema2Symbol1 < ema3Symbol1;
def d3Symbol1 = ema3Symbol1 < ema4Symbol1;

def trendStrengthSymbol1 = if (u1Symbol1 and u2Symbol1 and u3Symbol1) then 2 else if (u1Symbol1 and u2Symbol1 and !u3Symbol1) then 1 else if (d1Symbol1 and d2Symbol1 and d3Symbol1) then -2 else if (d1Symbol1 and d2Symbol1 and !d3Symbol1) then -1 else 0;

plot Symbol1Plot1 = if trendStrengthSymbol1 == 2 then symbol1Signal else Double.NaN;
Symbol1Plot1.SetPaintingStrategy(PaintingStrategy.LINE_VS_SQUARES);
Symbol1Plot1.SetLineWeight(3);
Symbol1Plot1.AssignValueColor(COLOR.GREEN);
plot Symbol1Plot2 = if trendStrengthSymbol1 == 1 then symbol1Signal else Double.NaN;
Symbol1Plot2.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
Symbol1Plot2.SetLineWeight(3);
Symbol1Plot2.AssignValueColor(COLOR.DARK_GREEN);
plot Symbol1Plot3 = if trendStrengthSymbol1 == -2 then symbol1Signal else Double.NaN;
Symbol1Plot3.SetPaintingStrategy(PaintingStrategy.LINE_VS_SQUARES);
Symbol1Plot3.SetLineWeight(3);
Symbol1Plot3.AssignValueColor(COLOR.RED);
plot Symbol1Plot4 = if trendStrengthSymbol1 == -1 then symbol1Signal else Double.NaN;
Symbol1Plot4.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
Symbol1Plot4.SetLineWeight(3);
Symbol1Plot4.AssignValueColor(COLOR.DARK_RED);
plot Symbol1Plot5 = if trendStrengthSymbol1 == 0 then symbol1Signal else Double.NaN;
Symbol1Plot5.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
Symbol1Plot5.SetLineWeight(3);
Symbol1Plot5.AssignValueColor(COLOR.YELLOW);
Symbol1Plot1.HideTitle();
Symbol1Plot2.HideTitle();
Symbol1Plot3.HideTitle();
Symbol1Plot4.HideTitle();
Symbol1Plot5.HideTitle();
def highestBarSymbol1 = HighestAll( if IsNaN(close) then Double.NaN else barNumber() );
def referenceBarSymbol1 = highestBarSymbol1 - x;
AddChartBubble( barNumber() == referenceBarSymbol1,symbol1Signal,"1:"+symbol1,if trendStrengthSymbol1[5] == 2 then Color.GREEN else if trendStrengthSymbol1[5] == 1then Color.DARK_GRAY else if trendStrengthSymbol1[5] == -2 then Color.RED else if trendStrengthSymbol1[5] == -1 then Color.DARK_RED else if trendStrengthSymbol1[5] == 0 then Color.YELLOW else Color.GRAY,yes);
AddLabel(yes,trendStrengthSymbol1);




################## -----------  SYMBOL #2
def ema1Symbol2 = expAverage(close(symbol2), Length1);
def ema2Symbol2 = expAverage(close(symbol2), Length2);
def ema3Symbol2 = expAverage(close(symbol2), Length3);
def ema4Symbol2 = expAverage(close(symbol2), Length4);

def u1Symbol2 = ema1Symbol2 > ema2Symbol2;
def u2Symbol2 = ema2Symbol2 > ema3Symbol2;
def u3Symbol2 = ema3Symbol2 > ema4Symbol2;

def d1Symbol2 = ema1Symbol2 < ema2Symbol2;
def d2Symbol2 = ema2Symbol2 < ema3Symbol2;
def d3Symbol2 = ema3Symbol2 < ema4Symbol2;

def trendStrengthSymbol2 = if (u1Symbol2 and u2Symbol2 and u3Symbol2) then 2 else if (u1Symbol2 and u2Symbol2 and !u3Symbol2) then 1 else if (d1Symbol2 and d2Symbol2 and d3Symbol2) then -2 else if (d1Symbol2 and d2Symbol2 and !d3Symbol2) then -1 else 0;

plot Symbol2Plot1 = if trendStrengthSymbol2 == 2 then symbol2Signal else Double.NaN;
Symbol2Plot1.SetPaintingStrategy(PaintingStrategy.LINE_VS_SQUARES);
Symbol2Plot1.SetLineWeight(3);
Symbol2Plot1.AssignValueColor(COLOR.GREEN);
plot Symbol2Plot2 = if trendStrengthSymbol2 == 1 then symbol2Signal else Double.NaN;
Symbol2Plot2.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
Symbol2Plot2.SetLineWeight(3);
Symbol2Plot2.AssignValueColor(COLOR.DARK_GREEN);
plot Symbol2Plot3 = if trendStrengthSymbol2 == -2 then symbol2Signal else Double.NaN;
Symbol2Plot3.SetPaintingStrategy(PaintingStrategy.LINE_VS_SQUARES);
Symbol2Plot3.SetLineWeight(3);
Symbol2Plot3.AssignValueColor(COLOR.RED);
plot Symbol2Plot4 = if trendStrengthSymbol2 == -1 then symbol2Signal else Double.NaN;
Symbol2Plot4.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
Symbol2Plot4.SetLineWeight(3);
Symbol2Plot4.AssignValueColor(COLOR.DARK_RED);
plot Symbol2Plot5 = if trendStrengthSymbol2 == 0 then symbol2Signal else Double.NaN;
Symbol2Plot5.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
Symbol2Plot5.SetLineWeight(3);
Symbol2Plot5.AssignValueColor(Color.YELLOW);
Symbol2Plot1.HideTitle();
Symbol2Plot2.HideTitle();
Symbol2Plot3.HideTitle();
Symbol2Plot4.HideTitle();
Symbol2Plot5.HideTitle();
def highestBarSymbol2 = HighestAll( if IsNaN(close) then Double.NaN else barNumber() );
def referenceBarSymbol2 = highestBarSymbol2 - y;
AddChartBubble( barNumber() == referenceBarSymbol2,symbol2Signal,"2:"+symbol2,if trendStrengthSymbol2[2] == 2 then Color.GREEN else if trendStrengthSymbol2[2] == 1then Color.DARK_GRAY else if trendStrengthSymbol2[2] == -2 then Color.RED else if trendStrengthSymbol2[2] == -1 then Color.DARK_RED else if trendStrengthSymbol2[2] == 0 then Color.YELLOW else Color.GRAY,yes);




################## -----------  SYMBOL #3
def ema1Symbol3 = expAverage(close(symbol3), Length1);
def ema2Symbol3 = expAverage(close(symbol3), Length2);
def ema3Symbol3 = expAverage(close(symbol3), Length3);
def ema4Symbol3 = expAverage(close(symbol3), Length4);

def u1Symbol3 = ema1Symbol3 > ema2Symbol3;
def u2Symbol3 = ema2Symbol3 > ema3Symbol3;
def u3Symbol3 = ema3Symbol3 > ema4Symbol3;

def d1Symbol3 = ema1Symbol3 < ema2Symbol3;
def d2Symbol3 = ema2Symbol3 < ema3Symbol3;
def d3Symbol3 = ema3Symbol3 < ema4Symbol3;

def trendStrengthSymbol3 = if (u1Symbol3 and u2Symbol3 and u3Symbol3) then 2 else if (u1Symbol3 and u2Symbol3 and !u3Symbol3) then 1 else if (d1Symbol3 and d2Symbol3 and d3Symbol3) then -2 else if (d1Symbol3 and d2Symbol3 and !d3Symbol3) then -1 else 0;

plot Symbol3Plot1 = if trendStrengthSymbol3 == 2 then symbol3Signal else Double.NaN;
Symbol3Plot1.SetPaintingStrategy(PaintingStrategy.LINE_VS_SQUARES);
Symbol3Plot1.SetLineWeight(3);
Symbol3Plot1.AssignValueColor(COLOR.GREEN);
plot Symbol3Plot2 = if trendStrengthSymbol3 == 1 then symbol3Signal else Double.NaN;
Symbol3Plot2.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
Symbol3Plot2.SetLineWeight(3);
Symbol3Plot2.AssignValueColor(COLOR.DARK_GREEN);
plot Symbol3Plot3 = if trendStrengthSymbol3 == -2 then symbol3Signal else Double.NaN;
Symbol3Plot3.SetPaintingStrategy(PaintingStrategy.LINE_VS_SQUARES);
Symbol3Plot3.SetLineWeight(3);
Symbol3Plot3.AssignValueColor(COLOR.RED);
plot Symbol3Plot4 = if trendStrengthSymbol3 == -1 then symbol3Signal else Double.NaN;
Symbol3Plot4.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
Symbol3Plot4.SetLineWeight(3);
Symbol3Plot4.AssignValueColor(COLOR.DARK_RED);
plot Symbol3Plot5 = if trendStrengthSymbol3 == 0 then symbol3Signal else Double.NaN;
Symbol3Plot5.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
Symbol3Plot5.SetLineWeight(3);
Symbol3Plot5.AssignValueColor(COLOR.YELLOW);
Symbol3Plot1.HideTitle();
Symbol3Plot2.HideTitle();
Symbol3Plot3.HideTitle();
Symbol3Plot4.HideTitle();
Symbol3Plot5.HideTitle();
def highestBarSymbol3 = HighestAll( if IsNaN(close) then Double.NaN else barNumber() );
def referenceBarSymbol3 = highestBarSymbol3 - x;
AddChartBubble( barNumber() == referenceBarSymbol3,symbol3Signal,"3:"+symbol3,if trendStrengthSymbol3[5] == 2 then Color.GREEN else if trendStrengthSymbol3[5] == 1then Color.DARK_GRAY else if trendStrengthSymbol3[5] == -2 then Color.RED else if trendStrengthSymbol3[5] == -1 then Color.DARK_RED else if trendStrengthSymbol3[5] == 0 then Color.YELLOW else Color.GRAY);



################## -----------  SYMBOL #4
def ema1Symbol4 = expAverage(close(symbol4), Length1);
def ema2Symbol4 = expAverage(close(symbol4), Length2);
def ema3Symbol4 = expAverage(close(symbol4), Length3);
def ema4Symbol4 = expAverage(close(symbol4), Length4);

def u1Symbol4 = ema1Symbol4 > ema2Symbol4;
def u2Symbol4 = ema2Symbol4 > ema3Symbol4;
def u3Symbol4 = ema3Symbol4 > ema4Symbol4;

def d1Symbol4 = ema1Symbol4 < ema2Symbol4;
def d2Symbol4 = ema2Symbol4 < ema3Symbol4;
def d3Symbol4 = ema3Symbol4 < ema4Symbol4;

def trendStrengthSymbol4 = if (u1Symbol4 and u2Symbol4 and u3Symbol4) then 2 else if (u1Symbol4 and u2Symbol4 and !u3Symbol4) then 1 else if (d1Symbol4 and d2Symbol4 and d3Symbol4) then -2 else if (d1Symbol4 and d2Symbol4 and !d3Symbol4) then -1 else 0;

plot Symbol4Plot1 = if trendStrengthSymbol4 == 2 then symbol4Signal else Double.NaN;
Symbol4Plot1.SetPaintingStrategy(PaintingStrategy.LINE_VS_SQUARES);
Symbol4Plot1.SetLineWeight(3);
Symbol4Plot1.AssignValueColor(COLOR.GREEN);
plot Symbol4Plot2 = if trendStrengthSymbol4 == 1 then symbol4Signal else Double.NaN;
Symbol4Plot2.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
Symbol4Plot2.SetLineWeight(3);
Symbol4Plot2.AssignValueColor(COLOR.DARK_GREEN);
plot Symbol4Plot3 = if trendStrengthSymbol4 == -2 then symbol4Signal else Double.NaN;
Symbol4Plot3.SetPaintingStrategy(PaintingStrategy.LINE_VS_SQUARES);
Symbol4Plot3.SetLineWeight(3);
Symbol4Plot3.AssignValueColor(COLOR.RED);
plot Symbol4Plot4 = if trendStrengthSymbol4 == -1 then symbol4Signal else Double.NaN;
Symbol4Plot4.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
Symbol4Plot4.SetLineWeight(3);
Symbol4Plot4.AssignValueColor(COLOR.DARK_RED);
plot Symbol4Plot5 = if trendStrengthSymbol4 == 0 then symbol4Signal else Double.NaN;
Symbol4Plot5.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
Symbol4Plot5.SetLineWeight(3);
Symbol4Plot5.AssignValueColor(COLOR.YELLOW);
Symbol4Plot1.HideTitle();
Symbol4Plot2.HideTitle();
Symbol4Plot3.HideTitle();
Symbol4Plot4.HideTitle();
Symbol4Plot5.HideTitle();
def highestBarSymbol4 = HighestAll( if IsNaN(close) then Double.NaN else barNumber() );
def referenceBarSymbol4 = highestBarSymbol4 - y;
AddChartBubble( barNumber() == referenceBarSymbol4,symbol4Signal,"4:"+symbol4,if trendStrengthSymbol4[2] == 2 then Color.GREEN else if trendStrengthSymbol4[2] == 1then Color.DARK_GRAY else if trendStrengthSymbol4[2] == -2 then Color.RED else if trendStrengthSymbol4[2] == -1 then Color.DARK_RED else if trendStrengthSymbol4[2] == 0 then Color.YELLOW else Color.GRAY,yes);




################## -----------  SYMBOL #5
def ema1Symbol5 = expAverage(close(symbol5), Length1);
def ema2Symbol5 = expAverage(close(symbol5), Length2);
def ema3Symbol5 = expAverage(close(symbol5), Length3);
def ema4Symbol5 = expAverage(close(symbol5), Length4);

def u1Symbol5 = ema1Symbol5 > ema2Symbol5;
def u2Symbol5 = ema2Symbol5 > ema3Symbol5;
def u3Symbol5 = ema3Symbol5 > ema4Symbol5;

def d1Symbol5 = ema1Symbol5 < ema2Symbol5;
def d2Symbol5 = ema2Symbol5 < ema3Symbol5;
def d3Symbol5 = ema3Symbol5 < ema4Symbol5;

def trendStrengthSymbol5 = if (u1Symbol5 and u2Symbol5 and u3Symbol5) then 2 else if (u1Symbol5 and u2Symbol5 and !u3Symbol5) then 1 else if (d1Symbol5 and d2Symbol5 and d3Symbol5) then -2 else if (d1Symbol5 and d2Symbol5 and !d3Symbol5) then -1 else 0;

plot Symbol5Plot1 = if trendStrengthSymbol5 == 2 then symbol5Signal else Double.NaN;
Symbol5Plot1.SetPaintingStrategy(PaintingStrategy.LINE_VS_SQUARES);
Symbol5Plot1.SetLineWeight(3);
Symbol5Plot1.AssignValueColor(COLOR.GREEN);
plot Symbol5Plot2 = if trendStrengthSymbol5 == 1 then symbol5Signal else Double.NaN;
Symbol5Plot2.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
Symbol5Plot2.SetLineWeight(3);
Symbol5Plot2.AssignValueColor(COLOR.DARK_GREEN);
plot Symbol5Plot3 = if trendStrengthSymbol5 == -2 then symbol5Signal else Double.NaN;
Symbol5Plot3.SetPaintingStrategy(PaintingStrategy.LINE_VS_SQUARES);
Symbol5Plot3.SetLineWeight(3);
Symbol5Plot3.AssignValueColor(COLOR.RED);
plot Symbol5Plot4 = if trendStrengthSymbol5 == -1 then symbol5Signal else Double.NaN;
Symbol5Plot4.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
Symbol5Plot4.SetLineWeight(3);
Symbol5Plot4.AssignValueColor(COLOR.DARK_RED);
plot Symbol5Plot5 = if trendStrengthSymbol5 == 0 then symbol5Signal else Double.NaN;
Symbol5Plot5.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
Symbol5Plot5.SetLineWeight(3);
Symbol5Plot5.AssignValueColor(COLOR.YELLOW);
Symbol5Plot1.HideTitle();
Symbol5Plot2.HideTitle();
Symbol5Plot3.HideTitle();
Symbol5Plot4.HideTitle();
Symbol5Plot5.HideTitle();
def highestBarSymbol5 = HighestAll( if IsNaN(close) then Double.NaN else barNumber() );
def referenceBarSymbol5 = highestBarSymbol5 - x;
AddChartBubble( barNumber() == referenceBarSymbol5,symbol5Signal,"5:"+symbol5,if trendStrengthSymbol5[5] == 2 then Color.GREEN else if trendStrengthSymbol5[5] == 1then Color.DARK_GRAY else if trendStrengthSymbol5[5] == -2 then Color.RED else if trendStrengthSymbol5[5] == -1 then Color.DARK_RED else if trendStrengthSymbol5[5] == 0 then Color.YELLOW else if IsNaN(trendStrengthSymbol5[5]) then Color.WHITE else Color.GRAY);
AddLabel(yes,trendStrengthSymbol5);


################## -----------  SYMBOL #6
def ema1Symbol6 = expAverage(close(symbol6), Length1);
def ema2Symbol6 = expAverage(close(symbol6), Length2);
def ema3Symbol6 = expAverage(close(symbol6), Length3);
def ema4Symbol6 = expAverage(close(symbol6), Length4);

def u1Symbol6 = ema1Symbol6 > ema2Symbol6;
def u2Symbol6 = ema2Symbol6 > ema3Symbol6;
def u3Symbol6 = ema3Symbol6 > ema4Symbol6;

def d1Symbol6 = ema1Symbol6 < ema2Symbol6;
def d2Symbol6 = ema2Symbol6 < ema3Symbol6;
def d3Symbol6 = ema3Symbol6 < ema4Symbol6;

def trendStrengthSymbol6 = if (u1Symbol6 and u2Symbol6 and u3Symbol6) then 2 else if (u1Symbol6 and u2Symbol6 and !u3Symbol6) then 1 else if (d1Symbol6 and d2Symbol6 and d3Symbol6) then -2 else if (d1Symbol6 and d2Symbol6 and !d3Symbol6) then -1 else 0;

plot Symbol6Plot1 = if trendStrengthSymbol6 == 2 then symbol6Signal else Double.NaN;
Symbol6Plot1.SetPaintingStrategy(PaintingStrategy.LINE_VS_SQUARES);
Symbol6Plot1.SetLineWeight(3);
Symbol6Plot1.AssignValueColor(COLOR.GREEN);
plot Symbol6Plot2 = if trendStrengthSymbol6 == 1 then symbol6Signal else Double.NaN;
Symbol6Plot2.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
Symbol6Plot2.SetLineWeight(3);
Symbol6Plot2.AssignValueColor(COLOR.DARK_GREEN);
plot Symbol6Plot3 = if trendStrengthSymbol6 == -2 then symbol6Signal else Double.NaN;
Symbol6Plot3.SetPaintingStrategy(PaintingStrategy.LINE_VS_SQUARES);
Symbol6Plot3.SetLineWeight(3);
Symbol6Plot3.AssignValueColor(COLOR.RED);
plot Symbol6Plot4 = if trendStrengthSymbol6 == -1 then symbol6Signal else Double.NaN;
Symbol6Plot4.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
Symbol6Plot4.SetLineWeight(3);
Symbol6Plot4.AssignValueColor(COLOR.DARK_RED);
plot Symbol6Plot5 = if trendStrengthSymbol6 == 0 then symbol6Signal else Double.NaN;
Symbol6Plot5.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
Symbol6Plot5.SetLineWeight(3);
Symbol6Plot5.AssignValueColor(COLOR.YELLOW);
Symbol6Plot1.HideTitle();
Symbol6Plot2.HideTitle();
Symbol6Plot3.HideTitle();
Symbol6Plot4.HideTitle();
Symbol6Plot5.HideTitle();
def highestBarSymbol6 = HighestAll( if IsNaN(close) then Double.NaN else barNumber() );
def referenceBarSymbol6 = highestBarSymbol6 - y;
AddChartBubble( barNumber() == referenceBarSymbol6,symbol6Signal,"6:"+symbol6,if trendStrengthSymbol6[2] == 2 then Color.GREEN else if trendStrengthSymbol6[2] == 1then Color.DARK_GRAY else if trendStrengthSymbol6[2] == -2 then Color.RED else if trendStrengthSymbol6[2] == -1 then Color.DARK_RED else if trendStrengthSymbol6[2] == 0 then Color.YELLOW else Color.GRAY,yes);



################## -----------  SYMBOL #7
def ema1Symbol7 = expAverage(close(symbol7), Length1);
def ema2Symbol7 = expAverage(close(symbol7), Length2);
def ema3Symbol7 = expAverage(close(symbol7), Length3);
def ema4Symbol7 = expAverage(close(symbol7), Length4);

def u1Symbol7 = ema1Symbol7 > ema2Symbol7;
def u2Symbol7 = ema2Symbol7 > ema3Symbol7;
def u3Symbol7 = ema3Symbol7 > ema4Symbol7;

def d1Symbol7 = ema1Symbol7 < ema2Symbol7;
def d2Symbol7 = ema2Symbol7 < ema3Symbol7;
def d3Symbol7 = ema3Symbol7 < ema4Symbol7;

def trendStrengthSymbol7 = if (u1Symbol7 and u2Symbol7 and u3Symbol7) then 2 else if (u1Symbol7 and u2Symbol7 and !u3Symbol7) then 1 else if (d1Symbol7 and d2Symbol7 and d3Symbol7) then -2 else if (d1Symbol7 and d2Symbol7 and !d3Symbol7) then -1 else 0;

plot Symbol7Plot1 = if trendStrengthSymbol7 == 2 then symbol7Signal else Double.NaN;
Symbol7Plot1.SetPaintingStrategy(PaintingStrategy.LINE_VS_SQUARES);
Symbol7Plot1.SetLineWeight(3);
Symbol7Plot1.AssignValueColor(COLOR.GREEN);
plot Symbol7Plot2 = if trendStrengthSymbol7 == 1 then symbol7Signal else Double.NaN;
Symbol7Plot2.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
Symbol7Plot2.SetLineWeight(3);
Symbol7Plot2.AssignValueColor(COLOR.DARK_GREEN);
plot Symbol7Plot3 = if trendStrengthSymbol7 == -2 then symbol7Signal else Double.NaN;
Symbol7Plot3.SetPaintingStrategy(PaintingStrategy.LINE_VS_SQUARES);
Symbol7Plot3.SetLineWeight(3);
Symbol7Plot3.AssignValueColor(COLOR.RED);
plot Symbol7Plot4 = if trendStrengthSymbol7 == -1 then symbol7Signal else Double.NaN;
Symbol7Plot4.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
Symbol7Plot4.SetLineWeight(3);
Symbol7Plot4.AssignValueColor(COLOR.DARK_RED);
plot Symbol7Plot5 = if trendStrengthSymbol7 == 0 then symbol7Signal else Double.NaN;
Symbol7Plot5.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
Symbol7Plot5.SetLineWeight(3);
Symbol7Plot5.AssignValueColor(COLOR.YELLOW);
Symbol7Plot1.HideTitle();
Symbol7Plot2.HideTitle();
Symbol7Plot3.HideTitle();
Symbol7Plot4.HideTitle();
Symbol7Plot5.HideTitle();
def highestBarSymbol7 = HighestAll( if IsNaN(close) then Double.NaN else barNumber() );
def referenceBarSymbol7 = highestBarSymbol7 - x;
AddChartBubble( barNumber() == referenceBarSymbol7,symbol7Signal,"7:"+symbol7,if trendStrengthSymbol7[5] == 2 then Color.GREEN else if trendStrengthSymbol7[5] == 1then Color.DARK_GRAY else if trendStrengthSymbol7[5] == -2 then Color.RED else if trendStrengthSymbol7[5] == -1 then Color.DARK_RED else if trendStrengthSymbol7[5] == 0 then Color.YELLOW else Color.GRAY,yes);



################## -----------  SYMBOL #8
def ema1Symbol8 = expAverage(close(symbol8), Length1);
def ema2Symbol8 = expAverage(close(symbol8), Length2);
def ema3Symbol8 = expAverage(close(symbol8), Length3);
def ema4Symbol8 = expAverage(close(symbol8), Length4);

def u1Symbol8 = ema1Symbol8 > ema2Symbol8;
def u2Symbol8 = ema2Symbol8 > ema3Symbol8;
def u3Symbol8 = ema3Symbol8 > ema4Symbol8;

def d1Symbol8 = ema1Symbol8 < ema2Symbol8;
def d2Symbol8 = ema2Symbol8 < ema3Symbol8;
def d3Symbol8 = ema3Symbol8 < ema4Symbol8;

def trendStrengthSymbol8 = if (u1Symbol8 and u2Symbol8 and u3Symbol8) then 2 else if (u1Symbol8 and u2Symbol8 and !u3Symbol8) then 1 else if (d1Symbol8 and d2Symbol8 and d3Symbol8) then -2 else if (d1Symbol8 and d2Symbol8 and !d3Symbol8) then -1 else 0;

plot Symbol8Plot1 = if trendStrengthSymbol8 == 2 then symbol8Signal else Double.NaN;
Symbol8Plot1.SetPaintingStrategy(PaintingStrategy.LINE_VS_SQUARES);
Symbol8Plot1.SetLineWeight(3);
Symbol8Plot1.AssignValueColor(COLOR.GREEN);
plot Symbol8Plot2 = if trendStrengthSymbol8 == 1 then symbol8Signal else Double.NaN;
Symbol8Plot2.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
Symbol8Plot2.SetLineWeight(3);
Symbol8Plot2.AssignValueColor(COLOR.DARK_GREEN);
plot Symbol8Plot3 = if trendStrengthSymbol8 == -2 then symbol8Signal else Double.NaN;
Symbol8Plot3.SetPaintingStrategy(PaintingStrategy.LINE_VS_SQUARES);
Symbol8Plot3.SetLineWeight(3);
Symbol8Plot3.AssignValueColor(COLOR.RED);
plot Symbol8Plot4 = if trendStrengthSymbol8 == -1 then symbol8Signal else Double.NaN;
Symbol8Plot4.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
Symbol8Plot4.SetLineWeight(3);
Symbol8Plot4.AssignValueColor(COLOR.DARK_RED);
plot Symbol8Plot5 = if trendStrengthSymbol8 == 0 then symbol8Signal else Double.NaN;
Symbol8Plot5.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
Symbol8Plot5.SetLineWeight(3);
Symbol8Plot5.AssignValueColor(COLOR.YELLOW);
Symbol8Plot1.HideTitle();
Symbol8Plot2.HideTitle();
Symbol8Plot3.HideTitle();
Symbol8Plot4.HideTitle();
Symbol8Plot5.HideTitle();
def highestBarSymbol8 = HighestAll( if IsNaN(close) then Double.NaN else barNumber() );
def referenceBarSymbol8 = highestBarSymbol8 - y;
AddChartBubble( barNumber() == referenceBarSymbol8,symbol8Signal,"8:"+symbol8,if trendStrengthSymbol8[2] == 2 then Color.GREEN else if trendStrengthSymbol8[2] == 1then Color.DARK_GRAY else if trendStrengthSymbol8[2] == -2 then Color.RED else if trendStrengthSymbol8[2] == -1 then Color.DARK_RED else if trendStrengthSymbol8[2] == 0 then Color.YELLOW else Color.GRAY,yes);




################## -----------  SYMBOL #9
def ema1Symbol9 = expAverage(close(symbol9), Length1);
def ema2Symbol9 = expAverage(close(symbol9), Length2);
def ema3Symbol9 = expAverage(close(symbol9), Length3);
def ema4Symbol9 = expAverage(close(symbol9), Length4);

def u1Symbol9 = ema1Symbol9 > ema2Symbol9;
def u2Symbol9 = ema2Symbol9 > ema3Symbol9;
def u3Symbol9 = ema3Symbol9 > ema4Symbol9;

def d1Symbol9 = ema1Symbol9 < ema2Symbol9;
def d2Symbol9 = ema2Symbol9 < ema3Symbol9;
def d3Symbol9 = ema3Symbol9 < ema4Symbol9;

def trendStrengthSymbol9 = if (u1Symbol9 and u2Symbol9 and u3Symbol9) then 2 else if (u1Symbol9 and u2Symbol9 and !u3Symbol9) then 1 else if (d1Symbol9 and d2Symbol9 and d3Symbol9) then -2 else if (d1Symbol9 and d2Symbol9 and !d3Symbol9) then -1 else 0;

plot Symbol9Plot1 = if trendStrengthSymbol9 == 2 then symbol9Signal else Double.NaN;
Symbol9Plot1.SetPaintingStrategy(PaintingStrategy.LINE_VS_SQUARES);
Symbol9Plot1.SetLineWeight(3);
Symbol9Plot1.AssignValueColor(COLOR.GREEN);
plot Symbol9Plot2 = if trendStrengthSymbol9 == 1 then symbol9Signal else Double.NaN;
Symbol9Plot2.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
Symbol9Plot2.SetLineWeight(3);
Symbol9Plot2.AssignValueColor(COLOR.DARK_GREEN);
plot Symbol9Plot3 = if trendStrengthSymbol9 == -2 then symbol9Signal else Double.NaN;
Symbol9Plot3.SetPaintingStrategy(PaintingStrategy.LINE_VS_SQUARES);
Symbol9Plot3.SetLineWeight(3);
Symbol9Plot3.AssignValueColor(COLOR.RED);
plot Symbol9Plot4 = if trendStrengthSymbol9 == -1 then symbol9Signal else Double.NaN;
Symbol9Plot4.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
Symbol9Plot4.SetLineWeight(3);
Symbol9Plot4.AssignValueColor(COLOR.DARK_RED);
plot Symbol9Plot5 = if trendStrengthSymbol9 == 0 then symbol9Signal else Double.NaN;
Symbol9Plot5.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
Symbol9Plot5.SetLineWeight(3);
Symbol9Plot5.AssignValueColor(COLOR.YELLOW);
Symbol9Plot1.HideTitle();
Symbol9Plot2.HideTitle();
Symbol9Plot3.HideTitle();
Symbol9Plot4.HideTitle();
Symbol9Plot5.HideTitle();
def highestBarSymbol9 = HighestAll( if IsNaN(close) then Double.NaN else barNumber() );
def referenceBarSymbol9 = highestBarSymbol9 - x;
AddChartBubble( barNumber() == referenceBarSymbol9,symbol9Signal,"9:"+symbol9,if trendStrengthSymbol9[5] == 2 then Color.GREEN else if trendStrengthSymbol9[5] == 1then Color.DARK_GRAY else if trendStrengthSymbol9[5] == -2 then Color.RED else if trendStrengthSymbol9[5] == -1 then Color.DARK_RED else if trendStrengthSymbol9[5] == 0 then Color.YELLOW else Color.GRAY,yes);




################## -----------  SYMBOL #10
def ema1Symbol10 = expAverage(close(symbol10), Length1);
def ema2Symbol10 = expAverage(close(symbol10), Length2);
def ema3Symbol10 = expAverage(close(symbol10), Length3);
def ema4Symbol10 = expAverage(close(symbol10), Length4);

def u1Symbol10 = ema1Symbol10 > ema2Symbol10;
def u2Symbol10 = ema2Symbol10 > ema3Symbol10;
def u3Symbol10 = ema3Symbol10 > ema4Symbol10;

def d1Symbol10 = ema1Symbol10 < ema2Symbol10;
def d2Symbol10 = ema2Symbol10 < ema3Symbol10;
def d3Symbol10 = ema3Symbol10 < ema4Symbol10;

def trendStrengthSymbol10 = if (u1Symbol10 and u2Symbol10 and u3Symbol10) then 2 else if (u1Symbol10 and u2Symbol10 and !u3Symbol10) then 1 else if (d1Symbol10 and d2Symbol10 and d3Symbol10) then -2 else if (d1Symbol10 and d2Symbol10 and !d3Symbol10) then -1 else 0;

plot Symbol10Plot1 = if trendStrengthSymbol10 == 2 then symbol10Signal else Double.NaN;
Symbol10Plot1.SetPaintingStrategy(PaintingStrategy.LINE_VS_SQUARES);
Symbol10Plot1.SetLineWeight(3);
Symbol10Plot1.AssignValueColor(COLOR.GREEN);
plot Symbol10Plot2 = if trendStrengthSymbol10 == 1 then symbol10Signal else Double.NaN;
Symbol10Plot2.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
Symbol10Plot2.SetLineWeight(3);
Symbol10Plot2.AssignValueColor(COLOR.DARK_GREEN);
plot Symbol10Plot3 = if trendStrengthSymbol10 == -2 then symbol10Signal else Double.NaN;
Symbol10Plot3.SetPaintingStrategy(PaintingStrategy.LINE_VS_SQUARES);
Symbol10Plot3.SetLineWeight(3);
Symbol10Plot3.AssignValueColor(COLOR.RED);
plot Symbol10Plot4 = if trendStrengthSymbol10 == -1 then symbol10Signal else Double.NaN;
Symbol10Plot4.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
Symbol10Plot4.SetLineWeight(3);
Symbol10Plot4.AssignValueColor(COLOR.DARK_RED);
plot Symbol10Plot5 = if trendStrengthSymbol10 == 0 then symbol10Signal else Double.NaN;
Symbol10Plot5.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
Symbol10Plot5.SetLineWeight(3);
Symbol10Plot5.AssignValueColor(COLOR.YELLOW);
Symbol10Plot1.HideTitle();
Symbol10Plot2.HideTitle();
Symbol10Plot3.HideTitle();
Symbol10Plot4.HideTitle();
Symbol10Plot5.HideTitle();
def highestBarSymbol10 = HighestAll( if IsNaN(close) then Double.NaN else barNumber() );
def referenceBarSymbol10 = highestBarSymbol10 - y;
AddChartBubble( barNumber() == referenceBarSymbol10,symbol10Signal,"10:"+symbol10,if trendStrengthSymbol10[2] == 2 then Color.GREEN else if trendStrengthSymbol10[2] == 1then Color.DARK_GRAY else if trendStrengthSymbol10[2] == -2 then Color.RED else if trendStrengthSymbol10[2] == -1 then Color.DARK_RED else if trendStrengthSymbol10[2] == 0 then Color.YELLOW else Color.GRAY,yes);

################## -----------  SYMBOL #11
def ema1Symbol11 = expAverage(close(symbol11), Length1);
def ema2Symbol11 = expAverage(close(symbol11), Length2);
def ema3Symbol11 = expAverage(close(symbol11), Length3);
def ema4Symbol11 = expAverage(close(symbol11), Length4);

def u1Symbol11 = ema1Symbol11 > ema2Symbol11;
def u2Symbol11 = ema2Symbol11 > ema3Symbol11;
def u3Symbol11 = ema3Symbol11 > ema4Symbol11;

def d1Symbol11 = ema1Symbol11 < ema2Symbol11;
def d2Symbol11 = ema2Symbol11 < ema3Symbol11;
def d3Symbol11 = ema3Symbol11 < ema4Symbol11;

def trendStrengthSymbol11 = if (u1Symbol11 and u2Symbol11 and u3Symbol11) then 2 else if (u1Symbol11 and u2Symbol11 and !u3Symbol11) then 1 else if (d1Symbol11 and d2Symbol11 and d3Symbol11) then -2 else if (d1Symbol11 and d2Symbol11 and !d3Symbol11) then -1 else 0;

plot Symbol11Plot1 = if trendStrengthSymbol11 == 2 then symbol11Signal else Double.NaN;
Symbol11Plot1.SetPaintingStrategy(PaintingStrategy.LINE_VS_SQUARES);
Symbol11Plot1.SetLineWeight(3);
Symbol11Plot1.AssignValueColor(COLOR.GREEN);
plot Symbol11Plot2 = if trendStrengthSymbol11 == 1 then symbol11Signal else Double.NaN;
Symbol11Plot2.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
Symbol11Plot2.SetLineWeight(3);
Symbol11Plot2.AssignValueColor(COLOR.DARK_GREEN);
plot Symbol11Plot3 = if trendStrengthSymbol11 == -2 then symbol11Signal else Double.NaN;
Symbol11Plot3.SetPaintingStrategy(PaintingStrategy.LINE_VS_SQUARES);
Symbol11Plot3.SetLineWeight(3);
Symbol11Plot3.AssignValueColor(COLOR.RED);
plot Symbol11Plot4 = if trendStrengthSymbol11 == -1 then symbol11Signal else Double.NaN;
Symbol11Plot4.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
Symbol11Plot4.SetLineWeight(3);
Symbol11Plot4.AssignValueColor(COLOR.DARK_RED);
plot Symbol11Plot5 = if trendStrengthSymbol11 == 0 then symbol11Signal else Double.NaN;
Symbol11Plot5.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
Symbol11Plot5.SetLineWeight(3);
Symbol11Plot5.AssignValueColor(COLOR.YELLOW);
Symbol11Plot1.HideTitle();
Symbol11Plot2.HideTitle();
Symbol11Plot3.HideTitle();
Symbol11Plot4.HideTitle();
Symbol11Plot5.HideTitle();
def highestBarSymbol11 = HighestAll( if IsNaN(close) then Double.NaN else barNumber() );
def referenceBarSymbol11 = highestBarSymbol11 - x;
AddChartBubble( barNumber() == referenceBarSymbol11,symbol11Signal,"11:"+symbol11,if trendStrengthSymbol11[5] == 2 then Color.GREEN else if trendStrengthSymbol11[5] == 1then Color.DARK_GRAY else if trendStrengthSymbol11[5] == -2 then Color.RED else if trendStrengthSymbol11[5] == -1 then Color.DARK_RED else if trendStrengthSymbol11[5] == 0 then Color.YELLOW else Color.GRAY,yes);

################## -----------  SYMBOL #12
def ema1Symbol12 = expAverage(close(symbol12), Length1);
def ema2Symbol12 = expAverage(close(symbol12), Length2);
def ema3Symbol12 = expAverage(close(symbol12), Length3);
def ema4Symbol12 = expAverage(close(symbol12), Length4);

def u1Symbol12 = ema1Symbol12 > ema2Symbol12;
def u2Symbol12 = ema2Symbol12 > ema3Symbol12;
def u3Symbol12 = ema3Symbol12 > ema4Symbol12;

def d1Symbol12 = ema1Symbol12 < ema2Symbol12;
def d2Symbol12 = ema2Symbol12 < ema3Symbol12;
def d3Symbol12 = ema3Symbol12 < ema4Symbol12;

def trendStrengthSymbol12 = if (u1Symbol12 and u2Symbol12 and u3Symbol12) then 2 else if (u1Symbol12 and u2Symbol12 and !u3Symbol12) then 1 else if (d1Symbol12 and d2Symbol12 and d3Symbol12) then -2 else if (d1Symbol12 and d2Symbol12 and !d3Symbol12) then -1 else 0;

plot Symbol12Plot1 = if trendStrengthSymbol12 == 2 then symbol12Signal else Double.NaN;
Symbol12Plot1.SetPaintingStrategy(PaintingStrategy.LINE_VS_SQUARES);
Symbol12Plot1.SetLineWeight(3);
Symbol12Plot1.AssignValueColor(COLOR.GREEN);
plot Symbol12Plot2 = if trendStrengthSymbol12 == 1 then symbol12Signal else Double.NaN;
Symbol12Plot2.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
Symbol12Plot2.SetLineWeight(3);
Symbol12Plot2.AssignValueColor(COLOR.DARK_GREEN);
plot Symbol12Plot3 = if trendStrengthSymbol12 == -2 then symbol12Signal else Double.NaN;
Symbol12Plot3.SetPaintingStrategy(PaintingStrategy.LINE_VS_SQUARES);
Symbol12Plot3.SetLineWeight(3);
Symbol12Plot3.AssignValueColor(COLOR.RED);
plot Symbol12Plot4 = if trendStrengthSymbol12 == -1 then symbol12Signal else Double.NaN;
Symbol12Plot4.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
Symbol12Plot4.SetLineWeight(3);
Symbol12Plot4.AssignValueColor(COLOR.DARK_RED);
plot Symbol12Plot5 = if trendStrengthSymbol12 == 0 then symbol12Signal else Double.NaN;
Symbol12Plot5.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
Symbol12Plot5.SetLineWeight(3);
Symbol12Plot5.AssignValueColor(COLOR.YELLOW);
Symbol12Plot1.HideTitle();
Symbol12Plot2.HideTitle();
Symbol12Plot3.HideTitle();
Symbol12Plot4.HideTitle();
Symbol12Plot5.HideTitle();
def highestBarSymbol12 = HighestAll( if IsNaN(close) then Double.NaN else barNumber() );
def referenceBarSymbol12 = highestBarSymbol12 - y;
AddChartBubble( barNumber() == referenceBarSymbol12,symbol12Signal,"12:"+symbol12,if trendStrengthSymbol12[2] == 2 then Color.GREEN else if trendStrengthSymbol12[2] == 1then Color.DARK_GRAY else if trendStrengthSymbol12[2] == -2 then Color.RED else if trendStrengthSymbol12[2] == -1 then Color.DARK_RED else if trendStrengthSymbol12[2] == 0 then Color.YELLOW else Color.GRAY,yes);

################## -----------  SYMBOL #13
def ema1Symbol13 = expAverage(close(symbol13), Length1);
def ema2Symbol13 = expAverage(close(symbol13), Length2);
def ema3Symbol13 = expAverage(close(symbol13), Length3);
def ema4Symbol13 = expAverage(close(symbol13), Length4);

def u1Symbol13 = ema1Symbol13 > ema2Symbol13;
def u2Symbol13 = ema2Symbol13 > ema3Symbol13;
def u3Symbol13 = ema3Symbol13 > ema4Symbol13;

def d1Symbol13 = ema1Symbol13 < ema2Symbol13;
def d2Symbol13 = ema2Symbol13 < ema3Symbol13;
def d3Symbol13 = ema3Symbol13 < ema4Symbol13;

def trendStrengthSymbol13 = if (u1Symbol13 and u2Symbol13 and u3Symbol13) then 2 else if (u1Symbol13 and u2Symbol13 and !u3Symbol13) then 1 else if (d1Symbol13 and d2Symbol13 and d3Symbol13) then -2 else if (d1Symbol13 and d2Symbol13 and !d3Symbol13) then -1 else 0;

plot Symbol13Plot1 = if trendStrengthSymbol13 == 2 then symbol13Signal else Double.NaN;
Symbol13Plot1.SetPaintingStrategy(PaintingStrategy.LINE_VS_SQUARES);
Symbol13Plot1.SetLineWeight(3);
Symbol13Plot1.AssignValueColor(COLOR.GREEN);
plot Symbol13Plot2 = if trendStrengthSymbol13 == 1 then symbol13Signal else Double.NaN;
Symbol13Plot2.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
Symbol13Plot2.SetLineWeight(3);
Symbol13Plot2.AssignValueColor(COLOR.DARK_GREEN);
plot Symbol13Plot3 = if trendStrengthSymbol13 == -2 then symbol13Signal else Double.NaN;
Symbol13Plot3.SetPaintingStrategy(PaintingStrategy.LINE_VS_SQUARES);
Symbol13Plot3.SetLineWeight(3);
Symbol13Plot3.AssignValueColor(COLOR.RED);
plot Symbol13Plot4 = if trendStrengthSymbol13 == -1 then symbol13Signal else Double.NaN;
Symbol13Plot4.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
Symbol13Plot4.SetLineWeight(3);
Symbol13Plot4.AssignValueColor(COLOR.DARK_RED);
plot Symbol13Plot5 = if trendStrengthSymbol13 == 0 then symbol13Signal else Double.NaN;
Symbol13Plot5.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
Symbol13Plot5.SetLineWeight(3);
Symbol13Plot5.AssignValueColor(COLOR.YELLOW);
Symbol13Plot1.HideTitle();
Symbol13Plot2.HideTitle();
Symbol13Plot3.HideTitle();
Symbol13Plot4.HideTitle();
Symbol13Plot5.HideTitle();
def highestBarSymbol13 = HighestAll( if IsNaN(close) then Double.NaN else barNumber() );
def referenceBarSymbol13 = highestBarSymbol13 - x;
AddChartBubble( barNumber() == referenceBarSymbol13,symbol13Signal,"13:"+symbol13,if trendStrengthSymbol11[5] == 2 then Color.GREEN else if trendStrengthSymbol11[5] == 1then Color.DARK_GRAY else if trendStrengthSymbol11[5] == -2 then Color.RED else if trendStrengthSymbol11[5] == -1 then Color.DARK_RED else if trendStrengthSymbol11[5] == 0 then Color.YELLOW else Color.GRAY,yes);

################## -----------  SYMBOL #14
def ema1Symbol14 = expAverage(close(symbol14), Length1);
def ema2Symbol14 = expAverage(close(symbol14), Length2);
def ema3Symbol14 = expAverage(close(symbol14), Length3);
def ema4Symbol14 = expAverage(close(symbol14), Length4);

def u1Symbol14 = ema1Symbol14 > ema2Symbol14;
def u2Symbol14 = ema2Symbol14 > ema3Symbol14;
def u3Symbol14 = ema3Symbol14 > ema4Symbol14;

def d1Symbol14 = ema1Symbol14 < ema2Symbol14;
def d2Symbol14 = ema2Symbol14 < ema3Symbol14;
def d3Symbol14 = ema3Symbol14 < ema4Symbol14;

def trendStrengthSymbol14 = if (u1Symbol14 and u2Symbol14 and u3Symbol14) then 2 else if (u1Symbol14 and u2Symbol14 and !u3Symbol14) then 1 else if (d1Symbol14 and d2Symbol14 and d3Symbol14) then -2 else if (d1Symbol14 and d2Symbol14 and !d3Symbol14) then -1 else 0;

plot Symbol14Plot1 = if trendStrengthSymbol14 == 2 then symbol14Signal else Double.NaN;
Symbol14Plot1.SetPaintingStrategy(PaintingStrategy.LINE_VS_SQUARES);
Symbol14Plot1.SetLineWeight(3);
Symbol14Plot1.AssignValueColor(COLOR.GREEN);
plot Symbol14Plot2 = if trendStrengthSymbol14 == 1 then symbol14Signal else Double.NaN;
Symbol14Plot2.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
Symbol14Plot2.SetLineWeight(3);
Symbol14Plot2.AssignValueColor(COLOR.DARK_GREEN);
plot Symbol14Plot3 = if trendStrengthSymbol14 == -2 then symbol14Signal else Double.NaN;
Symbol14Plot3.SetPaintingStrategy(PaintingStrategy.LINE_VS_SQUARES);
Symbol14Plot3.SetLineWeight(3);
Symbol14Plot3.AssignValueColor(COLOR.RED);
plot Symbol14Plot4 = if trendStrengthSymbol14 == -1 then symbol14Signal else Double.NaN;
Symbol14Plot4.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
Symbol14Plot4.SetLineWeight(3);
Symbol14Plot4.AssignValueColor(COLOR.DARK_RED);
plot Symbol14Plot5 = if trendStrengthSymbol14 == 0 then symbol14Signal else Double.NaN;
Symbol14Plot5.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
Symbol14Plot5.SetLineWeight(3);
Symbol14Plot5.AssignValueColor(COLOR.YELLOW);
Symbol14Plot1.HideTitle();
Symbol14Plot2.HideTitle();
Symbol14Plot3.HideTitle();
Symbol14Plot4.HideTitle();
Symbol14Plot5.HideTitle();
def highestBarSymbol14 = HighestAll( if IsNaN(close) then Double.NaN else barNumber() );
def referenceBarSymbol14 = highestBarSymbol14 - y;
AddChartBubble( barNumber() == referenceBarSymbol14,symbol14Signal,"14:"+symbol14,if trendStrengthSymbol14[2] == 2 then Color.GREEN else if trendStrengthSymbol14[2] == 1then Color.DARK_GRAY else if trendStrengthSymbol14[2] == -2 then Color.RED else if trendStrengthSymbol14[2] == -1 then Color.DARK_RED else if trendStrengthSymbol14[2] == 0 then Color.YELLOW else Color.GRAY,yes);
 
Last edited:

ace_wheelie

New member
Thank you. How does this work?
The this works is it allows you to watch multiple stocks or ETF's on a daily chart linearly. How I use it is I have multiple version of the indicator. 1 for the main ETF'S like the IWM QQQ and the SPY as well as all the S&P sectors so I can at a glance so what sector has had a pull back and is very strong for the day (green squares show strong upward trend.) Then I have version of the phoenix finder that has a selections of stocks from each sector.

So say XLK has been very strong which is the tech sector of the S&P. I pull my XLK phoenix finder up which lists my stocks from the tech sector I love to trade. This includes AAPL, MSFT, NVDA, CRM, etc. I do an over all check on the stocks. Are they all in a strong trend up or are just a few of them pushing the XLK to be green. If the last one is the case then I move on to the other sectors that were strong on the first phoenix finder. But if it's the first option and all or most of the stocks are very strong then I will go to their charts and look at the 15min chart and look for a pull back to get in.

I've only been using this technique this past week but it really seems to add more power to my trades. I also pair this with the TTM Squeeze, the Moxie Arrows, the Phoenix StrengthTrend Candles, and the 8,21,34 EMA's.
 

ace_wheelie

New member
I got this from the custom watchlist code which is supposed to show you the trend in a column on your watch list but if you put it in as a study it works the same. I also had VolDots but I don't think it's working right yet. Some times it shows them and other times it doesn't so just bear that in mind
Code:
declare upper;

input length = 14;

def Length1 = 5;
def Length2 = 8;
def Length3 = 13;
def Length4 = 21;
def Length5 = 34;   

def ema1 = expAverage(close, Length1);
def ema2 = expAverage(close, Length2);
def ema3 = expAverage(close, Length3);
def ema4 = expAverage(close, Length4);

def u1 = ema1 > ema2;
def u2 = ema2 > ema3;
def u3 = ema3 > ema4;

def d1 = ema1 < ema2;
def d2 = ema2 < ema3;
def d3 = ema3 < ema4;

def trendStrength = if (u1 and u2 and u3) then 2 else if (u1 and u2 and !u3) then 1 else if (d1 and d2 and d3) then -2 else if (d1 and d2 and !d3) then -1 else 0;

AssignPriceColor( if trendStrength == 2 then color.green else if trendStrength == 1 then color.DARK_GREEN else if trendStrength == -2 then color.red else if trendStrength == -1 then color.dark_red else color.yellow);


#Blue Volume Balls

input volumeLength = 20;
input volumeFactor = 1;
input plotVolumeDotOnNeutral = no;
input volumeGreaterPercent = 50;

#Get moving average of volume
def volAvg = MovingAverage(length = volumeLength,data = volume);
#Calculate middle of bar
def volDotLocation = volumeFactor * MidBodyVal();
#calculate 50% increase in average volume
def vol50IncLevel = volAvg * (1 + (volumeGreaterPercent / 100));
#if current volume is greater than the configured length MA of the volume and the price color is not yellow (neutral) or configured to plot on yellow bars (neutral) then plot volume dot
plot volDot = if volume >= vol50IncLevel and (trendStrength != 2 or plotVolumeDotOnNeutral) then volDotLocation else Double.NaN;
volDot.SetStyle(Curve.POINTS);
volDot.SetDefaultColor(Color.CYAN);
volDot.SetLineWeight(2);
#AssignPriceColor(Color.BLUE);


#end

0Jd5SuF.png
 

greentonic

New member
I got this from the custom watchlist code which is supposed to show you the trend in a column on your watch list but if you put it in as a study it works the same. I also had VolDots but I don't think it's working right yet. Some times it shows them and other times it doesn't so just bear that in mind
Code:
declare upper;

input length = 14;

def Length1 = 5;
def Length2 = 8;
def Length3 = 13;
def Length4 = 21;
def Length5 = 34;  

def ema1 = expAverage(close, Length1);
def ema2 = expAverage(close, Length2);
def ema3 = expAverage(close, Length3);
def ema4 = expAverage(close, Length4);

def u1 = ema1 > ema2;
def u2 = ema2 > ema3;
def u3 = ema3 > ema4;

def d1 = ema1 < ema2;
def d2 = ema2 < ema3;
def d3 = ema3 < ema4;

def trendStrength = if (u1 and u2 and u3) then 2 else if (u1 and u2 and !u3) then 1 else if (d1 and d2 and d3) then -2 else if (d1 and d2 and !d3) then -1 else 0;

AssignPriceColor( if trendStrength == 2 then color.green else if trendStrength == 1 then color.DARK_GREEN else if trendStrength == -2 then color.red else if trendStrength == -1 then color.dark_red else color.yellow);


#Blue Volume Balls

input volumeLength = 20;
input volumeFactor = 1;
input plotVolumeDotOnNeutral = no;
input volumeGreaterPercent = 50;

#Get moving average of volume
def volAvg = MovingAverage(length = volumeLength,data = volume);
#Calculate middle of bar
def volDotLocation = volumeFactor * MidBodyVal();
#calculate 50% increase in average volume
def vol50IncLevel = volAvg * (1 + (volumeGreaterPercent / 100));
#if current volume is greater than the configured length MA of the volume and the price color is not yellow (neutral) or configured to plot on yellow bars (neutral) then plot volume dot
plot volDot = if volume >= vol50IncLevel and (trendStrength != 2 or plotVolumeDotOnNeutral) then volDotLocation else Double.NaN;
volDot.SetStyle(Curve.POINTS);
volDot.SetDefaultColor(Color.CYAN);
volDot.SetLineWeight(2);
#AssignPriceColor(Color.BLUE);


#end

0Jd5SuF.png


Is it possable to get different agg time frames ? Ie Trade on 1 min chart with this set to 5 min time frame ???
 

air226rider

New member
Fresh version of the Phoenix Finder indicator for ThinkorSwim. Plots candles for 14 stocks based on Phoenix Strength. It can help track stocks in a specific sector and identify trends based on Phoenix Strength and overall conditions. Per request from @ace_wheelie

Found via Simpler Trading: https://simpler-trading.helpscoutdocs.com/article/905-how-to-set-up-phoenix-finder-trend-strength-watchlist

BY5VAnN.png


Version 1 of the code:

Code:
#START OF Ticker Tracker for Thinkorswim
#
#CHANGELOG
# 2020.12.21 V1.0 @cos251 - Created script to show candles based on strength formulate in lower study for 14
#                         - tickers at once
#                         - tickers can be selected in settings
#
#CREDITS
# Requested by @ace_wheelie
#
#LINK
# https://usethinkscript.com/threads/ttm-squeeze-fire-signal-another-take.4301/
# https://usethinkscript.com/threads/salty-phoenix-finder.4924/


declare lower;

input symbol1 = "QQQ";
input symbol2 = "SPY";
input symbol3 = "AAPL";
input symbol4 = "MSFT";
input symbol5 = "PLUG";
input symbol6 = "TSLA";
input symbol7 = "GOOG";
input symbol8 = "CRM";
input symbol9 = "NIO";
input symbol10 = "SNAP";
input symbol11 = "PTON";
input symbol12 = "ZM";
input symbol13 = "FSLY";
input symbol14 = "AMD";
def symbol1Signal = 1;
def symbol2Signal = 2;
def symbol3Signal = 3;
def symbol4Signal = 4;
def symbol5Signal = 5;
def symbol6Signal = 6;
def symbol7Signal = 7;
def symbol8Signal = 8;
def symbol9Signal = 9;
def symbol10Signal = 10;
def symbol11Signal = 11;
def symbol12Signal = 12;
def symbol13Signal = 13;
def symbol14Signal = 14;
plot break155 = 15.5;
plot break145 = 14.5;
plot break135 = 13.5;
plot break125 = 12.5;
plot break115 = 11.5;
plot break105 = 10.5;
plot break95 = 9.5;
plot break85 = 8.5;
plot break75 = 7.5;
plot break65 = 6.5;
plot break55 = 5.5;
plot break45 = 4.5;
plot break35 = 3.5;
plot break25 = 2.5;
plot break15 = 1.5;
break155.HideBubble();
break145.HideBubble();
break135.HideBubble();
break125.HideBubble();
break115.HideBubble();
break105.HideBubble();
break95.HideBubble();
break85.HideBubble();
break75.HideBubble();
break65.HideBubble();
break55.HideBubble();
break45.HideBubble();
break35.HideBubble();
break25.HideBubble();
break15.HideBubble();
break155.HideBubble();
break145.HideBubble();
break135.HideTitle();
break125.HideTitle();
break115.HideTitle();
break105.HideTitle();
break95.HideTitle();
break85.HideTitle();
break75.HideTitle();
break65.HideTitle();
break55.HideTitle();
break45.HideTitle();
break35.HideTitle();
break25.HideTitle();
break15.HideTitle();
break155.SetDefaultColor(Color.GRAY);
break145.SetDefaultColor(Color.GRAY);
break135.SetDefaultColor(Color.GRAY);
break125.SetDefaultColor(Color.GRAY);
break115.SetDefaultColor(Color.GRAY);
break105.SetDefaultColor(Color.GRAY);
break95.SetDefaultColor(Color.GRAY);
break85.SetDefaultColor(Color.GRAY);
break75.SetDefaultColor(Color.GRAY);
break65.SetDefaultColor(Color.GRAY);
break55.SetDefaultColor(Color.GRAY);
break45.SetDefaultColor(Color.GRAY);
break35.SetDefaultColor(Color.GRAY);
break25.SetDefaultColor(Color.GRAY);
break15.SetDefaultColor(Color.GRAY);


def x = -5;
def y = -2;
def Length1 = 5;
def Length2 = 8;
def Length3 = 13;
def Length4 = 21;
def Length5 = 34;


################## -----------  SYMBOL #1
def ema1Symbol1 = expAverage(close(symbol1), Length1);
def ema2Symbol1 = expAverage(close(symbol1), Length2);
def ema3Symbol1 = expAverage(close(symbol1), Length3);
def ema4Symbol1 = expAverage(close(symbol1), Length4);

def u1Symbol1 = ema1Symbol1 > ema2Symbol1;
def u2Symbol1 = ema2Symbol1 > ema3Symbol1;
def u3Symbol1 = ema3Symbol1 > ema4Symbol1;

def d1Symbol1 = ema1Symbol1 < ema2Symbol1;
def d2Symbol1 = ema2Symbol1 < ema3Symbol1;
def d3Symbol1 = ema3Symbol1 < ema4Symbol1;

def trendStrengthSymbol1 = if (u1Symbol1 and u2Symbol1 and u3Symbol1) then 2 else if (u1Symbol1 and u2Symbol1 and !u3Symbol1) then 1 else if (d1Symbol1 and d2Symbol1 and d3Symbol1) then -2 else if (d1Symbol1 and d2Symbol1 and !d3Symbol1) then -1 else 0;

plot Symbol1Plot1 = if trendStrengthSymbol1 == 2 then symbol1Signal else Double.NaN;
Symbol1Plot1.SetPaintingStrategy(PaintingStrategy.LINE_VS_SQUARES);
Symbol1Plot1.SetLineWeight(3);
Symbol1Plot1.AssignValueColor(COLOR.GREEN);
plot Symbol1Plot2 = if trendStrengthSymbol1 == 1 then symbol1Signal else Double.NaN;
Symbol1Plot2.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
Symbol1Plot2.SetLineWeight(3);
Symbol1Plot2.AssignValueColor(COLOR.DARK_GREEN);
plot Symbol1Plot3 = if trendStrengthSymbol1 == -2 then symbol1Signal else Double.NaN;
Symbol1Plot3.SetPaintingStrategy(PaintingStrategy.LINE_VS_SQUARES);
Symbol1Plot3.SetLineWeight(3);
Symbol1Plot3.AssignValueColor(COLOR.RED);
plot Symbol1Plot4 = if trendStrengthSymbol1 == -1 then symbol1Signal else Double.NaN;
Symbol1Plot4.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
Symbol1Plot4.SetLineWeight(3);
Symbol1Plot4.AssignValueColor(COLOR.DARK_RED);
plot Symbol1Plot5 = if trendStrengthSymbol1 == 0 then symbol1Signal else Double.NaN;
Symbol1Plot5.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
Symbol1Plot5.SetLineWeight(3);
Symbol1Plot5.AssignValueColor(COLOR.YELLOW);
Symbol1Plot1.HideTitle();
Symbol1Plot2.HideTitle();
Symbol1Plot3.HideTitle();
Symbol1Plot4.HideTitle();
Symbol1Plot5.HideTitle();
def highestBarSymbol1 = HighestAll( if IsNaN(close) then Double.NaN else barNumber() );
def referenceBarSymbol1 = highestBarSymbol1 - x;
AddChartBubble( barNumber() == referenceBarSymbol1,symbol1Signal,"1:"+symbol1,Color.GREEN);




################## -----------  SYMBOL #2
def ema1Symbol2 = expAverage(close(symbol2), Length1);
def ema2Symbol2 = expAverage(close(symbol2), Length2);
def ema3Symbol2 = expAverage(close(symbol2), Length3);
def ema4Symbol2 = expAverage(close(symbol2), Length4);

def u1Symbol2 = ema1Symbol2 > ema2Symbol2;
def u2Symbol2 = ema2Symbol2 > ema3Symbol2;
def u3Symbol2 = ema3Symbol2 > ema4Symbol2;

def d1Symbol2 = ema1Symbol2 < ema2Symbol2;
def d2Symbol2 = ema2Symbol2 < ema3Symbol2;
def d3Symbol2 = ema3Symbol2 < ema4Symbol2;

def trendStrengthSymbol2 = if (u1Symbol2 and u2Symbol2 and u3Symbol2) then 2 else if (u1Symbol2 and u2Symbol2 and !u3Symbol2) then 1 else if (d1Symbol2 and d2Symbol2 and d3Symbol2) then -2 else if (d1Symbol2 and d2Symbol2 and !d3Symbol2) then -1 else 0;

plot Symbol2Plot1 = if trendStrengthSymbol2 == 2 then symbol2Signal else Double.NaN;
Symbol2Plot1.SetPaintingStrategy(PaintingStrategy.LINE_VS_SQUARES);
Symbol2Plot1.SetLineWeight(3);
Symbol2Plot1.AssignValueColor(COLOR.GREEN);
plot Symbol2Plot2 = if trendStrengthSymbol2 == 1 then symbol2Signal else Double.NaN;
Symbol2Plot2.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
Symbol2Plot2.SetLineWeight(3);
Symbol2Plot2.AssignValueColor(COLOR.DARK_GREEN);
plot Symbol2Plot3 = if trendStrengthSymbol2 == -2 then symbol2Signal else Double.NaN;
Symbol2Plot3.SetPaintingStrategy(PaintingStrategy.LINE_VS_SQUARES);
Symbol2Plot3.SetLineWeight(3);
Symbol2Plot3.AssignValueColor(COLOR.RED);
plot Symbol2Plot4 = if trendStrengthSymbol2 == -1 then symbol2Signal else Double.NaN;
Symbol2Plot4.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
Symbol2Plot4.SetLineWeight(3);
Symbol2Plot4.AssignValueColor(COLOR.DARK_RED);
plot Symbol2Plot5 = if trendStrengthSymbol2 == 0 then symbol2Signal else Double.NaN;
Symbol2Plot5.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
Symbol2Plot5.SetLineWeight(3);
Symbol2Plot5.AssignValueColor(Color.YELLOW);
Symbol2Plot1.HideTitle();
Symbol2Plot2.HideTitle();
Symbol2Plot3.HideTitle();
Symbol2Plot4.HideTitle();
Symbol2Plot5.HideTitle();
def highestBarSymbol2 = HighestAll( if IsNaN(close) then Double.NaN else barNumber() );
def referenceBarSymbol2 = highestBarSymbol2 - y;
AddChartBubble( barNumber() == referenceBarSymbol2,symbol2Signal,"2:"+symbol2,Color.GREEN);




################## -----------  SYMBOL #3
def ema1Symbol3 = expAverage(close(symbol3), Length1);
def ema2Symbol3 = expAverage(close(symbol3), Length2);
def ema3Symbol3 = expAverage(close(symbol3), Length3);
def ema4Symbol3 = expAverage(close(symbol3), Length4);

def u1Symbol3 = ema1Symbol3 > ema2Symbol3;
def u2Symbol3 = ema2Symbol3 > ema3Symbol3;
def u3Symbol3 = ema3Symbol3 > ema4Symbol3;

def d1Symbol3 = ema1Symbol3 < ema2Symbol3;
def d2Symbol3 = ema2Symbol3 < ema3Symbol3;
def d3Symbol3 = ema3Symbol3 < ema4Symbol3;

def trendStrengthSymbol3 = if (u1Symbol3 and u2Symbol3 and u3Symbol3) then 2 else if (u1Symbol3 and u2Symbol3 and !u3Symbol3) then 1 else if (d1Symbol3 and d2Symbol3 and d3Symbol3) then -2 else if (d1Symbol3 and d2Symbol3 and !d3Symbol3) then -1 else 0;

plot Symbol3Plot1 = if trendStrengthSymbol3 == 2 then symbol3Signal else Double.NaN;
Symbol3Plot1.SetPaintingStrategy(PaintingStrategy.LINE_VS_SQUARES);
Symbol3Plot1.SetLineWeight(3);
Symbol3Plot1.AssignValueColor(COLOR.GREEN);
plot Symbol3Plot2 = if trendStrengthSymbol3 == 1 then symbol3Signal else Double.NaN;
Symbol3Plot2.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
Symbol3Plot2.SetLineWeight(3);
Symbol3Plot2.AssignValueColor(COLOR.DARK_GREEN);
plot Symbol3Plot3 = if trendStrengthSymbol3 == -2 then symbol3Signal else Double.NaN;
Symbol3Plot3.SetPaintingStrategy(PaintingStrategy.LINE_VS_SQUARES);
Symbol3Plot3.SetLineWeight(3);
Symbol3Plot3.AssignValueColor(COLOR.RED);
plot Symbol3Plot4 = if trendStrengthSymbol3 == -1 then symbol3Signal else Double.NaN;
Symbol3Plot4.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
Symbol3Plot4.SetLineWeight(3);
Symbol3Plot4.AssignValueColor(COLOR.DARK_RED);
plot Symbol3Plot5 = if trendStrengthSymbol3 == 0 then symbol3Signal else Double.NaN;
Symbol3Plot5.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
Symbol3Plot5.SetLineWeight(3);
Symbol3Plot5.AssignValueColor(COLOR.YELLOW);
Symbol3Plot1.HideTitle();
Symbol3Plot2.HideTitle();
Symbol3Plot3.HideTitle();
Symbol3Plot4.HideTitle();
Symbol3Plot5.HideTitle();
def highestBarSymbol3 = HighestAll( if IsNaN(close) then Double.NaN else barNumber() );
def referenceBarSymbol3 = highestBarSymbol3 - x;
AddChartBubble( barNumber() == referenceBarSymbol3,symbol3Signal,"3:"+symbol3,Color.GREEN);



################## -----------  SYMBOL #4
def ema1Symbol4 = expAverage(close(symbol4), Length1);
def ema2Symbol4 = expAverage(close(symbol4), Length2);
def ema3Symbol4 = expAverage(close(symbol4), Length3);
def ema4Symbol4 = expAverage(close(symbol4), Length4);

def u1Symbol4 = ema1Symbol4 > ema2Symbol4;
def u2Symbol4 = ema2Symbol4 > ema3Symbol4;
def u3Symbol4 = ema3Symbol4 > ema4Symbol4;

def d1Symbol4 = ema1Symbol4 < ema2Symbol4;
def d2Symbol4 = ema2Symbol4 < ema3Symbol4;
def d3Symbol4 = ema3Symbol4 < ema4Symbol4;

def trendStrengthSymbol4 = if (u1Symbol4 and u2Symbol4 and u3Symbol4) then 2 else if (u1Symbol4 and u2Symbol4 and !u3Symbol4) then 1 else if (d1Symbol4 and d2Symbol4 and d3Symbol4) then -2 else if (d1Symbol4 and d2Symbol4 and !d3Symbol4) then -1 else 0;

plot Symbol4Plot1 = if trendStrengthSymbol4 == 2 then symbol4Signal else Double.NaN;
Symbol4Plot1.SetPaintingStrategy(PaintingStrategy.LINE_VS_SQUARES);
Symbol4Plot1.SetLineWeight(3);
Symbol4Plot1.AssignValueColor(COLOR.GREEN);
plot Symbol4Plot2 = if trendStrengthSymbol4 == 1 then symbol4Signal else Double.NaN;
Symbol4Plot2.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
Symbol4Plot2.SetLineWeight(3);
Symbol4Plot2.AssignValueColor(COLOR.DARK_GREEN);
plot Symbol4Plot3 = if trendStrengthSymbol4 == -2 then symbol4Signal else Double.NaN;
Symbol4Plot3.SetPaintingStrategy(PaintingStrategy.LINE_VS_SQUARES);
Symbol4Plot3.SetLineWeight(3);
Symbol4Plot3.AssignValueColor(COLOR.RED);
plot Symbol4Plot4 = if trendStrengthSymbol4 == -1 then symbol4Signal else Double.NaN;
Symbol4Plot4.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
Symbol4Plot4.SetLineWeight(3);
Symbol4Plot4.AssignValueColor(COLOR.DARK_RED);
plot Symbol4Plot5 = if trendStrengthSymbol4 == 0 then symbol4Signal else Double.NaN;
Symbol4Plot5.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
Symbol4Plot5.SetLineWeight(3);
Symbol4Plot5.AssignValueColor(COLOR.YELLOW);
Symbol4Plot1.HideTitle();
Symbol4Plot2.HideTitle();
Symbol4Plot3.HideTitle();
Symbol4Plot4.HideTitle();
Symbol4Plot5.HideTitle();
def highestBarSymbol4 = HighestAll( if IsNaN(close) then Double.NaN else barNumber() );
def referenceBarSymbol4 = highestBarSymbol4 - y;
AddChartBubble( barNumber() == referenceBarSymbol4,symbol4Signal,"4:"+symbol4,Color.GREEN);




################## -----------  SYMBOL #5
def ema1Symbol5 = expAverage(close(symbol5), Length1);
def ema2Symbol5 = expAverage(close(symbol5), Length2);
def ema3Symbol5 = expAverage(close(symbol5), Length3);
def ema4Symbol5 = expAverage(close(symbol5), Length4);

def u1Symbol5 = ema1Symbol5 > ema2Symbol5;
def u2Symbol5 = ema2Symbol5 > ema3Symbol5;
def u3Symbol5 = ema3Symbol5 > ema4Symbol5;

def d1Symbol5 = ema1Symbol5 < ema2Symbol5;
def d2Symbol5 = ema2Symbol5 < ema3Symbol5;
def d3Symbol5 = ema3Symbol5 < ema4Symbol5;

def trendStrengthSymbol5 = if (u1Symbol5 and u2Symbol5 and u3Symbol5) then 2 else if (u1Symbol5 and u2Symbol5 and !u3Symbol5) then 1 else if (d1Symbol5 and d2Symbol5 and d3Symbol5) then -2 else if (d1Symbol5 and d2Symbol5 and !d3Symbol5) then -1 else 0;

plot Symbol5Plot1 = if trendStrengthSymbol5 == 2 then symbol5Signal else Double.NaN;
Symbol5Plot1.SetPaintingStrategy(PaintingStrategy.LINE_VS_SQUARES);
Symbol5Plot1.SetLineWeight(3);
Symbol5Plot1.AssignValueColor(COLOR.GREEN);
plot Symbol5Plot2 = if trendStrengthSymbol5 == 1 then symbol5Signal else Double.NaN;
Symbol5Plot2.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
Symbol5Plot2.SetLineWeight(3);
Symbol5Plot2.AssignValueColor(COLOR.DARK_GREEN);
plot Symbol5Plot3 = if trendStrengthSymbol5 == -2 then symbol5Signal else Double.NaN;
Symbol5Plot3.SetPaintingStrategy(PaintingStrategy.LINE_VS_SQUARES);
Symbol5Plot3.SetLineWeight(3);
Symbol5Plot3.AssignValueColor(COLOR.RED);
plot Symbol5Plot4 = if trendStrengthSymbol5 == -1 then symbol5Signal else Double.NaN;
Symbol5Plot4.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
Symbol5Plot4.SetLineWeight(3);
Symbol5Plot4.AssignValueColor(COLOR.DARK_RED);
plot Symbol5Plot5 = if trendStrengthSymbol5 == 0 then symbol5Signal else Double.NaN;
Symbol5Plot5.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
Symbol5Plot5.SetLineWeight(3);
Symbol5Plot5.AssignValueColor(COLOR.YELLOW);
Symbol5Plot1.HideTitle();
Symbol5Plot2.HideTitle();
Symbol5Plot3.HideTitle();
Symbol5Plot4.HideTitle();
Symbol5Plot5.HideTitle();
def highestBarSymbol5 = HighestAll( if IsNaN(close) then Double.NaN else barNumber() );
def referenceBarSymbol5 = highestBarSymbol5 - x;
AddChartBubble( barNumber() == referenceBarSymbol5,symbol5Signal,"5:"+symbol5,Color.GREEN);



################## -----------  SYMBOL #6
def ema1Symbol6 = expAverage(close(symbol6), Length1);
def ema2Symbol6 = expAverage(close(symbol6), Length2);
def ema3Symbol6 = expAverage(close(symbol6), Length3);
def ema4Symbol6 = expAverage(close(symbol6), Length4);

def u1Symbol6 = ema1Symbol6 > ema2Symbol6;
def u2Symbol6 = ema2Symbol6 > ema3Symbol6;
def u3Symbol6 = ema3Symbol6 > ema4Symbol6;

def d1Symbol6 = ema1Symbol6 < ema2Symbol6;
def d2Symbol6 = ema2Symbol6 < ema3Symbol6;
def d3Symbol6 = ema3Symbol6 < ema4Symbol6;

def trendStrengthSymbol6 = if (u1Symbol6 and u2Symbol6 and u3Symbol6) then 2 else if (u1Symbol6 and u2Symbol6 and !u3Symbol6) then 1 else if (d1Symbol6 and d2Symbol6 and d3Symbol6) then -2 else if (d1Symbol6 and d2Symbol6 and !d3Symbol6) then -1 else 0;

plot Symbol6Plot1 = if trendStrengthSymbol6 == 2 then symbol6Signal else Double.NaN;
Symbol6Plot1.SetPaintingStrategy(PaintingStrategy.LINE_VS_SQUARES);
Symbol6Plot1.SetLineWeight(3);
Symbol6Plot1.AssignValueColor(COLOR.GREEN);
plot Symbol6Plot2 = if trendStrengthSymbol6 == 1 then symbol6Signal else Double.NaN;
Symbol6Plot2.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
Symbol6Plot2.SetLineWeight(3);
Symbol6Plot2.AssignValueColor(COLOR.DARK_GREEN);
plot Symbol6Plot3 = if trendStrengthSymbol6 == -2 then symbol6Signal else Double.NaN;
Symbol6Plot3.SetPaintingStrategy(PaintingStrategy.LINE_VS_SQUARES);
Symbol6Plot3.SetLineWeight(3);
Symbol6Plot3.AssignValueColor(COLOR.RED);
plot Symbol6Plot4 = if trendStrengthSymbol6 == -1 then symbol6Signal else Double.NaN;
Symbol6Plot4.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
Symbol6Plot4.SetLineWeight(3);
Symbol6Plot4.AssignValueColor(COLOR.DARK_RED);
plot Symbol6Plot5 = if trendStrengthSymbol6 == 0 then symbol6Signal else Double.NaN;
Symbol6Plot5.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
Symbol6Plot5.SetLineWeight(3);
Symbol6Plot5.AssignValueColor(COLOR.YELLOW);
Symbol6Plot1.HideTitle();
Symbol6Plot2.HideTitle();
Symbol6Plot3.HideTitle();
Symbol6Plot4.HideTitle();
Symbol6Plot5.HideTitle();
def highestBarSymbol6 = HighestAll( if IsNaN(close) then Double.NaN else barNumber() );
def referenceBarSymbol6 = highestBarSymbol6 - y;
AddChartBubble( barNumber() == referenceBarSymbol6,symbol6Signal,"6:"+symbol6,Color.GREEN);



################## -----------  SYMBOL #7
def ema1Symbol7 = expAverage(close(symbol7), Length1);
def ema2Symbol7 = expAverage(close(symbol7), Length2);
def ema3Symbol7 = expAverage(close(symbol7), Length3);
def ema4Symbol7 = expAverage(close(symbol7), Length4);

def u1Symbol7 = ema1Symbol7 > ema2Symbol7;
def u2Symbol7 = ema2Symbol7 > ema3Symbol7;
def u3Symbol7 = ema3Symbol7 > ema4Symbol7;

def d1Symbol7 = ema1Symbol7 < ema2Symbol7;
def d2Symbol7 = ema2Symbol7 < ema3Symbol7;
def d3Symbol7 = ema3Symbol7 < ema4Symbol7;

def trendStrengthSymbol7 = if (u1Symbol7 and u2Symbol7 and u3Symbol7) then 2 else if (u1Symbol7 and u2Symbol7 and !u3Symbol7) then 1 else if (d1Symbol7 and d2Symbol7 and d3Symbol7) then -2 else if (d1Symbol7 and d2Symbol7 and !d3Symbol7) then -1 else 0;

plot Symbol7Plot1 = if trendStrengthSymbol7 == 2 then symbol7Signal else Double.NaN;
Symbol7Plot1.SetPaintingStrategy(PaintingStrategy.LINE_VS_SQUARES);
Symbol7Plot1.SetLineWeight(3);
Symbol7Plot1.AssignValueColor(COLOR.GREEN);
plot Symbol7Plot2 = if trendStrengthSymbol7 == 1 then symbol7Signal else Double.NaN;
Symbol7Plot2.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
Symbol7Plot2.SetLineWeight(3);
Symbol7Plot2.AssignValueColor(COLOR.DARK_GREEN);
plot Symbol7Plot3 = if trendStrengthSymbol7 == -2 then symbol7Signal else Double.NaN;
Symbol7Plot3.SetPaintingStrategy(PaintingStrategy.LINE_VS_SQUARES);
Symbol7Plot3.SetLineWeight(3);
Symbol7Plot3.AssignValueColor(COLOR.RED);
plot Symbol7Plot4 = if trendStrengthSymbol7 == -1 then symbol7Signal else Double.NaN;
Symbol7Plot4.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
Symbol7Plot4.SetLineWeight(3);
Symbol7Plot4.AssignValueColor(COLOR.DARK_RED);
plot Symbol7Plot5 = if trendStrengthSymbol7 == 0 then symbol7Signal else Double.NaN;
Symbol7Plot5.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
Symbol7Plot5.SetLineWeight(3);
Symbol7Plot5.AssignValueColor(COLOR.YELLOW);
Symbol7Plot1.HideTitle();
Symbol7Plot2.HideTitle();
Symbol7Plot3.HideTitle();
Symbol7Plot4.HideTitle();
Symbol7Plot5.HideTitle();
def highestBarSymbol7 = HighestAll( if IsNaN(close) then Double.NaN else barNumber() );
def referenceBarSymbol7 = highestBarSymbol7 - x;
AddChartBubble( barNumber() == referenceBarSymbol7,symbol7Signal,"7:"+symbol7,Color.GREEN);



################## -----------  SYMBOL #8
def ema1Symbol8 = expAverage(close(symbol8), Length1);
def ema2Symbol8 = expAverage(close(symbol8), Length2);
def ema3Symbol8 = expAverage(close(symbol8), Length3);
def ema4Symbol8 = expAverage(close(symbol8), Length4);

def u1Symbol8 = ema1Symbol8 > ema2Symbol8;
def u2Symbol8 = ema2Symbol8 > ema3Symbol8;
def u3Symbol8 = ema3Symbol8 > ema4Symbol8;

def d1Symbol8 = ema1Symbol8 < ema2Symbol8;
def d2Symbol8 = ema2Symbol8 < ema3Symbol8;
def d3Symbol8 = ema3Symbol8 < ema4Symbol8;

def trendStrengthSymbol8 = if (u1Symbol8 and u2Symbol8 and u3Symbol8) then 2 else if (u1Symbol8 and u2Symbol8 and !u3Symbol8) then 1 else if (d1Symbol8 and d2Symbol8 and d3Symbol8) then -2 else if (d1Symbol8 and d2Symbol8 and !d3Symbol8) then -1 else 0;

plot Symbol8Plot1 = if trendStrengthSymbol8 == 2 then symbol8Signal else Double.NaN;
Symbol8Plot1.SetPaintingStrategy(PaintingStrategy.LINE_VS_SQUARES);
Symbol8Plot1.SetLineWeight(3);
Symbol8Plot1.AssignValueColor(COLOR.GREEN);
plot Symbol8Plot2 = if trendStrengthSymbol8 == 1 then symbol8Signal else Double.NaN;
Symbol8Plot2.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
Symbol8Plot2.SetLineWeight(3);
Symbol8Plot2.AssignValueColor(COLOR.DARK_GREEN);
plot Symbol8Plot3 = if trendStrengthSymbol8 == -2 then symbol8Signal else Double.NaN;
Symbol8Plot3.SetPaintingStrategy(PaintingStrategy.LINE_VS_SQUARES);
Symbol8Plot3.SetLineWeight(3);
Symbol8Plot3.AssignValueColor(COLOR.RED);
plot Symbol8Plot4 = if trendStrengthSymbol8 == -1 then symbol8Signal else Double.NaN;
Symbol8Plot4.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
Symbol8Plot4.SetLineWeight(3);
Symbol8Plot4.AssignValueColor(COLOR.DARK_RED);
plot Symbol8Plot5 = if trendStrengthSymbol8 == 0 then symbol8Signal else Double.NaN;
Symbol8Plot5.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
Symbol8Plot5.SetLineWeight(3);
Symbol8Plot5.AssignValueColor(COLOR.YELLOW);
Symbol8Plot1.HideTitle();
Symbol8Plot2.HideTitle();
Symbol8Plot3.HideTitle();
Symbol8Plot4.HideTitle();
Symbol8Plot5.HideTitle();
def highestBarSymbol8 = HighestAll( if IsNaN(close) then Double.NaN else barNumber() );
def referenceBarSymbol8 = highestBarSymbol8 - y;
AddChartBubble( barNumber() == referenceBarSymbol8,symbol8Signal,"8:"+symbol8,Color.GREEN);




################## -----------  SYMBOL #9
def ema1Symbol9 = expAverage(close(symbol9), Length1);
def ema2Symbol9 = expAverage(close(symbol9), Length2);
def ema3Symbol9 = expAverage(close(symbol9), Length3);
def ema4Symbol9 = expAverage(close(symbol9), Length4);

def u1Symbol9 = ema1Symbol9 > ema2Symbol9;
def u2Symbol9 = ema2Symbol9 > ema3Symbol9;
def u3Symbol9 = ema3Symbol9 > ema4Symbol9;

def d1Symbol9 = ema1Symbol9 < ema2Symbol9;
def d2Symbol9 = ema2Symbol9 < ema3Symbol9;
def d3Symbol9 = ema3Symbol9 < ema4Symbol9;

def trendStrengthSymbol9 = if (u1Symbol9 and u2Symbol9 and u3Symbol9) then 2 else if (u1Symbol9 and u2Symbol9 and !u3Symbol9) then 1 else if (d1Symbol9 and d2Symbol9 and d3Symbol9) then -2 else if (d1Symbol9 and d2Symbol9 and !d3Symbol9) then -1 else 0;

plot Symbol9Plot1 = if trendStrengthSymbol9 == 2 then symbol9Signal else Double.NaN;
Symbol9Plot1.SetPaintingStrategy(PaintingStrategy.LINE_VS_SQUARES);
Symbol9Plot1.SetLineWeight(3);
Symbol9Plot1.AssignValueColor(COLOR.GREEN);
plot Symbol9Plot2 = if trendStrengthSymbol9 == 1 then symbol9Signal else Double.NaN;
Symbol9Plot2.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
Symbol9Plot2.SetLineWeight(3);
Symbol9Plot2.AssignValueColor(COLOR.DARK_GREEN);
plot Symbol9Plot3 = if trendStrengthSymbol9 == -2 then symbol9Signal else Double.NaN;
Symbol9Plot3.SetPaintingStrategy(PaintingStrategy.LINE_VS_SQUARES);
Symbol9Plot3.SetLineWeight(3);
Symbol9Plot3.AssignValueColor(COLOR.RED);
plot Symbol9Plot4 = if trendStrengthSymbol9 == -1 then symbol9Signal else Double.NaN;
Symbol9Plot4.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
Symbol9Plot4.SetLineWeight(3);
Symbol9Plot4.AssignValueColor(COLOR.DARK_RED);
plot Symbol9Plot5 = if trendStrengthSymbol9 == 0 then symbol9Signal else Double.NaN;
Symbol9Plot5.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
Symbol9Plot5.SetLineWeight(3);
Symbol9Plot5.AssignValueColor(COLOR.YELLOW);
Symbol9Plot1.HideTitle();
Symbol9Plot2.HideTitle();
Symbol9Plot3.HideTitle();
Symbol9Plot4.HideTitle();
Symbol9Plot5.HideTitle();
def highestBarSymbol9 = HighestAll( if IsNaN(close) then Double.NaN else barNumber() );
def referenceBarSymbol9 = highestBarSymbol9 - x;
AddChartBubble( barNumber() == referenceBarSymbol9,symbol9Signal,"9:"+symbol9,Color.GREEN);




################## -----------  SYMBOL #10
def ema1Symbol10 = expAverage(close(symbol10), Length1);
def ema2Symbol10 = expAverage(close(symbol10), Length2);
def ema3Symbol10 = expAverage(close(symbol10), Length3);
def ema4Symbol10 = expAverage(close(symbol10), Length4);

def u1Symbol10 = ema1Symbol10 > ema2Symbol10;
def u2Symbol10 = ema2Symbol10 > ema3Symbol10;
def u3Symbol10 = ema3Symbol10 > ema4Symbol10;

def d1Symbol10 = ema1Symbol10 < ema2Symbol10;
def d2Symbol10 = ema2Symbol10 < ema3Symbol10;
def d3Symbol10 = ema3Symbol10 < ema4Symbol10;

def trendStrengthSymbol10 = if (u1Symbol10 and u2Symbol10 and u3Symbol10) then 2 else if (u1Symbol10 and u2Symbol10 and !u3Symbol10) then 1 else if (d1Symbol10 and d2Symbol10 and d3Symbol10) then -2 else if (d1Symbol10 and d2Symbol10 and !d3Symbol10) then -1 else 0;

plot Symbol10Plot1 = if trendStrengthSymbol10 == 2 then symbol10Signal else Double.NaN;
Symbol10Plot1.SetPaintingStrategy(PaintingStrategy.LINE_VS_SQUARES);
Symbol10Plot1.SetLineWeight(3);
Symbol10Plot1.AssignValueColor(COLOR.GREEN);
plot Symbol10Plot2 = if trendStrengthSymbol10 == 1 then symbol10Signal else Double.NaN;
Symbol10Plot2.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
Symbol10Plot2.SetLineWeight(3);
Symbol10Plot2.AssignValueColor(COLOR.DARK_GREEN);
plot Symbol10Plot3 = if trendStrengthSymbol10 == -2 then symbol10Signal else Double.NaN;
Symbol10Plot3.SetPaintingStrategy(PaintingStrategy.LINE_VS_SQUARES);
Symbol10Plot3.SetLineWeight(3);
Symbol10Plot3.AssignValueColor(COLOR.RED);
plot Symbol10Plot4 = if trendStrengthSymbol10 == -1 then symbol10Signal else Double.NaN;
Symbol10Plot4.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
Symbol10Plot4.SetLineWeight(3);
Symbol10Plot4.AssignValueColor(COLOR.DARK_RED);
plot Symbol10Plot5 = if trendStrengthSymbol10 == 0 then symbol10Signal else Double.NaN;
Symbol10Plot5.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
Symbol10Plot5.SetLineWeight(3);
Symbol10Plot5.AssignValueColor(COLOR.YELLOW);
Symbol10Plot1.HideTitle();
Symbol10Plot2.HideTitle();
Symbol10Plot3.HideTitle();
Symbol10Plot4.HideTitle();
Symbol10Plot5.HideTitle();
def highestBarSymbol10 = HighestAll( if IsNaN(close) then Double.NaN else barNumber() );
def referenceBarSymbol10 = highestBarSymbol10 - y;
AddChartBubble( barNumber() == referenceBarSymbol10,symbol10Signal,"10:"+symbol10,Color.GREEN);

################## -----------  SYMBOL #11
def ema1Symbol11 = expAverage(close(symbol11), Length1);
def ema2Symbol11 = expAverage(close(symbol11), Length2);
def ema3Symbol11 = expAverage(close(symbol11), Length3);
def ema4Symbol11 = expAverage(close(symbol11), Length4);

def u1Symbol11 = ema1Symbol11 > ema2Symbol11;
def u2Symbol11 = ema2Symbol11 > ema3Symbol11;
def u3Symbol11 = ema3Symbol11 > ema4Symbol11;

def d1Symbol11 = ema1Symbol11 < ema2Symbol11;
def d2Symbol11 = ema2Symbol11 < ema3Symbol11;
def d3Symbol11 = ema3Symbol11 < ema4Symbol11;

def trendStrengthSymbol11 = if (u1Symbol11 and u2Symbol11 and u3Symbol11) then 2 else if (u1Symbol11 and u2Symbol11 and !u3Symbol11) then 1 else if (d1Symbol11 and d2Symbol11 and d3Symbol11) then -2 else if (d1Symbol11 and d2Symbol11 and !d3Symbol11) then -1 else 0;

plot Symbol11Plot1 = if trendStrengthSymbol11 == 2 then symbol11Signal else Double.NaN;
Symbol11Plot1.SetPaintingStrategy(PaintingStrategy.LINE_VS_SQUARES);
Symbol11Plot1.SetLineWeight(3);
Symbol11Plot1.AssignValueColor(COLOR.GREEN);
plot Symbol11Plot2 = if trendStrengthSymbol11 == 1 then symbol11Signal else Double.NaN;
Symbol11Plot2.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
Symbol11Plot2.SetLineWeight(3);
Symbol11Plot2.AssignValueColor(COLOR.DARK_GREEN);
plot Symbol11Plot3 = if trendStrengthSymbol11 == -2 then symbol11Signal else Double.NaN;
Symbol11Plot3.SetPaintingStrategy(PaintingStrategy.LINE_VS_SQUARES);
Symbol11Plot3.SetLineWeight(3);
Symbol11Plot3.AssignValueColor(COLOR.RED);
plot Symbol11Plot4 = if trendStrengthSymbol11 == -1 then symbol11Signal else Double.NaN;
Symbol11Plot4.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
Symbol11Plot4.SetLineWeight(3);
Symbol11Plot4.AssignValueColor(COLOR.DARK_RED);
plot Symbol11Plot5 = if trendStrengthSymbol11 == 0 then symbol11Signal else Double.NaN;
Symbol11Plot5.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
Symbol11Plot5.SetLineWeight(3);
Symbol11Plot5.AssignValueColor(COLOR.YELLOW);
Symbol11Plot1.HideTitle();
Symbol11Plot2.HideTitle();
Symbol11Plot3.HideTitle();
Symbol11Plot4.HideTitle();
Symbol11Plot5.HideTitle();
def highestBarSymbol11 = HighestAll( if IsNaN(close) then Double.NaN else barNumber() );
def referenceBarSymbol11 = highestBarSymbol11 - x;
AddChartBubble( barNumber() == referenceBarSymbol11,symbol11Signal,"11:"+symbol11,Color.GREEN);

################## -----------  SYMBOL #12
def ema1Symbol12 = expAverage(close(symbol12), Length1);
def ema2Symbol12 = expAverage(close(symbol12), Length2);
def ema3Symbol12 = expAverage(close(symbol12), Length3);
def ema4Symbol12 = expAverage(close(symbol12), Length4);

def u1Symbol12 = ema1Symbol12 > ema2Symbol12;
def u2Symbol12 = ema2Symbol12 > ema3Symbol12;
def u3Symbol12 = ema3Symbol12 > ema4Symbol12;

def d1Symbol12 = ema1Symbol12 < ema2Symbol12;
def d2Symbol12 = ema2Symbol12 < ema3Symbol12;
def d3Symbol12 = ema3Symbol12 < ema4Symbol12;

def trendStrengthSymbol12 = if (u1Symbol12 and u2Symbol12 and u3Symbol12) then 2 else if (u1Symbol12 and u2Symbol12 and !u3Symbol12) then 1 else if (d1Symbol12 and d2Symbol12 and d3Symbol12) then -2 else if (d1Symbol12 and d2Symbol12 and !d3Symbol12) then -1 else 0;

plot Symbol12Plot1 = if trendStrengthSymbol12 == 2 then symbol12Signal else Double.NaN;
Symbol12Plot1.SetPaintingStrategy(PaintingStrategy.LINE_VS_SQUARES);
Symbol12Plot1.SetLineWeight(3);
Symbol12Plot1.AssignValueColor(COLOR.GREEN);
plot Symbol12Plot2 = if trendStrengthSymbol12 == 1 then symbol12Signal else Double.NaN;
Symbol12Plot2.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
Symbol12Plot2.SetLineWeight(3);
Symbol12Plot2.AssignValueColor(COLOR.DARK_GREEN);
plot Symbol12Plot3 = if trendStrengthSymbol12 == -2 then symbol12Signal else Double.NaN;
Symbol12Plot3.SetPaintingStrategy(PaintingStrategy.LINE_VS_SQUARES);
Symbol12Plot3.SetLineWeight(3);
Symbol12Plot3.AssignValueColor(COLOR.RED);
plot Symbol12Plot4 = if trendStrengthSymbol12 == -1 then symbol12Signal else Double.NaN;
Symbol12Plot4.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
Symbol12Plot4.SetLineWeight(3);
Symbol12Plot4.AssignValueColor(COLOR.DARK_RED);
plot Symbol12Plot5 = if trendStrengthSymbol12 == 0 then symbol12Signal else Double.NaN;
Symbol12Plot5.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
Symbol12Plot5.SetLineWeight(3);
Symbol12Plot5.AssignValueColor(COLOR.YELLOW);
Symbol12Plot1.HideTitle();
Symbol12Plot2.HideTitle();
Symbol12Plot3.HideTitle();
Symbol12Plot4.HideTitle();
Symbol12Plot5.HideTitle();
def highestBarSymbol12 = HighestAll( if IsNaN(close) then Double.NaN else barNumber() );
def referenceBarSymbol12 = highestBarSymbol12 - y;
AddChartBubble( barNumber() == referenceBarSymbol12,symbol12Signal,"12:"+symbol12,Color.GREEN);

################## -----------  SYMBOL #13
def ema1Symbol13 = expAverage(close(symbol13), Length1);
def ema2Symbol13 = expAverage(close(symbol13), Length2);
def ema3Symbol13 = expAverage(close(symbol13), Length3);
def ema4Symbol13 = expAverage(close(symbol13), Length4);

def u1Symbol13 = ema1Symbol13 > ema2Symbol13;
def u2Symbol13 = ema2Symbol13 > ema3Symbol13;
def u3Symbol13 = ema3Symbol13 > ema4Symbol13;

def d1Symbol13 = ema1Symbol13 < ema2Symbol13;
def d2Symbol13 = ema2Symbol13 < ema3Symbol13;
def d3Symbol13 = ema3Symbol13 < ema4Symbol13;

def trendStrengthSymbol13 = if (u1Symbol13 and u2Symbol13 and u3Symbol13) then 2 else if (u1Symbol13 and u2Symbol13 and !u3Symbol13) then 1 else if (d1Symbol13 and d2Symbol13 and d3Symbol13) then -2 else if (d1Symbol13 and d2Symbol13 and !d3Symbol13) then -1 else 0;

plot Symbol13Plot1 = if trendStrengthSymbol13 == 2 then symbol13Signal else Double.NaN;
Symbol13Plot1.SetPaintingStrategy(PaintingStrategy.LINE_VS_SQUARES);
Symbol13Plot1.SetLineWeight(3);
Symbol13Plot1.AssignValueColor(COLOR.GREEN);
plot Symbol13Plot2 = if trendStrengthSymbol13 == 1 then symbol13Signal else Double.NaN;
Symbol13Plot2.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
Symbol13Plot2.SetLineWeight(3);
Symbol13Plot2.AssignValueColor(COLOR.DARK_GREEN);
plot Symbol13Plot3 = if trendStrengthSymbol13 == -2 then symbol13Signal else Double.NaN;
Symbol13Plot3.SetPaintingStrategy(PaintingStrategy.LINE_VS_SQUARES);
Symbol13Plot3.SetLineWeight(3);
Symbol13Plot3.AssignValueColor(COLOR.RED);
plot Symbol13Plot4 = if trendStrengthSymbol13 == -1 then symbol13Signal else Double.NaN;
Symbol13Plot4.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
Symbol13Plot4.SetLineWeight(3);
Symbol13Plot4.AssignValueColor(COLOR.DARK_RED);
plot Symbol13Plot5 = if trendStrengthSymbol13 == 0 then symbol13Signal else Double.NaN;
Symbol13Plot5.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
Symbol13Plot5.SetLineWeight(3);
Symbol13Plot5.AssignValueColor(COLOR.YELLOW);
Symbol13Plot1.HideTitle();
Symbol13Plot2.HideTitle();
Symbol13Plot3.HideTitle();
Symbol13Plot4.HideTitle();
Symbol13Plot5.HideTitle();
def highestBarSymbol13 = HighestAll( if IsNaN(close) then Double.NaN else barNumber() );
def referenceBarSymbol13 = highestBarSymbol13 - x;
AddChartBubble( barNumber() == referenceBarSymbol13,symbol13Signal,"13:"+symbol13,Color.GREEN);

################## -----------  SYMBOL #14
def ema1Symbol14 = expAverage(close(symbol14), Length1);
def ema2Symbol14 = expAverage(close(symbol14), Length2);
def ema3Symbol14 = expAverage(close(symbol14), Length3);
def ema4Symbol14 = expAverage(close(symbol14), Length4);

def u1Symbol14 = ema1Symbol14 > ema2Symbol14;
def u2Symbol14 = ema2Symbol14 > ema3Symbol14;
def u3Symbol14 = ema3Symbol14 > ema4Symbol14;

def d1Symbol14 = ema1Symbol14 < ema2Symbol14;
def d2Symbol14 = ema2Symbol14 < ema3Symbol14;
def d3Symbol14 = ema3Symbol14 < ema4Symbol14;

def trendStrengthSymbol14 = if (u1Symbol14 and u2Symbol14 and u3Symbol14) then 2 else if (u1Symbol14 and u2Symbol14 and !u3Symbol14) then 1 else if (d1Symbol14 and d2Symbol14 and d3Symbol14) then -2 else if (d1Symbol14 and d2Symbol14 and !d3Symbol14) then -1 else 0;

plot Symbol14Plot1 = if trendStrengthSymbol14 == 2 then symbol14Signal else Double.NaN;
Symbol14Plot1.SetPaintingStrategy(PaintingStrategy.LINE_VS_SQUARES);
Symbol14Plot1.SetLineWeight(3);
Symbol14Plot1.AssignValueColor(COLOR.GREEN);
plot Symbol14Plot2 = if trendStrengthSymbol14 == 1 then symbol14Signal else Double.NaN;
Symbol14Plot2.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
Symbol14Plot2.SetLineWeight(3);
Symbol14Plot2.AssignValueColor(COLOR.DARK_GREEN);
plot Symbol14Plot3 = if trendStrengthSymbol14 == -2 then symbol14Signal else Double.NaN;
Symbol14Plot3.SetPaintingStrategy(PaintingStrategy.LINE_VS_SQUARES);
Symbol14Plot3.SetLineWeight(3);
Symbol14Plot3.AssignValueColor(COLOR.RED);
plot Symbol14Plot4 = if trendStrengthSymbol14 == -1 then symbol14Signal else Double.NaN;
Symbol14Plot4.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
Symbol14Plot4.SetLineWeight(3);
Symbol14Plot4.AssignValueColor(COLOR.DARK_RED);
plot Symbol14Plot5 = if trendStrengthSymbol14 == 0 then symbol14Signal else Double.NaN;
Symbol14Plot5.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
Symbol14Plot5.SetLineWeight(3);
Symbol14Plot5.AssignValueColor(COLOR.YELLOW);
Symbol14Plot1.HideTitle();
Symbol14Plot2.HideTitle();
Symbol14Plot3.HideTitle();
Symbol14Plot4.HideTitle();
Symbol14Plot5.HideTitle();
def highestBarSymbol14 = HighestAll( if IsNaN(close) then Double.NaN else barNumber() );
def referenceBarSymbol14 = highestBarSymbol14 - y;
AddChartBubble( barNumber() == referenceBarSymbol14,symbol14Signal,"14:"+symbol14,Color.GREEN);
Can you add code so the label bubbles reflect the trend color? Thanks for this!
 

cos251

Well-known member

rad14733

Well-known member
VIP
@joe362 If you were to examine the code I think you'd find the answer... Just a hunch without checking the code but I'm fairly certain that there would be a line of code with PaintingStrategy.DOTS in it that could be changed to PaintingStrategy.LINE_VS_POINTS to achieve that output...
 

joe362

Member
@joe362 If you were to examine the code I think you'd find the answer... Just a hunch without checking the code but I'm fairly certain that there would be a line of code with PaintingStrategy.DOTS in it that could be changed to PaintingStrategy.LINE_VS_POINTS to achieve that output...
Thanks for respond, I checked the whole program didn't have PaintingStrategy.DOTS.
If you don't mind, Can you give me a line number so I mortify the code . Thanks
 
Last edited:
The this works is it allows you to watch multiple stocks or ETF's on a daily chart linearly. How I use it is I have multiple version of the indicator. 1 for the main ETF'S like the IWM QQQ and the SPY as well as all the S&P sectors so I can at a glance so what sector has had a pull back and is very strong for the day (green squares show strong upward trend.) Then I have version of the phoenix finder that has a selections of stocks from each sector.

So say XLK has been very strong which is the tech sector of the S&P. I pull my XLK phoenix finder up which lists my stocks from the tech sector I love to trade. This includes AAPL, MSFT, NVDA, CRM, etc. I do an over all check on the stocks. Are they all in a strong trend up or are just a few of them pushing the XLK to be green. If the last one is the case then I move on to the other sectors that were strong on the first phoenix finder. But if it's the first option and all or most of the stocks are very strong then I will go to their charts and look at the 15min chart and look for a pull back to get in.

I've only been using this technique this past week but it really seems to add more power to my trades. I also pair this with the TTM Squeeze, the Moxie Arrows, the Phoenix StrengthTrend Candles, and the 8,21,34 EMA's.
how do you change the script from etfs to certain stocks?
 

New Indicator: Buy the Dip

Check out our Buy the Dip indicator and see how it can help you find profitable swing trading ideas. Scanner, watchlist columns, and add-ons are included.

Download the indicator

Similar threads

Top