JT_MultiTrend?

tonight

New member
I was wondering if anyone had or had coded the JT_MultiTrend that Raghee Horner uses?
It is the 2 red, green, yellow, gray cloud indicators across the bottom of the charts in the video below.


The way I understand it is. The JT_MultiTrend is the exact same thing as her 8:13:21 and WAVE labels
at the top left of the charts in the video below, but the flags just show today position and the JTMultiTrend shows all of the back history,
like any other indicator does. Also this video happen to show both on then same chart.
So it is probably a better example of what I am talking about?


I have actually found the 2 label indicators on the internet but I don't know how to change them to the 2 bottom indicators?

Does anyone happen to have them available? Or could maybe change the labels stuff I have to the bottom indicators?

Thanks for any help.
 
@tonight you are correct that the JT_MultiTrend is the same as the Trend labels except that plotting clouds and borders have been added in order to use it as a lower study.
Try this:
Code:
input numadditionalSymbols = 1;
def topnum = min(numadditionalSymbols * 2 + 2,20);
plot border = topnum + 7.5;
AddCloud(if bullish then topnum else if topnum - 1 <= 0 then 0 else topnum - 1, if bearish then topnum else if topnum - 1 <= 0 then 0 else topnum - 1 , color1 = Color.GREEN, showBorder = yes);
AddCloud(if bullish == 0 and bearish == 0 then topnum else if topnum - 1 <= 0 then 0 else topnum - 1, if topnum - 2 <= 0 then 0 else topnum - 2 , color1 = Color.GRAY, Color.GRAY, showBorder = yes);
AddCloud(data1 = if IsSidewaysWave then if topnum - 1 <= 0 then 0 else topnum - 1 else if topnum - 2 <= 0 then 0 else topnum - 2, data2 = if topnum - 2 <= 0 then 0 else topnum - 2, color2 = Color.YELLOW, showBorder = yes);
AddCloud(if IsBullishWave then if topnum - 1 <= 0 then 0 else topnum - 1 else if topnum - 2 <= 0 then 0 else topnum - 2, if IsBearishWave then if topnum - 1 <= 0 then 0 else topnum - 1 else if topnum - 2 <= 0 then 0 else topnum - 2, color1 = Color.GREEN, showBorder = yes);
 
Last edited by a moderator:

Join useThinkScript to post your question to a community of 21,000+ developers and traders.

I was wondering if anyone had or had coded the JT_MultiTrend that Raghee Horner uses?
It is the 2 red, green, yellow, gray cloud indicators across the bottom of the charts in the video below.


The way I understand it is. The JT_MultiTrend is the exact same thing as her 8:13:21 and WAVE labels
at the top left of the charts in the video below, but the flags just show today position and the JTMultiTrend shows all of the back history,
like any other indicator does. Also this video happen to show both on then same chart.
So it is probably a better example of what I am talking about?


I have actually found the 2 label indicators on the internet but I don't know how to change them to the 2 bottom indicators?

Does anyone happen to have them available? Or could maybe change the labels stuff I have to the bottom indicators?

Thanks for any help.
Could you share where you found the two label on the internet?
 
Here you go bud...

Code:
def stackedUp = MovAvgExponential("length" = 8)."AvgExp" is greater than MovAvgExponential("length" = 13)."AvgExp"
and MovAvgExponential("length" = 13)."AvgExp" is greater than MovAvgExponential("length" = 21)."AvgExp";

def WaveUp = MovAvgExponential("length" = 21)."AvgExp" is greater than MovAvgExponential("length" = 34)."AvgExp";

def WaveDown = MovAvgExponential("length" = 21)."AvgExp" is less than MovAvgExponential("length" = 34)."AvgExp";


def stackedDown = MovAvgExponential("length" = 8)."AvgExp" is less than MovAvgExponential("length" = 13)."AvgExp"
and MovAvgExponential("length" = 13)."AvgExp" is less than MovAvgExponential("length" = 21)."AvgExp";


AddLabel(yes, " 8:13:21 ", if stackedUp then Color.GREEN else if stackedDown then Color.RED else Color.GRAY);

AddLabel(yes, " Wave ", if WaveUp then Color.GREEN else if WaveDown then Color.Yellow else Color.GRAY);


input numadditionalSymbols = 1;
def topnum = min(numadditionalSymbols * 2 + 2,20);
plot border = topnum + 1;

AddCloud(if stackedUp then topnum else if topnum - 1 <= 0 then 0 else topnum - 1, if stackedDown then topnum else if topnum - 1 <= 0 then 0 else topnum - 1 , color1 = Color.GREEN, showBorder = yes);

AddCloud(if stackedUp == 0 and stackedDown == 0 then topnum else if topnum - 1 <= 0 then 0 else topnum - 1, if topnum - 2 <= 0 then 0 else topnum - 2 , color1 = Color.GRAY, Color.GRAY, showBorder = yes);

AddCloud(data1 = if WaveDown then if topnum - 1 <= 0 then 0 else topnum - 1 else if topnum - 2 <= 0 then 0 else topnum - 2, data2 = if topnum - 2 <= 0 then 0 else topnum - 2, color2 = Color.YELLOW, showBorder = yes);

AddCloud(if WaveUp then if topnum - 1 <= 0 then 0 else topnum - 1 else if topnum - 2 <= 0 then 0 else topnum - 2, if WaveDown then if topnum - 1 <= 0 then 0 else topnum - 1 else if topnum - 2 <= 0 then 0 else topnum - 2, color1 = Color.GREEN, showBorder = yes);
 
Here you go bud...

