Guppy Multiple Moving Averages Indicator for ThinkorSwim

diazlaz

Well-known member
2019 Donor
VIP
I ported the Guppy Multiple Moving a few months back, interested to see what you all can do with it to enhance it or maybe even identify potential trading plans and setup.

It's quite an interesting indicator; can be used to observe the patterns and ribbons across various timeframes, to formulate trend direction. Useful across all time frames and style of trading.

Quite a bit of patterns can be developed, and if you observe it enough reusable patterns form with ribbons and color overlap.

Please comment with your experiences and ideas. More information is available here.

MSFT - 1 Minute (Intraday)

N1ywdpA.png


SPX - 1 Minute (Intraday)

V6aRusJ.png


SPX - 1 Hour/6 Months (Swing Trading)

0RkDLVG.png


Code:
#Guppy Multiple Moving Averages
#Daryl Guppy, an Australian trader who is credited with its development.
#
#https://www.investopedia.com/terms/g/guppy-multiple-moving-average.asp
#Discussion: https://usethinkscript.com/threads/guppy-multiple-moving-averages-indicator.732/
#
#Ported on 20190427 V.01 - diazlaz
#

input period0 = 1;
input period1 = 3;
input period2 = 5;
input period3 = 8;
input period4 = 10;
input period5 = 12;
input period6 = 15;
input period7 = 30;
input period8 = 35;
input period9 = 40;
input period10 = 45;
input period11 = 50;
input period12 = 60;
input AvgType = AverageType.Exponential;
input data = close;
input seperator = 1.00;

script Avg
{
input AvgType = AverageType.Exponential;
input length = 10;
input data = close;
plot MA = MovingAverage(AverageType = AvgType, data = close, length = length);
}


DefineGlobalColor("Up", Color.GREEN);
DefineGlobalColor("Down", Color.RED);
DefineGlobalColor("NUp", Color.DARK_GREEN);
DefineGlobalColor("NDown", Color.DARK_RED);
DefineGlobalColor("Neutral", Color.BLUE);

DefineGlobalColor("G1", CreateColor(42,137,71));
DefineGlobalColor("G2", CreateColor(54,156,72));
DefineGlobalColor("G3", CreateColor(69,176,73));
DefineGlobalColor("G4", CreateColor(96,195,85));
DefineGlobalColor("G5", CreateColor(129,215,102));
DefineGlobalColor("G6", CreateColor(164,235,122));
DefineGlobalColor("R1", CreateColor(235,24,9));
DefineGlobalColor("R2", CreateColor(222,34,35));
DefineGlobalColor("R3", CreateColor(209,56,66));
DefineGlobalColor("R4", CreateColor(196,75,91));
DefineGlobalColor("R5", CreateColor(183,91,109));
DefineGlobalColor("R6", CreateColor(170,105,122));

HidePricePlot(yes);

plot MA0 = Avg(AvgType = AvgType, data = data, length = period0);
plot MA1 = Avg(AvgType = AvgType, data = data, length = period1);
plot MA2 = Avg(AvgType = AvgType, data = data, length = period2);
plot MA3 = Avg(AvgType = AvgType, data = data, length = period3);
plot MA4 = Avg(AvgType = AvgType, data = data, length = period4);
plot MA5 = Avg(AvgType = AvgType, data = data, length = period5);
plot MA6 = Avg(AvgType = AvgType, data = data, length = period6);
plot MA7 = Avg(AvgType = AvgType, data = data, length = period7);
plot MA8 = Avg(AvgType = AvgType, data = data, length = period8);
plot MA9 = Avg(AvgType = AvgType, data = data, length = period9);
plot MA10 = Avg(AvgType = AvgType, data = data, length = period10);
plot MA11 = Avg(AvgType = AvgType, data = data, length = period11);
plot MA12 = Avg(AvgType = AvgType, data = data, length = period12);

MA0.SetDefaultColor(COLOR.LIME);

MA1.SetDefaultColor(GlobalColor("G1"));
MA2.SetDefaultColor(GlobalColor("G2"));
MA3.SetDefaultColor(GlobalColor("G3"));
MA4.SetDefaultColor(GlobalColor("G4"));
MA5.SetDefaultColor(GlobalColor("G5"));

MA7.SetDefaultColor(COLOR.RED);
MA7.SetLineWeight(2);

MA8.SetDefaultColor(GlobalColor("R2"));
MA9.SetDefaultColor(GlobalColor("R3"));
MA10.SetDefaultColor(GlobalColor("R4"));
MA11.SetDefaultColor(GlobalColor("R5"));
MA12.SetDefaultColor(GlobalColor("R6"));

MA1.HideTitle();
MA2.HideTitle();
MA3.HideTitle();
MA4.HideTitle();
MA5.HideTitle();
MA6.HideTitle();
MA7.HideTitle();
MA8.HideTitle();
MA9.HideTitle();
MA10.HideTitle();
MA11.HideTitle();
MA12.HideTitle();

MA2.HideBubble();
MA3.HideBubble();
MA4.HideBubble();
MA5.HideBubble();
MA6.HideBubble();
MA8.HideBubble();
MA9.HideBubble();
MA10.HideBubble();
MA11.HideBubble();
MA12.HideBubble();

# End Code Guppy Multiple Moving Averages

Safe and Healthy trading!
 
Last edited by a moderator:

diazlaz

