Traduzione indicatore EMA Wave and GRaB Candles by JustUncleL
Forums › ProRealTime forum Italiano › Supporto ProBuilder › Traduzione indicatore EMA Wave and GRaB Candles by JustUncleL
- This topic has 2 replies, 2 voices, and was last updated 1 month ago by
Msport71.
-
-
10/30/2025 at 11:03 AM #253134
Buongiorno,
sono a chiedere cortese traduzione codice in oggetto, che trovo interessante.
Grazie
https://www.tradingview.com/script/OeeX5b5L-EMA-Wave-and-GRaB-Candles-by-JustUncleL/
//@version=3
//
study(“EMA Wave and GRaB Candles by JustUncleL”, overlay=true,shorttitle=”WAVEGRAB”)//
// Author: JustUncleL
// Date :24-March-2017
//
// Description:
// This is a specialised Price Action Channel (PAC) or Wave that mirrors the indicator used by
// Raghee Horner, the “34EMA Wave and GRaB Candles”.
//
// The Wave consist of
// – 34 period exponential moving average on the high
// – 34 period exponential moving average on the close
// – 34 period exponential moving average on the low
//
// The GRaB candles colour scheme:
// – Lime = Bull candle closed above Wave
// – Green = Bear candle closed above Wave
// – Red = Bull candle closed below Wave
// – DarkRed = Bear candle closed below Wave
// – Aqua = Bull candle closed inside Wave
// – Blue = Bear candle closed inside Wave
//
// Optionally display a trend direction indication along bottom of chart.
//
// Reference:
// For some details on how Raghee uses this indicator check out
// – https://www.forexfactory.com/showthread.php?t=492080
// and her various training and webinar videos on Youtube
//
// Note: This code is licensed under open source GPLv3 terms and conditions. Any
// modifications to it should be made public and linked to the original code.
////
// === INPUTS ===
//
ShowPAC = input(true, title=”Show EMA Wave”)
ShowBarColor = input(true, title=”Show Coloured GRaB Candles”)
ShowTrendIndi = input(false, title=”Show Trend Indicator”)
PACLen = input(34,minval=2,title=”EMA Wave Length (34 by default)”)
src = input(close,title=”Source for Wave centre EMA”)// — CONSTANTS —
DodgerBlue = #1E90FF// === /INPUTS ===
// Constants colours that include fully non-transparent option.
green100 = #008000FF
lime100 = #00FF00FF
red100 = #FF0000FF
blue100 = #0000FFFF
aqua100 = #00FFFFFF
darkred100 = #8B0000FF// === SERIES SETUP ===
// Price action channel (Wave)
pacCe = ema(src, PACLen)
pacLo = ema(low, PACLen)
pacHi = ema(high, PACLen)// === /SERIES ===
// === PLOTTING ===
//
// If selected, Plot the Wave Channel based on EMA high,low and close
L=plot(ShowPAC ?pacLo:na, color=red, linewidth=1, title=”High Wave EMA”,transp=20)
H=plot(ShowPAC ?pacHi:na, color=green, linewidth=1, title=”Low Wave EMA”,transp=20)
C=plot(ShowPAC ?pacCe:na, color=black, linewidth=1, title=”Centre Wave EMA”,transp=20)
fill(L,H, color=gray,transp=92,title=”Fill Channel”)// Colour bars according to the close position relative to the PAC selected.
bColour = close>=open? close>=pacHi? lime100 : close<=pacLo? red100 : aqua100 : close>=pacHi? green100 : close<=pacLo? darkred100 : blue100
barcolor(ShowBarColor?bColour:na, title = “Bar Colours”)// Show trend direction indication on the bottom
wcolor = high>pacHi and low>pacHi? lime : low<pacLo and high<pacLo ? red : gray
plotshape(ShowTrendIndi?src:na, color=wcolor,location=location.bottom,style=shape.square,size=size.small,transp=20,title=”Trend Direction”)// === /PLOTTING ===
// eof10/30/2025 at 2:13 PM #253143Ecco:
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117// ------------------------------------------//PRC_EMA Wave and GRaB//version = 0//30.10.2025//Iván González @ www.prorealcode.com//Sharing ProRealTime knowledge// ------------------------------------------// --- VARIABLES DE USUARIO ---// ------------------------------------------// (1 = Mostrar, 0 = Ocultar)ShowPAC = 1 // Mostrar la "Wave" (las 3 líneas EMA)ShowBarColor = 1 // Mostrar las velas coloreadas GRaBShowTrendIndi = 1 // Mostrar indicador de tendenciaPACLen = 34 // Longitud de la EMA (34 por defecto)// ------------------------------------------// --- CÁLCULO DE LA WAVE (PAC) ---// ------------------------------------------pacCe = exponentialaverage[PACLen](close)pacLo = exponentialaverage[PACLen](low)pacHi = exponentialaverage[PACLen](high)// ------------------------------------------// --- LÓGICA DE COLOR DE VELAS (GRaB) ---// ------------------------------------------// Definimos los componentes RGB para cada colorcolorR = 0colorG = 0colorB = 0IF close >= open THEN // Vela AlcistaIF close >= pacHi THEN // Lime (Verde Lima)colorR = 0colorG = 255colorB = 0ELSIF close <= pacLo THEN // Red (Rojo)colorR = 255colorG = 0colorB = 0ELSE // Aqua (Dentro de la Wave)colorR = 0colorG = 255colorB = 255ENDIFELSE // Vela BajistaIF close >= pacHi THEN // Green (Verde Oscuro)colorR = 0colorG = 128colorB = 0ELSIF close <= pacLo THEN // DarkRed (Rojo Oscuro)colorR = 139colorG = 0colorB = 0ELSE // Blue (Azul)colorR = 0colorG = 0colorB = 255ENDIFENDIF// ------------------------------------------// --- LÓGICA DEL INDICADOR DE TENDENCIA ---// ------------------------------------------// 1 = Fuerte Alcista (Lime)// -1 = Fuerte Bajista (Red)// 0 = Neutral (Gray)trendValue = 0 // Gris por defectoIF high > pacHi AND low > pacHi THENtrendValue = 1 // LimeELSIF low < pacLo AND high < pacLo THENtrendValue = -1 // RedENDIF// Asignar colorescolortrendR = 128 // Gris por defectocolortrendG = 128colortrendB = 128IF trendValue = 1 THEN // LimecolortrendR = 0colortrendG = 255colortrendB = 0ELSIF trendValue = -1 THEN // RedcolortrendR = 255colortrendG = 0colortrendB = 0ENDIF// ------------------------------------------// --- DIBUJO DE VELAS ---// ------------------------------------------// Si está activado, dibujamos las velas con el color calculadoIF ShowBarColor THENDRAWCANDLE(open, high, low, close) COLOURED(colorR, colorG, colorB)ENDIF// ------------------------------------------// --- PLOTEO DE LÍNEAS (WAVE) ---// ------------------------------------------// Si ShowPAC es 0, devolvemos 'undefined' para ocultar las líneasplotPacHi = undefinedplotPacLo = undefinedplotPacCe = undefinedIF ShowPAC THENplotPacHi = pacHiplotPacLo = pacLoplotPacCe = pacCecolorbetween(plotPacHi,plotPacLo,"grey",50)ENDIF// ------------------------------------------// --- PLOTEO Indicador Tendencia---// ------------------------------------------// Devolvemos el valor solo si ShowTrendIndi es 1plotValue = undefinedIF ShowTrendIndi THENplotValue = trendValuedrawrectangle(barindex,10,barindex+1,20)coloured(colortrendR,colortrendG,colortrendB)fillcolor(colortrendR,colortrendG,colortrendB,90)anchor(bottom,index,yshift)ENDIF// --------------------------------------RETURN plotPacHi AS "High Wave"coloured("green"), plotPacCe AS "Centre Wave"coloured("darkblue"), plotPacLo AS "Low Wave"coloured("red")1 user thanked author for this post.
10/30/2025 at 4:22 PM #253144 -
AuthorPosts
Find exclusive trading pro-tools on