Conversion of indicator GMMA Oscillator from TradingView
Forums › ProRealTime English forum › ProBuilder support › Conversion of indicator GMMA Oscillator from TradingView
- This topic has 3 replies, 2 voices, and was last updated 3 years ago by Edisone.
-
-
07/12/2021 at 10:16 AM #173493
Hello, as the title suggests, I need to convert the “GMMA Oscillator” indicator from the TradingView code if possible.
Description:
The Guppy Multiple Moving Average (GMMA) is a technical indicator that displays two sets of moving averages. The first set contains six exponential moving averages that use faster periods to monitor the trading activity of short-term traders. The second set contains six exponential moving averages that use slower periods to monitor the trading activity of long-term investors.The GMMA Oscillator is a technical indicator developed by Leon Wilson. The oscillator line, which percentage difference between the Fast and Slow GMMA sets. The second line is the signal line and it is simply the exponential moving average of the oscillator line.
As with many trend following indicators, a bullish signal occurs when the oscillator line crosses above the signal line and a bearish signal when the oscillator line crosses below the signal line.
Options:
Select between Guppy MMA or SuperGuppy MMA calculated Oscillator.
Option to apply smoothing to the Oscillator line (recommendation 3)
Option to change Signal line period length
Option to use Anchor Time frame to match the Guppy or SuperGuppy chart
Option to show coloured Bullish / Bearish trading ZonesThanks for your help.
GMMA Oscillator123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194//@version=3study(title="GMMA Oscillator v1 by JustUncleL", shorttitle="GMMA_Osc", overlay=false)// ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒ ////// Author: @JustUncleL// Revision: v1// Date: 17-July-2018//// Description:// ============// The Guppy Multiple Moving Average (GMMA) is a technical indicator that displays two sets of// moving averages. The first set contains six exponential moving averages that use// faster periods to monitor the trading activity of short-term traders. The second set// contains six exponential moving averages that use slower periods to monitor the trading// activity of long-term investors.//// The GMMA Oscillator is a technical indicator developed by Leon Wilson. The oscillator line,// which percentage difference between the Fast and Slow GMMA sets. The second line is the// signal line and it is simply the exponential moving average of the oscillator line.//// As with many trend following indicators, a bullish signal occurs when the oscillator line// crosses above the signal line and a bearish signal when the oscillator line crosses// below the signal line.//// Options:// - Select between Guppy MMA or SuperGuppy MMA calculated Oscillator.// - Option to apply smoothing to the Oscillator line (recommendation 3)// - Option to change Signal line period length// - Option to use Anchor Time frame to match the Guppy or SuperGuppy chart// - Option to show coloured Bullish/Bearish trading Zones//// References:// ===========////// Revisions:// ==========// v1.00 - Original version.//// -----------------------------------------------------------------------------// Copyright 2018 @JustUncleL//// This program is free software: you can redistribute it and/or modify// it under the terms of the GNU General Public License as published by// the Free Software Foundation, either version 3 of the License, or// any later version.//// This program is distributed in the hope that it will be useful,// but WITHOUT ANY WARRANTY; without even the implied warranty of// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the// GNU General Public License for more details.//// The GNU General Public License can be found here// <http://www.gnu.org/licenses/>.//// -----------------------------------------------------------------------------//// ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒ //// === INPUTS ===// Use Alternate Anchor TF for MAsanchor = input(0,minval=0,maxval=1440,title="Use Alternate Anchor TimeFrame (0=none, max=1440 (mins,D,W)")//gmmaType = input("Guppy", title="Calculate Oscillator From Which GMMA Sets", options=["Guppy","SuperGuppy"])smoothLen = input(1, minval=1, title="Oscillator Smoothing Length (1=none)")signalLen = input(13, minval=1, title="GMMA Oscillator Signal Length")showZones = input(true, title="Show Bullish/Bearish Zones")//src = input(close, title="Source")//// === /INPUTS ===//// ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒ //// === FUNCTIONS ===//Fast Guppy Avg EMAGMMAFast(src, mult) =>ema1 = ema(src, 3*mult)ema2 = ema(src, 5*mult)ema3 = ema(src, 8*mult)ema4 = ema(src, 10*mult)ema5 = ema(src, 12*mult)ema6 = ema(src, 15*mult)return = (ema1 + ema2 + ema3 + ema4 + ema5 + ema6)return//Slow Guppy Avg EMAGMMASlow(src, mult) =>ema7 = ema(src, 30*mult)ema8 = ema(src, 35*mult)ema9 = ema(src, 40*mult)ema10 = ema(src, 45*mult)ema11 = ema(src, 50*mult)ema12 = ema(src, 60*mult)return = (ema7 + ema8 + ema9 + ema10 + ema11 + ema12)return//Fast SuperGuppy Avg EMAsuperGMMAFast(src, mult) =>emaF1 = ema(src, 3*mult)emaF2 = ema(src, 5*mult)emaF3 = ema(src, 7*mult)emaF4 = ema(src, 9*mult)emaF5 = ema(src, 11*mult)emaF6 = ema(src, 13*mult)emaF7 = ema(src, 15*mult)emaF8 = ema(src, 17*mult)emaF9 = ema(src, 19*mult)emaF10 = ema(src, 21*mult)emaF11 = ema(src, 23*mult)return = (emaF1 + emaF2 + emaF3 + emaF4 + emaF5 + emaF6 + emaF7 + emaF8 + emaF9 + emaF10 + emaF11)/11return//Slow SuperGuppy Avg EMAsuperGMMASlow(src, mult) =>emaS1 = ema(src, 25*mult)emaS2 = ema(src, 28*mult)emaS3 = ema(src, 31*mult)emaS4 = ema(src, 34*mult)emaS5 = ema(src, 37*mult)emaS6 = ema(src, 40*mult)emaS7 = ema(src, 43*mult)emaS8 = ema(src, 46*mult)emaS9 = ema(src, 49*mult)emaS10 = ema(src, 52*mult)emaS11 = ema(src, 55*mult)emaS12 = ema(src, 58*mult)emaS13 = ema(src, 61*mult)emaS14 = ema(src, 64*mult)emaS15 = ema(src, 67*mult)emaS16 = ema(src, 70*mult)// averagereturn = (emaS1 + emaS2 + emaS3 + emaS4 + emaS5 + emaS6 + emaS7 + emaS8 +emaS9 + emaS10 + emaS11 + emaS12 + emaS13 + emaS14 + emaS15 + emaS16)/16return// === /FUNCTIONS ===//// ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒ //// === SERIES ===//// Calculate the Multiplier for Anchor MAs.mult = not isintraday or anchor==0 or interval<=0 or interval>=anchor or anchor>1440 ? 1 : round(anchor/interval)>1? round(anchor/interval) : 1mult := isintraday or anchor==0 or interval<=0 or interval>=anchor or anchor>52 ? mult : round(anchor/interval)>1? round(anchor/interval) : 1// Select type of Oscillator calculationgmmaFast = gmmaType=="Guppy" ? GMMAFast(src, mult) : superGMMAFast(src, mult)gmmaSlow = gmmaType=="Guppy" ? GMMASlow(src, mult) : superGMMASlow(src, mult)// Calculate Oscillator, Smoothed Osc and signal linegmmaOscRaw = ((gmmaFast - gmmaSlow) / gmmaSlow) * 100gmmaOsc = sma(gmmaOscRaw, smoothLen)gmmaSignal = ema(gmmaOscRaw, signalLen)gmmaClr = gmmaOsc < gmmaSignal ? red : gmmaOsc > gmmaSignal ? green : gray// bullish signal rule:bullishRule = crossover(gmmaOsc, gmmaSignal)// bearish signal rule:bearishRule = crossunder(gmmaOsc, gmmaSignal)// current trading StateruleState = 0ruleState := bullishRule ? 1 : bearishRule ? -1 : nz(ruleState[1])// === /SERIES ===//// ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒ //// === PLOTTING ===plot(gmmaOsc, title="GMMA OSC Smooth", style=line, linewidth=2, color=gmmaClr, transp=10)plot(gmmaSignal, title="GMMA Signal", style=line, linewidth=1, color=orange, transp=10)hline(0,title="Zero line", linestyle=dotted, linewidth=2, color=gray)// === /PLOTTING ===//// ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒ //// === ALERTS ===bgcolor(showZones ? ( ruleState==1 ? green : ruleState==-1 ? red : gray ) : na , title="Guppy Bullish/Bearish Zones", transp=90)alertcondition(bullishRule,title="Guppy Bullish",message="Guppy Bullish")alertcondition(bearishRule,title="Guppy Bearish",message="Guppy Bearish")07/12/2021 at 11:25 AM #173499Se cerchi GUPPY troverai molti link, hai verificato che non sia già disponibile?
07/12/2021 at 1:04 PM #17350807/12/2021 at 4:35 PM #173534GMMA Oscillator123456789101112131415161718192021222324252627282930313233343536// GMMA Oscillator by Grespoa = close//Fast Guppy Avg EMAema1 = ExponentialAverage[3](a)ema2 = ExponentialAverage[5](a)ema3 = ExponentialAverage[8](a)ema4 = ExponentialAverage[10](a)ema5 = ExponentialAverage[12](a)ema6 = ExponentialAverage[15](a)gmmaFast = (ema1 + ema2 + ema3 + ema4 + ema5 + ema6)//Slow Guppy Avg EMAema7 = ExponentialAverage[30](a)ema8 = ExponentialAverage[35](a)ema9 = ExponentialAverage[40](a)ema10 = ExponentialAverage[45](a)ema11 = ExponentialAverage[50](a)ema12 = ExponentialAverage[60](a)gmmaSlow = (ema7 + ema8 + ema9 + ema10 + ema11 + ema12)smoothLen = 1signalLen = 13gmmaOscRaw = ((gmmaFast - gmmaSlow) / gmmaSlow) * 100gmmaOsc = Average[smoothLen](gmmaOscRaw)gmmaSignal = ExponentialAverage[signalLen](gmmaOscRaw)if gmmaOsc < gmmaSignal thenr=1000g=0elser=0g=1000endifreturn gmmaOsc coloured(r,g,0) style(line,2) as "Osc", gmmaSignal coloured(255,153,0) style(line,2) as "Signal", 0 style(line,2) as "zero line"restricted version
-
AuthorPosts
Find exclusive trading pro-tools on