Code:
def stackedUp = MovAvgExponential("length" = 8)."AvgExp" is greater than MovAvgExponential("length" = 13)."AvgExp"
and MovAvgExponential("length" = 13)."AvgExp" is greater than MovAvgExponential("length" = 21)."AvgExp";

def WaveUp = MovAvgExponential("length" = 21)."AvgExp" is greater than MovAvgExponential("length" = 34)."AvgExp";

def WaveDown = MovAvgExponential("length" = 21)."AvgExp" is less than MovAvgExponential("length" = 34)."AvgExp";


def stackedDown = MovAvgExponential("length" = 8)."AvgExp" is less than MovAvgExponential("length" = 13)."AvgExp"
and MovAvgExponential("length" = 13)."AvgExp" is less than MovAvgExponential("length" = 21)."AvgExp";


AddLabel(yes, " 8:13:21 ", if stackedUp then Color.GREEN else if stackedDown then Color.RED else Color.GRAY);

AddLabel(yes, " Wave ", if WaveUp then Color.GREEN else if WaveDown then Color.Yellow else Color.GRAY);


input numadditionalSymbols = 1;
def topnum = min(numadditionalSymbols * 2 + 2,20);
plot border = topnum + 1;

AddCloud(if stackedUp then topnum else if topnum - 1 <= 0 then 0 else topnum - 1, if stackedDown then topnum else if topnum - 1 <= 0 then 0 else topnum - 1 , color1 = Color.GREEN, showBorder = yes);

AddCloud(if stackedUp == 0 and stackedDown == 0 then topnum else if topnum - 1 <= 0 then 0 else topnum - 1, if topnum - 2 <= 0 then 0 else topnum - 2 , color1 = Color.GRAY, Color.GRAY, showBorder = yes);

AddCloud(data1 = if WaveDown then if topnum - 1 <= 0 then 0 else topnum - 1 else if topnum - 2 <= 0 then 0 else topnum - 2, data2 = if topnum - 2 <= 0 then 0 else topnum - 2, color2 = Color.YELLOW, showBorder = yes);

AddCloud(if WaveUp then if topnum - 1 <= 0 then 0 else topnum - 1 else if topnum - 2 <= 0 then 0 else topnum - 2, if WaveDown then if topnum - 1 <= 0 then 0 else topnum - 1 else if topnum - 2 <= 0 then 0 else topnum - 2, color1 = Color.GREEN, showBorder = yes);

Dsharpeatl, Thanks for the labels but I am a little confused. Am I supposed to add this to an existing code to get the bottom side of her indicator?
 
I was wondering if anyone had or had coded the JT_MultiTrend that Raghee Horner uses?
It is the 2 red, green, yellow, gray cloud indicators across the bottom of the charts in the video below.


The way I understand it is. The JT_MultiTrend is the exact same thing as her 8:13:21 and WAVE labels
at the top left of the charts in the video below, but the flags just show today position and the JTMultiTrend shows all of the back history,
like any other indicator does. Also this video happen to show both on then same chart.
So it is probably a better example of what I am talking about?


I have actually found the 2 label indicators on the internet but I don't know how to change them to the 2 bottom indicators?

Does anyone happen to have them available? Or could maybe change the labels stuff I have to the bottom indicators?

Thanks for any help.
Have you found the entire code you are looking for? I am looking for the same one.
 
Rob B and dsharpeatl,

Sorry it has took so long to get back, but I have been away for a while and I don't look here much because I am not a programmer etc.

dsharpeatl: I am not a coder but it should be simple for a coder to change the last part of the plot code to plots dots.

Rob B:

This is the code I have, Hope it helps.


declare lower;

# JT_Trends (c) Jeff Thaw 2018
# 2 indicators, 1st is the relationship of 8:13:21, to help with Squeeze
# 2nd adds in the relationship of the 34, to get the trend of the 34Wave

input Show81321Label = yes;
input ShowWaveTrendLabel = yes;


DefineGlobalColor("Bullish", Color.GREEN);
DefineGlobalColor("Sideways", Color.YELLOW);
DefineGlobalColor("Bearish", Color.RED);

def EMA34High = ExpAverage (high, 34); #was ema1_34
def EMA34Close = ExpAverage (close, 34); #ema2_34
def EMA34Low = ExpAverage (low, 34); # was ema3_34
def EMA8 = ExpAverage(close, 8); #JT Changed var name from EMA1 to EMA8
def EMA21 = ExpAverage(close, 21); #JT Changed var name from EMA2 to EMA21
def EMA13 = ExpAverage (close, 13);


def bullish = (EMA8 > EMA13) and (EMA13 > EMA21);
def bearish = (EMA8 < EMA13) and (EMA13 < EMA21);

def WaveState = {default SW, Bullish, Bearish}; #SW = sideways
WaveState = if (EMA8 > EMA13) and (EMA13 > EMA21) and (EMA21 > EMA34High)
then WaveState.Bullish
else if (EMA8 < EMA13) and (EMA13 < EMA21) and (EMA21 < EMA34Low)
then WaveState.Bearish
else WaveState.SW;


def IsBullishWave = WaveState == WaveState.Bullish;
def IsBearishWave = WaveState == WaveState.Bearish;
def IsSidewaysWave = WaveState == WaveState.SW;

AddLabel(Show81321Label, "8:13:21: " + if bullish then "Bullish" else if bearish then "Bearish" else "Slop", if bullish then GlobalColor("Bullish") else if bearish then GlobalColor("Bearish") else GlobalColor("Sideways"));

