The Guppy Multiple Moving Average (GMMA) is a technical indicator that identifies changing trends, breakouts, and trading opportunities in the price of an asset by combining two groups of moving averages (MA) with different time periods. The term gets its name from Daryl Guppy, an Australian trader who is credited with its development. -Investopeia
To use this script, simply copy and paste the code below in your VAI Script Editor, save it and run! You can run it in the charts module to display the signals on the chart or run it in the screener module, which will show all the signals for that day.
You can find more tutorials here https://www.vaianalytics.com/knowledge-base/
This is a strategy developed by Peter Yung which utilizes EMA for its GMMA calculation with a cutloss system if prices fall below its 10 day EMA. Volume of more than 5m is also a requirement for a buy or sell to trigger. (Pro Tip: you can click show/hide legend icon found beside the TF icon to make the chart cleaner)
// GMMA by Peter Yung
// Public
//Set Variables
Set EMA3 = ema(close,3)
Set EMA5 = ema(close,5)
Set EMA8 = ema(close,8)
Set EMA10 = ema(close,10)
Set EMA12 = ema(close,12)
Set EMA15 = ema(close,15)
Set EMA30 = ema(close,30)
Set EMA35 = ema(close,35)
Set EMA40 = ema(close,40)
Set EMA45 = ema(close,45)
Set EMA50 = ema(close,50)
Set EMA60 = ema(close,60)
Set AlignedUp1 = ema15>ema30 and ema15>ema35 and ema15>ema40 and ema15>ema45 and ema15>ema50 and ema15>ema60
Set AlignedUp2 = ema3>ema30 and ema3>ema35 and ema3>ema40 and ema3>ema45 and ema3>ema50 and ema3>ema60
Set AlignedDown1= ema60 > ema3 and ema60>ema5 and ema60>ema8 and ema60>ema10 and ema60>ema12 and ema60>ema15
Set AlignedDown2 = ema30 > ema3 and ema30>ema5 and ema30>ema8 and ema30>ema10 and ema30>ema12 and ema30>ema15
Set CrossoverUp = crossover(ema15,ema60) or crossover(ema3,30) or crossover(ema15,ema30)
Set CrossoverDown = crossover(ema60,ema15) or crossover(ema30,3) or crossover(ema30,ema15)
Set value = close*volume
//Set Buy and Sell Conditions
Set Buy = AlignedUp1 and alignedUp2 and CrossoverUp and close > EMA3 and value > 5000000
Set Sell = AlignedDown1 and AlignedDown2 and CrossoverDown or (crossover(ema10,close) and value > 5000000)
//Plot on charts
plot(EMA3,line,firebrick,main)
plot(EMA5,line,firebrick,main)
plot(EMA8,line,firebrick,main)
plot(EMA10,line,firebrick,main)
plot(EMA12,line,firebrick,main)
plot(EMA15,line,firebrick,main)
plot(EMA30,line,seagreen,main)
plot(EMA35,line,seagreen,main)
plot(EMA40,line,seagreen,main)
plot(EMA45,line,seagreen,main)
plot(EMA50,line,seagreen,main)
plot(EMA60,line,seagreen,main)
#Activate this to plot to show all buy and sell signals
#To activate, remove the # sign before both plot scripts below.
plot(buy,buy,green,main)
plot(sell,sell,red,main)
#Activate this to plot to show only per set of buy and sell signals, this removes all buy and sell signals in between
#If you activate this plot, remember to disable the previous plot function above.
#plotbuysell(buy,sell,green,red,main)
//This function tells the screener and backtester which function is your buy and sell
signals(buy,sell)
