E’ possibile tradurre questo indicatore Tradingview? https://www.tradingview.com/script/KFLuglJc-EMA-Trend-Meter/
Grazie,
Stefano
Ciao. Non c'è codice da tradurre… leggerò le specifiche e se è possibile proverò a creare l'indicatore.
Ecco la mia interpretazione dell'indicatore.
//PRC_EMA Trend Meter
//version = 0
//04.04.24
//Iván González @ www.prorealcode.com
//Sharing ProRealTime knowledge
//-----Inputs--------------------------------------------------//
src=customclose
p0=1//Periods Baseline moving average
t0=1//Type of moving average
p1=7//Periods moving average 1
t1=1//Type of moving average 1
p2=14//Periods moving average 2
t2=1//Type of moving average 2
p3=21//Periods moving average 3
t3=1//Type of moving average 3
n=1//Periods ROC calculation
rsiperiod = 14//RSI periods
Stolength = 14//Stochastic Length
SmoK=3//K periods
SmoD=3//D periods
//-------------------------------------------------------------//
//-----EMAs Calculations---------------------------------------//
ema0 = average[p0,t0](src)
ema1 = average[p1,t1](ema0)
ema2 = average[p2,t2](ema0)
ema3 = average[p3,t3](ema0)
rocema1 = roc[n](ema1)
rocema2 = roc[n](ema2)
rocema3 = roc[n](ema3)
//-------------------------------------------------------------//
//-----Stochastic RSI Calculations----------------------------------------//
myRSI = rsi[rsiperiod](ema0)
minRSI = lowest[Stolength](myRSI)
maxRSI = highest[Stolength](myRSI)
StochRSI = (myRSI-MinRSI) / (MaxRSI-MinRSI)
Stok = average[SmoK](StochRSI)*100
StoD = average[SmoD](Stok)
//-------------------------------------------------------------//
//-----Trend meter configuration-------------------------------//
if rocema1>0 then
r01=0
g01=255
else
r01=255
g01=0
endif
if rocema2>0 then
r02=0
g02=255
else
r02=255
g02=0
endif
if rocema3>0 then
r03=0
g03=255
else
r03=255
g03=0
endif
if StoK>StoD then
r=124
g=124
b=124
else
r=0
g=0
b=0
endif
//-------------------------------------------------------------//
//-------------------------------------------------------------//
//-------------------------------------------------------------//
return 1 as "ema1" coloured(r01,g01,0)style(line,5),2 as "ema2" coloured(r02,g02,0)style(line,5),3 as "ema3" coloured(r03,g03,0)style(line,5),4 as "RSI" coloured(r,g,b)style(line,5)
Hi Ivan, thanks!
it gives me error line 1 …..
can you check please?
Ciao Ivan, grazie!
mi dà la riga di errore 1 …..
puoi controllare per favore?
Pubblica solo nella lingua del forum in cui stai postando. Ad esempio solo l’inglese nei forum di lingua inglese e il francese solo nei forum di lingua francese.
Grazie 🙂
Probabilmente hai fatto male il Copia & Incolla.
Importa il file allegato.
Benissimo, grazie mille Ivan e grazie mille Roberto!