AddLabel(ShowWaveTrendLabel, "Wave: " + if IsBullishWave then "Bullish" else if IsBearishWave then "Bearish" else "S/W", if IsBullishWave then GlobalColor("Bullish") else if IsBearishWave then GlobalColor("Bearish") else GlobalColor("Sideways"));

#adding a blank label after as a spacer

input numadditionalSymbols = 1;
def topnum = Min(numadditionalSymbols * 2 + 2, 20);
plot border = topnum + 7.5;
AddCloud(if bullish then topnum else if topnum - 1 <= 0 then 0 else topnum - 1, if bearish then topnum else if topnum - 1 <= 0 then 0 else topnum - 1 , color1 = Color.GREEN, showBorder = yes);
AddCloud(if bullish == 0 and bearish == 0 then topnum else if topnum - 1 <= 0 then 0 else topnum - 1, if topnum - 2 <= 0 then 0 else topnum - 2 , color1 = Color.GRAY, Color.GRAY, showBorder = yes);
AddCloud(data1 = if IsSidewaysWave then if topnum - 1 <= 0 then 0 else topnum - 1 else if topnum - 2 <= 0 then 0 else topnum - 2, data2 = if topnum - 2 <= 0 then 0 else topnum - 2, color2 = Color.YELLOW, showBorder = yes);
AddCloud(if IsBullishWave then if topnum - 1 <= 0 then 0 else topnum - 1 else if topnum - 2 <= 0 then 0 else topnum - 2, if IsBearishWave then if topnum - 1 <= 0 then 0 else topnum - 1 else if topnum - 2 <= 0 then 0 else topnum - 2, color1 = Color.GREEN, showBorder = yes);
 
Anyone have the code or know how to change from the old "AddCloud" view to the newer view with just dots? I tried for hours today to make the change and couldn't figure it out...

img.jpg
 
Anyone have the code or know how to change from the old "AddCloud" view to the newer view with just dots? I tried for hours today to make the change and couldn't figure it out...

img.jpg
Here is the dot version w labels
Code:
declare Lower;
input Show81321Label = yes;
input ShowWaveTrendLabel = yes;
input Dotsize = 3;


DefineGlobalColor("Bullish", Color.GREEN);
DefineGlobalColor("Sideways", Color.YELLOW);
DefineGlobalColor("Bearish", Color.RED);

def EMA34High = ExpAverage (high, 34); #was ema1_34
def EMA34Close = ExpAverage (close, 34); #ema2_34
def EMA34Low = ExpAverage (low, 34); # was ema3_34
def EMA8 = ExpAverage(close, 8); #JT Changed var name from EMA1 to EMA8
def EMA21 = ExpAverage(close, 21); #JT Changed var name from EMA2 to EMA21
def EMA13 = ExpAverage (close, 13);


def bullish = (EMA8 > EMA13) and (EMA13 > EMA21);
def bearish = (EMA8 < EMA13) and (EMA13 < EMA21);

def WaveState = {default SW, Bullish, Bearish}; #SW = sideways
WaveState = IF (EMA8 > EMA13) AND (EMA13 > EMA21) AND (EMA21 > EMA34High)
            THEN WaveState.Bullish
            ELSE IF (EMA8 < EMA13) AND (EMA13 < EMA21) AND (EMA21 < EMA34Low)
            THEN WaveState.Bearish
            ELSE WaveState.SW;


def IsBullishWave =  WaveState == WaveState.Bullish;
def IsBearishWave =  WaveState == WaveState.Bearish;
def IsSidewaysWave = WaveState == WaveState.SW;
plot A1_Dot = if IsNaN(Close) then Double.NaN else 1;
A1_Dot.SetPaintingStrategy(PaintingStrategy.TRIANGLES);
A1_Dot.SetLineWeight(DotSize);
A1_Dot.AssignValueColor(if bullish then Color.Green else if Bearish then Color.Red else Color.Yellow);
plot A2_Dot = if IsNaN(Close) then Double.NaN else 2;
A2_Dot.SetPaintingStrategy(PaintingStrategy.TRIANGLES);
A2_Dot.SetLineWeight(DotSize);
A2_Dot.AssignValueColor(if IsBullishWave then Color.Green else if IsBearishWave  then Color.Red else if isSidewaysWave then Color.Yellow else Color.Black);
AddLabel(Show81321Label, "8:13:21: " + if bullish then "Bullish" else if bearish then "Bearish" else "Slop", if bullish then GlobalColor("Bullish") else if bearish then GlobalColor("Bearish") else GlobalColor("Sideways"));

AddLabel(ShowWaveTrendLabel, "Wave: " + if IsBullishWave then "Bullish" else if IsBearishWave then "Bearish" else "S/W", if IsBullishWave then GlobalColor("Bullish") else if IsBearishWave then GlobalColor("Bearish") else GlobalColor("Sideways"));
 
Here you go bud...

Code:
def stackedUp = MovAvgExponential("length" = 8)."AvgExp" is greater than MovAvgExponential("length" = 13)."AvgExp"
and MovAvgExponential("length" = 13)."AvgExp" is greater than MovAvgExponential("length" = 21)."AvgExp";

def WaveUp = MovAvgExponential("length" = 21)."AvgExp" is greater than MovAvgExponential("length" = 34)."AvgExp";

def WaveDown = MovAvgExponential("length" = 21)."AvgExp" is less than MovAvgExponential("length" = 34)."AvgExp";


def stackedDown = MovAvgExponential("length" = 8)."AvgExp" is less than MovAvgExponential("length" = 13)."AvgExp"
and MovAvgExponential("length" = 13)."AvgExp" is less than MovAvgExponential("length" = 21)."AvgExp";