Well-known member
2019 Donor
VIP
Very nice with the clouds. I find it without the clouds its easier to spot the ribbon and touch points between the lines, when in a 4x4 or 4x8 grid, with multiple timeframes. In this edition, the candles and price chart is hidden exposing the ribbons. lower time frames are highlighted in green and higher timeframes in red, allowing for a clear delineation of when the lower ribbons cross with the higher timeframe ribbons.

7cMH0oT.png
 

markos

Well-known member
VIP
Thanks for keeping the Guppy in the Style that the original Author meant it to be. I've seen way too many people mess with it's intent.

To all: Please read the link to Investopedia at the top. It explains how Mr Guppy meant for it to be used. Thanks!
 
Last edited:

tsleong

New member
I watched some Guppy videos, and put this indicator on my TOS and it goes on fine, but my candles disappeared. Is there a fix for this issue?
 

RedToGreen

New member
Here is a Guppy Cloud (More of an EMA cloud) with some Labels that tell you which direction a particular EMA is trending

The actual EMA's used are slightly different than what one would find in a recommended guppy setup.

With this, Uptrends, Pullback's and Downtrends, really stand out.


Code:
#Guppy Cloud

input price = close;
input exp3 = 3;
input exp5 = 5;
input exp8 = 8;
input exp15 = 15;
input exp34 = 34;
input exp40 = 40;
input exp50 = 50;
input exp60 = 60;
input exp144 = 144;
input exp233 = 233;

input averageType = AverageType.EXPONENTIAL;

def exp3f = MovingAverage(averageType, price, exp3);
def exp5f = MovingAverage(averageType, price, exp5);
def exp8f = MovingAverage(averageType, price, exp8);
def exp15f = MovingAverage(averageType, price, exp15);
def exp34s = MovingAverage(averageType, price, exp34);
def exp40s = MovingAverage(averageType, price, exp40);
def exp50s = MovingAverage(averageType, price, exp50);
def exp60s = MovingAverage(averageType, price, exp60);
def exp233s = MovingAverage(averageType, price, exp233);
def exp144s = MovingAverage(averageType, price, exp144);

def long1f = exp3 > exp5;
def long2f = exp5 > exp8;
def long3f = exp8 > exp15;

def exp8up = exp8f > exp8f[1];
def exp15up = exp15f > exp15f[1];
def exp34up = exp34s > exp34s[1];
def exp50up = exp50s > exp50s[1];
def exp60up = exp60s > exp60s[1];
def exp144up = exp144s > exp144s[1];
def exp233up = exp233s > exp233s[1];

def exp8dn = exp8f < exp8f[1];
def exp15dn = exp15f < exp15f[1];
def exp34dn = exp34s < exp34s[1];
def exp50dn = exp50s < exp50s[1];
def exp60dn = exp60s < exp60s[1];
def exp144dn = exp144s < exp144s[1];
def exp233dn = exp233s < exp233s[1];

AddCloud( exp3f, exp5f, createColor(6,191,0), createColor(209,0,3));
AddCloud( exp5f, exp8f, createColor(6,176,0), createColor(186,0,3));
AddCloud( exp8f, exp15f, createColor(5,153,0), createColor(166,0,3));

AddCloud( exp15f, exp34s, createColor(4,130,0), createColor(145,0,2));
AddCloud( exp34s, exp40s, createColor(4,112,0), createColor(122,0,2));
AddCloud( exp40s, exp50s, createColor(3,97,0), createColor(102,0,2));
AddCloud( exp50s, exp60s, createColor(3,77,0), createColor(79,0,1));
AddCloud( exp60s, exp233s, createColor(2,56,0), createColor(61,0,1));



AddLabel (yes, if exp8up then "8 up" else if exp8dn then "8 Down"  else " ", if exp8up  then CreateColor(39,84,130) else if exp8dn then Color.DARK_RED else color.DARK_GRAY);
AddLabel (yes, if exp15up then "15 up" else if exp15dn then "15 Down"  else " ", if exp15up  then CreateColor(39,84,130) else if exp15dn then Color.DARK_RED else color.DARK_GRAY);
AddLabel (yes, if exp34up then "34 up" else if exp34dn then "34 Down"  else " ", if exp34up  then CreateColor(39,84,130) else if exp34dn then Color.DARK_RED else color.DARK_GRAY);
AddLabel (yes, if exp50up then "50 up" else if exp50dn then "50 Down"  else " ", if exp50up  then CreateColor(39,84,130) else if exp50dn then Color.DARK_RED else color.DARK_GRAY);
AddLabel (yes, if exp60up then "60 up" else if exp60dn then "60 Down"  else " ", if exp60up  then CreateColor(39,84,130) else if exp60dn then Color.DARK_RED else color.DARK_GRAY);

AddLabel (yes, if exp144up then "144 up" else if exp144dn then "144 Down"  else " ", if exp144up  then CreateColor(39,84,130) else if exp144dn then Color.DARK_RED else color.DARK_GRAY);


AddLabel (yes, if exp233up then "233 up" else if exp233dn then "233 Down"  else " ", if exp233up  then CreateColor(39,84,130) else if exp233dn then Color.DARK_RED else color.DARK_GRAY);




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

# End Code


ETSY, Clearly Trending as the main body of the Guppy is Green, Yellowish, orange at top of Guppy, indicates a pb/retracement at the very least
vzKNiwl.png




BIDU (pretty much solid green)
nFFLqsk.png



What a Bearish setup looks like
lykAmnM.png


Hope you find it usefull
 
Last edited:

Similar threads

Top