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.
 
This version uses a 2 Pole Butterworth Filter instead of EMA's
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 a1A = exp(-1.414 * 3.14159 / 34);
def b1A = 2 * a1A * Cos(1.414 * 3.14159 / 34);
def coef2A =b1A;
def coef3A = -a1A * a1A;
def coef1A = (1 – b1A + a1A * a1A) / 4;
rec High34 = if barNumber() < 3 then High else coef1A * (High + 2 * High[1] + High[2]) + coef2A * High34[1] + coef3A * High34[2];
rec Low34 = if barNumber() < 3 then Low else coef1A * (Low + 2 * Low[1] + Low[2]) + coef2A * Low34[1] + coef3A * Low34[2];
rec Close34 = if barNumber() < 3 then Close else coef1A * (Close + 2 * Close[1] + Close[2]) + coef2A * Close34[1] + coef3A * Close34[2];
def a1B = exp(-1.414 * 3.14159 / 21);
def b1B = 2 * a1B * Cos(1.414 * 3.14159 / 21);
def coef2B =b1B;
def coef3B = -a1B * a1B;
def coef1B = (1 – b1B + a1B * a1B) / 4;
rec Close21 = if barNumber() < 3 then Close else coef1B * (Close + 2 * Close[1] + Close[2]) + coef2B * Close21[1] + coef3B * Close21[2];
def a1C = exp(-1.414 * 3.14159 / 13);
def b1C = 2 * a1C * Cos(1.414 * 3.14159 / 13);
def coef2C =b1C;
def coef3C = -a1C * a1C;
def coef1C = (1 – b1C + a1C * a1C) / 4;
rec Close13 = if barNumber() < 3 then Close else coef1C * (Close + 2 * Close[1] + Close[2]) + coef2C * Close13[1] + coef3C * Close13[2];
def a1D = exp(-1.414 * 3.14159 / 8);
def b1D = 2 * a1D * Cos(1.414 * 3.14159 / 8);
def coef2D =b1D;
def coef3D = -a1D * a1D;
def coef1D = (1 – b1D + a1D * a1D) / 4;
rec Close8= if barNumber() < 3 then Close else coef1D * (Close + 2 * Close[1] + Close[2]) + coef2D * Close8[1] + coef3D * Close8[2];
def a1E = exp(-1.414 * 3.14159 / 5);
def b1E = 2 * a1E * Cos(1.414 * 3.14159 / 5);
def coef2E =b1E;
def coef3E = -a1E * a1E;
def coef1E = (1 – b1E + a1E * a1E) / 4;
rec Close5 = if barNumber() < 3 then Close else coef1E * (Close + 2 * Close[1] + Close[2]) + coef2E * Close5[1] + coef3E * Close5[2];

def bullish = (Close5 > Close8) and (Close8 > Close13);
def bearish = (Close5 < Close8) and (Close8 < Close13);

def bullish2 = (Close8 > Close13) and (Close13 > Close21);
def bearish2 = (Close8 < Close13) and (Close13 < Close21);

def bullish3 = (Close13 > Close21) and (Close21 > Close34);
def bearish3 = (Close13 < Close21) and (Close21 < Close34);

def WaveState = {default SW, Bullish, Bearish}; #SW = sideways
WaveState = IF (Close5 > Close8) AND (Close8 > Close13) AND (Close13 > High34)
            THEN WaveState.Bullish
            ELSE IF (Close5 < Close8) AND (Close8 < Close13) AND (Close13 < Low34)
            THEN WaveState.Bearish
            ELSE WaveState.SW;

def WaveState2 = {default SW, Bullish, Bearish}; #SW = sideways
WaveState2 = IF (Close8 > Close13) AND (Close13 > Close21) AND (Close21 > High34)
            THEN WaveState2.Bullish
            ELSE IF (Close8 < Close13) AND (Close13 < Close21) AND (Close21 < Low34)
            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);
 

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

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
Thanks Henry. Can you explain the differences between the normal and enhanced versions?
 
Thanks Henry. Can you explain the differences between the normal and enhanced versions?
The original JT Multi Trend only had 1 trend and 1 wave 8/13/21

The enhanced version, I added 5/8/13 Short term and a longer 13/21/34 trends
and I added another wave.

The butterworth version uses a 2 Pole butterworth filter instead of EA's
 
The original JT Multi Trend only had 1 trend and 1 wave 8/13/21

The enhanced version, I added 5/8/13 Short term and a longer 13/21/34 trends
and I added another wave.

The butterworth version uses a 2 Pole butterworth filter instead of EA's
Could you pleases explain its calculation method, what values it produces, and some practical examples of how it can be used while trading .Much appreciated
 
Could you pleases explain its calculation method, what values it produces, and some practical examples of how it can be used while trading .Much appreciated

This is a trend indicator using stacked moving averages.
The Butterworth Filter are a series of trigonometric calculations to control which frequencies pass through and which are blocked. It's good at keeping the useful frequencies while getting rid of the unwanted ones.
It is being used to smooth the stacked moving averages in an attempt to limit whipsaws.

How to use:
Look where both Trend and Momentum lights match in color to confirm the direction and strength of your trend.
 
I am trying to replace the top cloud for the momentum (8/13/21) stack with the hourly version of the trend (34 EMA) so in essence I will want to have the trend of the current TF on the top row and on bottom row would be the Hourly version of trend. I tried to put it together with below an I think I got the logic of it correctly and just have issue with the AddCloud. I think it is on top of each other

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;

#HOURLY

input Period = aggregationPeriod.HOUR;
#Input Show81321Label = yes;
#input ShowWaveTrendLabel = yes;

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

def EMA34HighHR = ExpAverage (high(period = Period), 34); #was ema1_34
def EMA34CloseHR = ExpAverage (close(period = Period), 34); #ema2_34
def EMA34LowHR = ExpAverage (low(period = Period), 34); # was ema3_34
def EMA8HR = ExpAverage(close(period = Period), 8); #JT Changed var name from EMA1 to EMA8
def EMA21HR = ExpAverage(close(period = Period), 21); #JT Changed var name from EMA2 to EMA21
def EMA13HR = ExpAverage (close(period = Period), 13);


def bullishHR = (EMA8HR > EMA13HR) and (EMA13HR > EMA21HR);
def bearishHR = (EMA8HR < EMA13HR) and (EMA13HR < EMA21HR);

def WaveStateHR = {default SW, Bullish, Bearish}; #SW = sideways
WaveStateHR = if (EMA8HR > EMA13HR) and (EMA13HR > EMA21HR) and (EMA21HR > EMA34HighHR)
then WaveStateHR.Bullish
else if (EMA8HR < EMA13HR) and (EMA13HR < EMA21HR) and (EMA21HR < EMA34LowHR)
then WaveStateHR.Bearish
else WaveStateHR.SW;


def IsBullishWaveHR = WaveStateHR == WaveStateHR.Bullish;
def IsBearishWaveHR = WaveStateHR == WaveStateHR.Bearish;
def IsSidewaysWaveHR = WaveStateHR == WaveStateHR.SW;



#adding a blank label after as a spacer

input numadditionalSymbols = 1;
def topnum = Min(numadditionalSymbols * 2 + 2, 20);
plot border = topnum + 8.5;
border.setDefaultColor(color.black);
border.setLineWeight (1) ;


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

AddCloud(data1 = if IsSidewaysWaveHR 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 IsBullishWaveHR then if topnum - 1 <= 0 then 0 else topnum - 1 else if topnum - 2 <= 0 then 0 else topnum - 2, if IsBearishWaveHR 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:

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

87k+ Posts
314 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