AddLabel(yes, " 8:13:21 ", if stackedUp then Color.GREEN else if stackedDown then Color.RED else Color.GRAY);

AddLabel(yes, " Wave ", if WaveUp then Color.GREEN else if WaveDown then Color.Yellow else Color.GRAY);


input numadditionalSymbols = 1;
def topnum = min(numadditionalSymbols * 2 + 2,20);
plot border = topnum + 1;

AddCloud(if stackedUp then topnum else if topnum - 1 <= 0 then 0 else topnum - 1, if stackedDown then topnum else if topnum - 1 <= 0 then 0 else topnum - 1 , color1 = Color.GREEN, showBorder = yes);

AddCloud(if stackedUp == 0 and stackedDown == 0 then topnum else if topnum - 1 <= 0 then 0 else topnum - 1, if topnum - 2 <= 0 then 0 else topnum - 2 , color1 = Color.GRAY, Color.GRAY, showBorder = yes);

AddCloud(data1 = if WaveDown then if topnum - 1 <= 0 then 0 else topnum - 1 else if topnum - 2 <= 0 then 0 else topnum - 2, data2 = if topnum - 2 <= 0 then 0 else topnum - 2, color2 = Color.YELLOW, showBorder = yes);

AddCloud(if WaveUp then if topnum - 1 <= 0 then 0 else topnum - 1 else if topnum - 2 <= 0 then 0 else topnum - 2, if WaveDown then if topnum - 1 <= 0 then 0 else topnum - 1 else if topnum - 2 <= 0 then 0 else topnum - 2, color1 = Color.GREEN, showBorder = yes);
is this just for the labels? i got that part,, what are the dotten lines at the top? I take it the solid lines are the EMA? any assiatnce would be greatly appreciated
 
Hey Henry,

Thanks for the quick work! I made some additional tweak to account for spacing and sizing as a user input. Once thing I cannot seem to figure out is how to flip the plots; for instance, I like to have the momentum (8/13/21) on top and the trend (wave) on bottom. I tried moving the code around but no luck.

Below is my revised code, any suggestions?

Code:
declare Lower;
input Show81321Label = yes;
input ShowWaveTrendLabel = yes;
input Dotsize = 1;
input IndicatorSpacing = 3;


DefineGlobalColor("Bullish", Color.GREEN);
DefineGlobalColor("Sideways", Color.YELLOW);
DefineGlobalColor("Bearish", Color.RED);

def EMA34High = ExpAverage (high, 34); #was ema1_34
def EMA34Close = ExpAverage (close, 34); #ema2_34
def EMA34Low = ExpAverage (low, 34); # was ema3_34
def EMA8 = ExpAverage(close, 8); #JT Changed var name from EMA1 to EMA8
def EMA21 = ExpAverage(close, 21); #JT Changed var name from EMA2 to EMA21
def EMA13 = ExpAverage (close, 13);


def bullish = (EMA8 > EMA13) and (EMA13 > EMA21);
def bearish = (EMA8 < EMA13) and (EMA13 < EMA21);

def WaveState = {default SW, Bullish, Bearish}; #SW = sideways
WaveState = IF (EMA8 > EMA13) AND (EMA13 > EMA21) AND (EMA21 > EMA34High)
            THEN WaveState.Bullish
            ELSE IF (EMA8 < EMA13) AND (EMA13 < EMA21) AND (EMA21 < EMA34Low)
            THEN WaveState.Bearish
            ELSE WaveState.SW;


def IsBullishWave =  WaveState == WaveState.Bullish;
def IsBearishWave =  WaveState == WaveState.Bearish;
def IsSidewaysWave = WaveState == WaveState.SW;

#adding a blank label after as a spacer

#input numadditionalSymbols = 1;
#def topnum = Min(numadditionalSymbols * 2 + 2, 20);
plot border = IndicatorSpacing;

###Trend###
AddLabel(ShowWaveTrendLabel, "Trend", if IsBullishWave then GlobalColor("Bullish") else if IsBearishWave then GlobalColor("Bearish") else GlobalColor("Sideways"));

#AddLabel(ShowWaveTrendLabel, "Wave: " + if IsBullishWave then "Bullish" else if IsBearishWave then "Bearish" else "S/W", if IsBullishWave then GlobalColor("Bullish") else if IsBearishWave then GlobalColor("Bearish") else GlobalColor("Sideways"));

plot A1_Dot = if IsNaN(Close) then Double.NaN else 1;
A1_Dot.SetPaintingStrategy(PaintingStrategy.SQUARES);
A1_Dot.SetLineWeight(DotSize);
A1_Dot.AssignValueColor(if bullish then Color.Green else if Bearish then Color.Red else Color.Yellow);

###Momentum###
AddLabel(Show81321Label, "Momentum", if bullish then GlobalColor("Bullish") else if bearish then GlobalColor("Bearish") else GlobalColor("Sideways"));

#AddLabel(Show81321Label, "8:13:21: " + if bullish then "Bullish" else if bearish then "Bearish" else "Slop", if bullish then GlobalColor("Bullish") else if bearish then GlobalColor("Bearish") else GlobalColor("Sideways"));

plot A2_Dot = if IsNaN(Close) then Double.NaN else 2;
A2_Dot.SetPaintingStrategy(PaintingStrategy.Squares);
A2_Dot.SetLineWeight(DotSize);
A2_Dot.AssignValueColor(if IsBullishWave then Color.Green else if IsBearishWave  then Color.Red else if isSidewaysWave then Color.Yellow else Color.Black);
Is it possible that you can increase y-axis from 0 to 100 instead 2 to 11.5 so that I can add a couple of indicators to it?
 
Is it possible that you can increase y-axis from 0 to 100 instead 2 to 11.5 so that I can add a couple of indicators to it?
Where is says Plot A2_Dot change the Else value to what value you would like IE else 50 or else .5

If you have an indicator that plots 0 thru 100 change the Plot value to 50 or if your indicator plots 0 thru 1 then change the plot value to .5

if your indicator plots 1 thru -1 , then change the plot value to 0 and so forth
 
Last edited:
Where is says Plot A2_Dot change the Else value to what value you would like IE else 50 or else .5

If you have an indicator that plots 0 thru 100 change the Plot value to 50 or if your indicator plots 0 thru 1 then change the plot value to .5

if your indicator plots 1 thru -1 , then change the plot value to 0 and so forth
Hi, Henry, Thank you very much for your help. I made the following change:
def topnum = Min(numadditionalSymbols * 2 + 2, 90);
The y-axis scale changes from 85 to 100 instead of 0 to 100. In addition, the cloud is not enlarged. Since I am more interested in your cloud indictor than your dot indictor. Is it possible to enlarge clouds from 0 to 100 so that I can add a couple of indicators to overlap with your cloud indicator?
 
Last edited:
Here is the dot version w labels
Code:
declare Lower;
input Show81321Label = yes;
input ShowWaveTrendLabel = yes;
input Dotsize = 3;


DefineGlobalColor("Bullish", Color.GREEN);
DefineGlobalColor("Sideways", Color.YELLOW);
DefineGlobalColor("Bearish", Color.RED);

def EMA34High = ExpAverage (high, 34); #was ema1_34
def EMA34Close = ExpAverage (close, 34); #ema2_34
def EMA34Low = ExpAverage (low, 34); # was ema3_34
def EMA8 = ExpAverage(close, 8); #JT Changed var name from EMA1 to EMA8
def EMA21 = ExpAverage(close, 21); #JT Changed var name from EMA2 to EMA21
def EMA13 = ExpAverage (close, 13);


def bullish = (EMA8 > EMA13) and (EMA13 > EMA21);
def bearish = (EMA8 < EMA13) and (EMA13 < EMA21);

def WaveState = {default SW, Bullish, Bearish}; #SW = sideways
WaveState = IF (EMA8 > EMA13) AND (EMA13 > EMA21) AND (EMA21 > EMA34High)
            THEN WaveState.Bullish
            ELSE IF (EMA8 < EMA13) AND (EMA13 < EMA21) AND (EMA21 < EMA34Low)
            THEN WaveState.Bearish
            ELSE WaveState.SW;


def IsBullishWave =  WaveState == WaveState.Bullish;
def IsBearishWave =  WaveState == WaveState.Bearish;
def IsSidewaysWave = WaveState == WaveState.SW;
plot A1_Dot = if IsNaN(Close) then Double.NaN else 1;
A1_Dot.SetPaintingStrategy(PaintingStrategy.TRIANGLES);
A1_Dot.SetLineWeight(DotSize);
A1_Dot.AssignValueColor(if bullish then Color.Green else if Bearish then Color.Red else Color.Yellow);
plot A2_Dot = if IsNaN(Close) then Double.NaN else 2;
A2_Dot.SetPaintingStrategy(PaintingStrategy.TRIANGLES);
A2_Dot.SetLineWeight(DotSize);
A2_Dot.AssignValueColor(if IsBullishWave then Color.Green else if IsBearishWave  then Color.Red else if isSidewaysWave then Color.Yellow else Color.Black);
AddLabel(Show81321Label, "8:13:21: " + if bullish then "Bullish" else if bearish then "Bearish" else "Slop", if bullish then GlobalColor("Bullish") else if bearish then GlobalColor("Bearish") else GlobalColor("Sideways"));

AddLabel(ShowWaveTrendLabel, "Wave: " + if IsBullishWave then "Bullish" else if IsBearishWave then "Bearish" else "S/W", if IsBullishWave then GlobalColor("Bullish") else if IsBearishWave then GlobalColor("Bearish") else GlobalColor("Sideways"));
Hey Henry,

Thanks for the quick work! I made some additional tweaks to account for spacing between the two lines as a user input. Once thing I cannot seem to figure out is how to flip the painted plots on the chart; for instance, I like to have the momentum (8/13/21) painted strategy as the top one top and the trend (wave) painted strategy underneath it on bottom. I tried moving the code around but no luck.

Below is my revised code, any suggestions?

Code:
declare Lower;
input Show81321Label = yes;
input ShowWaveTrendLabel = yes;
input Dotsize = 1;
input IndicatorSpacing = 3;


DefineGlobalColor("Bullish", Color.GREEN);
DefineGlobalColor("Sideways", Color.YELLOW);
DefineGlobalColor("Bearish", Color.RED);

def EMA34High = ExpAverage (high, 34); #was ema1_34
def EMA34Close = ExpAverage (close, 34); #ema2_34
def EMA34Low = ExpAverage (low, 34); # was ema3_34
def EMA8 = ExpAverage(close, 8); #JT Changed var name from EMA1 to EMA8
def EMA21 = ExpAverage(close, 21); #JT Changed var name from EMA2 to EMA21
def EMA13 = ExpAverage (close, 13);


def bullish = (EMA8 > EMA13) and (EMA13 > EMA21);
def bearish = (EMA8 < EMA13) and (EMA13 < EMA21);

def WaveState = {default SW, Bullish, Bearish}; #SW = sideways
WaveState = IF (EMA8 > EMA13) AND (EMA13 > EMA21) AND (EMA21 > EMA34High)
            THEN WaveState.Bullish
            ELSE IF (EMA8 < EMA13) AND (EMA13 < EMA21) AND (EMA21 < EMA34Low)
            THEN WaveState.Bearish
            ELSE WaveState.SW;


def IsBullishWave =  WaveState == WaveState.Bullish;
def IsBearishWave =  WaveState == WaveState.Bearish;
def IsSidewaysWave = WaveState == WaveState.SW;

#adding a blank label after as a spacer

#input numadditionalSymbols = 1;
#def topnum = Min(numadditionalSymbols * 2 + 2, 20);
plot border = IndicatorSpacing;

###Trend###
AddLabel(ShowWaveTrendLabel, "Trend", if IsBullishWave then GlobalColor("Bullish") else if IsBearishWave then GlobalColor("Bearish") else GlobalColor("Sideways"));

#AddLabel(ShowWaveTrendLabel, "Wave: " + if IsBullishWave then "Bullish" else if IsBearishWave then "Bearish" else "S/W", if IsBullishWave then GlobalColor("Bullish") else if IsBearishWave then GlobalColor("Bearish") else GlobalColor("Sideways"));

plot A1_Dot = if IsNaN(Close) then Double.NaN else 1;
A1_Dot.SetPaintingStrategy(PaintingStrategy.SQUARES);
A1_Dot.SetLineWeight(DotSize);
A1_Dot.AssignValueColor(if bullish then Color.Green else if Bearish then Color.Red else Color.Yellow);

###Momentum###
AddLabel(Show81321Label, "Momentum", if bullish then GlobalColor("Bullish") else if bearish then GlobalColor("Bearish") else GlobalColor("Sideways"));

#AddLabel(Show81321Label, "8:13:21: " + if bullish then "Bullish" else if bearish then "Bearish" else "Slop", if bullish then GlobalColor("Bullish") else if bearish then GlobalColor("Bearish") else GlobalColor("Sideways"));

plot A2_Dot = if IsNaN(Close) then Double.NaN else 2;
A2_Dot.SetPaintingStrategy(PaintingStrategy.Squares);
A2_Dot.SetLineWeight(DotSize);
A2_Dot.AssignValueColor(if IsBullishWave then Color.Green else if IsBearishWave  then Color.Red else if isSidewaysWave then Color.Yellow else Color.Black);
 
Hey Henry,

Thanks for the quick work! I made some additional tweaks to account for spacing between the two lines as a user input. Once thing I cannot seem to figure out is how to flip the painted plots on the chart; for instance, I like to have the momentum (8/13/21) painted strategy as the top one top and the trend (wave) painted strategy underneath it on bottom. I tried moving the code around but no luck.

Below is my revised code, any suggestions?

Code:
declare Lower;
input Show81321Label = yes;
input ShowWaveTrendLabel = yes;
input Dotsize = 1;
input IndicatorSpacing = 3;


DefineGlobalColor("Bullish", Color.GREEN);
DefineGlobalColor("Sideways", Color.YELLOW);
DefineGlobalColor("Bearish", Color.RED);

def EMA34High = ExpAverage (high, 34); #was ema1_34
def EMA34Close = ExpAverage (close, 34); #ema2_34
def EMA34Low = ExpAverage (low, 34); # was ema3_34
def EMA8 = ExpAverage(close, 8); #JT Changed var name from EMA1 to EMA8
def EMA21 = ExpAverage(close, 21); #JT Changed var name from EMA2 to EMA21
def EMA13 = ExpAverage (close, 13);


def bullish = (EMA8 > EMA13) and (EMA13 > EMA21);
def bearish = (EMA8 < EMA13) and (EMA13 < EMA21);

def WaveState = {default SW, Bullish, Bearish}; #SW = sideways
WaveState = IF (EMA8 > EMA13) AND (EMA13 > EMA21) AND (EMA21 > EMA34High)
            THEN WaveState.Bullish
            ELSE IF (EMA8 < EMA13) AND (EMA13 < EMA21) AND (EMA21 < EMA34Low)
            THEN WaveState.Bearish
            ELSE WaveState.SW;


def IsBullishWave =  WaveState == WaveState.Bullish;
def IsBearishWave =  WaveState == WaveState.Bearish;
def IsSidewaysWave = WaveState == WaveState.SW;

#adding a blank label after as a spacer

#input numadditionalSymbols = 1;
#def topnum = Min(numadditionalSymbols * 2 + 2, 20);
plot border = IndicatorSpacing;

###Trend###
AddLabel(ShowWaveTrendLabel, "Trend", if IsBullishWave then GlobalColor("Bullish") else if IsBearishWave then GlobalColor("Bearish") else GlobalColor("Sideways"));

#AddLabel(ShowWaveTrendLabel, "Wave: " + if IsBullishWave then "Bullish" else if IsBearishWave then "Bearish" else "S/W", if IsBullishWave then GlobalColor("Bullish") else if IsBearishWave then GlobalColor("Bearish") else GlobalColor("Sideways"));

plot A1_Dot = if IsNaN(Close) then Double.NaN else 1;
A1_Dot.SetPaintingStrategy(PaintingStrategy.SQUARES);
A1_Dot.SetLineWeight(DotSize);
A1_Dot.AssignValueColor(if bullish then Color.Green else if Bearish then Color.Red else Color.Yellow);

###Momentum###
AddLabel(Show81321Label, "Momentum", if bullish then GlobalColor("Bullish") else if bearish then GlobalColor("Bearish") else GlobalColor("Sideways"));

#AddLabel(Show81321Label, "8:13:21: " + if bullish then "Bullish" else if bearish then "Bearish" else "Slop", if bullish then GlobalColor("Bullish") else if bearish then GlobalColor("Bearish") else GlobalColor("Sideways"));

plot A2_Dot = if IsNaN(Close) then Double.NaN else 2;
A2_Dot.SetPaintingStrategy(PaintingStrategy.Squares);
A2_Dot.SetLineWeight(DotSize);
A2_Dot.AssignValueColor(if IsBullishWave then Color.Green else if IsBearishWave  then Color.Red else if isSidewaysWave then Color.Yellow else Color.Black);
this will flip the dots so that the wave is on the bottom

Code:
declare Lower;
input Show81321Label = yes;
input ShowWaveTrendLabel = yes;
input Dotsize = 3;


DefineGlobalColor("Bullish", Color.GREEN);
DefineGlobalColor("Sideways", Color.YELLOW);
DefineGlobalColor("Bearish", Color.RED);

def EMA34High = ExpAverage (high, 34); #was ema1_34
def EMA34Close = ExpAverage (close, 34); #ema2_34
def EMA34Low = ExpAverage (low, 34); # was ema3_34
def EMA8 = ExpAverage(close, 8); #JT Changed var name from EMA1 to EMA8
def EMA21 = ExpAverage(close, 21); #JT Changed var name from EMA2 to EMA21
def EMA13 = ExpAverage (close, 13);


def bullish = (EMA8 > EMA13) and (EMA13 > EMA21);
def bearish = (EMA8 < EMA13) and (EMA13 < EMA21);

def WaveState = {default SW, Bullish, Bearish}; #SW = sideways
WaveState = IF (EMA8 > EMA13) AND (EMA13 > EMA21) AND (EMA21 > EMA34High)
            THEN WaveState.Bullish
            ELSE IF (EMA8 < EMA13) AND (EMA13 < EMA21) AND (EMA21 < EMA34Low)
            THEN WaveState.Bearish
            ELSE WaveState.SW;


def IsBullishWave =  WaveState == WaveState.Bullish;
def IsBearishWave =  WaveState == WaveState.Bearish;
def IsSidewaysWave = WaveState == WaveState.SW;
plot A2_Dot = if IsNaN(Close) then Double.NaN else 2;
A2_Dot.SetPaintingStrategy(PaintingStrategy.TRIANGLES);
A2_Dot.SetLineWeight(DotSize);
A2_Dot.AssignValueColor(if bullish then Color.Green else if Bearish then Color.Red else Color.Yellow);
plot A1_Dot = if IsNaN(Close) then Double.NaN else 1;
A1_Dot.SetPaintingStrategy(PaintingStrategy.TRIANGLES);
A1_Dot.SetLineWeight(DotSize);
A1_Dot.AssignValueColor(if IsBullishWave then Color.Green else if IsBearishWave  then Color.Red else if isSidewaysWave then Color.Yellow else Color.Black);
AddLabel(Show81321Label, "8:13:21: " + if bullish then "Bullish" else if bearish then "Bearish" else "Slop", if bullish then GlobalColor("Bullish") else if bearish then GlobalColor("Bearish") else GlobalColor("Sideways"));

AddLabel(ShowWaveTrendLabel, "Wave: " + if IsBullishWave then "Bullish" else if IsBearishWave then "Bearish" else "S/W", if IsBullishWave then GlobalColor("Bullish") else if IsBearishWave then GlobalColor("Bearish") else GlobalColor("Sideways"));
 
After using this for some time now, I haven't found much value in it... honestly, just taking up unnecessary space on the charts, for no additional value provided. Would be curious if others have had a different experience.
 
After using this for some time now, I haven't found much value in it... honestly, just taking up unnecessary space on the charts, for no additional value provided. Would be curious if others have had a different experience.
Have you tried looking at what happens on bigger times frames when both Trend and Momentum lights match in color?
 
Here is an enhanced version. It now has 3 trends and 2 waves added label and the ability to paintbars
Code:
declare Lower;
input Show5813Label = yes;
input Show81321Label = yes;
input Show132134Label = yes;
input ShowWaveTrendLabel = yes;
input Dotsize = 3;
input APC = 0;


DefineGlobalColor("Bullish", Color.GREEN);
DefineGlobalColor("Sideways", Color.YELLOW);
DefineGlobalColor("Bearish", Color.RED);

def EMA34High = ExpAverage (high, 34); #was ema1_34
def EMA34Close = ExpAverage (close, 34); #ema2_34
def EMA34Low = ExpAverage (low, 34); # was ema3_34
def EMA5 = ExpAverage(Close,5);
def EMA8 = ExpAverage(close, 8); #JT Changed var name from EMA1 to EMA8
def EMA21 = ExpAverage(close, 21); #JT Changed var name from EMA2 to EMA21
def EMA13 = ExpAverage (close, 13);
def EMA34 = ExpAverage (Close, 34);

def bullish = (EMA5 > EMA8) and (EMA8 > EMA13);
def bearish = (EMA5 < EMA8) and (EMA8 < EMA13);

def bullish2 = (EMA8 > EMA13) and (EMA13 > EMA21);
def bearish2 = (EMA8 < EMA13) and (EMA13 < EMA21);

def bullish3 = (EMA13 > EMA21) and (EMA21 > EMA34);
def bearish3 = (EMA13 < EMA21) and (EMA21 < EMA34);

def WaveState = {default SW, Bullish, Bearish}; #SW = sideways
WaveState = IF (EMA5 > EMA8) AND (EMA8 > EMA13) AND (EMA13 > EMA34High)
            THEN WaveState.Bullish
            ELSE IF (EMA5 < EMA8) AND (EMA8 < EMA13) AND (EMA13 < EMA34Low)
            THEN WaveState.Bearish
            ELSE WaveState.SW;

def WaveState2 = {default SW, Bullish, Bearish}; #SW = sideways
WaveState2 = IF (EMA8 > EMA13) AND (EMA13 > EMA21) AND (EMA21 > EMA34High)
            THEN WaveState2.Bullish
            ELSE IF (EMA8 < EMA13) AND (EMA13 < EMA21) AND (EMA21 < EMA34Low)
            THEN WaveState2.Bearish
            ELSE WaveState2.SW;

def IsBullishWave =  WaveState == WaveState.Bullish;
def IsBearishWave =  WaveState == WaveState.Bearish;
def IsSidewaysWave = WaveState == WaveState.SW;

def IsBullishWave2 =  WaveState2 == WaveState2.Bullish;
def IsBearishWave2 =  WaveState2 == WaveState2.Bearish;
def IsSidewaysWave2 = WaveState2 == WaveState2.SW;

plot A1_Dot = if IsNaN(Close) then Double.NaN else 1;
A1_Dot.SetPaintingStrategy(PaintingStrategy.TRIANGLES);
A1_Dot.SetLineWeight(DotSize);
A1_Dot.AssignValueColor(if bullish then Color.Green else if Bearish then Color.Red else Color.Yellow);

plot A2_Dot = if IsNaN(Close) then Double.NaN else 2;
A2_Dot.SetPaintingStrategy(PaintingStrategy.TRIANGLES);
A2_Dot.SetLineWeight(DotSize);
A2_Dot.AssignValueColor(if bullish2 then Color.Green else if Bearish2 then Color.Red else Color.Yellow);

plot A3_Dot = if IsNaN(Close) then Double.NaN else 3;
A3_Dot.SetPaintingStrategy(PaintingStrategy.TRIANGLES);
A3_Dot.SetLineWeight(DotSize);
A3_Dot.AssignValueColor(if bullish3 then Color.Green else if Bearish3 then Color.Red else Color.Yellow);

plot A4_Dot = if IsNaN(Close) then Double.NaN else 4;
A4_Dot.SetPaintingStrategy(PaintingStrategy.TRIANGLES);
A4_Dot.SetLineWeight(DotSize);
A4_Dot.AssignValueColor(if IsBullishWave then Color.Green else if IsBearishWave  then Color.Red else if isSidewaysWave then Color.Yellow else Color.Black);

plot A5_Dot = if IsNaN(Close) then Double.NaN else 5;
A5_Dot.SetPaintingStrategy(PaintingStrategy.TRIANGLES);
A5_Dot.SetLineWeight(DotSize);
A5_Dot.AssignValueColor(if IsBullishWave2 then Color.Green else if IsBearishWave2  then Color.Red else if isSidewaysWave2 then Color.Yellow else Color.Black);

AddLabel(Show5813Label, "Line1:5:8:13: " + if bullish then "Bullish" else if bearish then "Bearish" else "Slop", if bullish then GlobalColor("Bullish") else if bearish then GlobalColor("Bearish") else GlobalColor("Sideways"));

AddLabel(Show81321Label, "Line2:8:13:21: " + if bullish2 then "Bullish" else if bearish2 then "Bearish" else "Slop", if bullish2 then GlobalColor("Bullish") else if bearish2 then GlobalColor("Bearish") else GlobalColor("Sideways"));

AddLabel(Show132134Label, "Line3:13:21:34 " + if bullish3 then "Bullish" else if bearish3 then "Bearish" else "Slop", if bullish3 then GlobalColor("Bullish") else if bearish3 then GlobalColor("Bearish") else GlobalColor("Sideways"));

AddLabel(ShowWaveTrendLabel, "Line4:Wave1: " + if IsBullishWave then "Bullish" else if IsBearishWave then "Bearish" else "S/W", if IsBullishWave then GlobalColor("Bullish") else if IsBearishWave then GlobalColor("Bearish") else GlobalColor("Sideways"));

AddLabel(ShowWaveTrendLabel, "Line5:Wave2: " + if IsBullishWave2 then "Bullish" else if IsBearishWave2 then "Bearish" else "S/W", if IsBullishWave2 then GlobalColor("Bullish") else if IsBearishWave2 then GlobalColor("Bearish") else GlobalColor("Sideways"));

AssignPriceColor(if APC == 1 and Bullish then Color.Green else if APC ==1 and bearish then Color.Red else if APC ==1 and !bullish and ! Bearish then Color.yellow else if APC == 2 and Bullish2 then Color.Green else if APC ==2 and bearish2 then Color.Red else if APC ==2 and !bullish2 and ! Bearish2 then Color.yellow else if APC == 3 and Bullish3 then Color.Green else if APC ==3 and bearish3 then Color.Red else if APC ==3 and !bullish3 and ! Bearish3 then Color.yellow else if APC ==4 and IsBullishWave then Color.Green else if APC == 4 and IsBearishWave  then Color.Red else if APC ==4 and isSidewaysWave then Color.Yellow else if APC ==5 and IsBullishWave2 then Color.Green else if APC == 5 and IsBearishWave2 then Color.Red else if APC ==5 and isSidewaysWave2 then Color.Yellow else Color.Current);
L0LqfCv.png
 
Last edited by a moderator:

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

87k+ Posts
293 Online
Create Post

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