Salve,
gentilmente volevo chiedere come fare per riportare sul grafico del prezzo un indicatore (che funziona come una media mobile) che pero usa una scala diversa da quella del prezzo stesso.
Grazie anticipatamente
o crei un indicatore e lo metti in altro grafico tipo adx o per esempio quando una mediamobile è attiva sotto a buy at market metti graphonprice media
Oltre alla conversione della scala, non c’è altro modo. Si prega di condividere il codice di questo indicatore per sapere come adattarlo.
ptime = Time[1]
ctime = Time
// estraggo la differenza in ore
if ctime>=10000 then
hend = (ctime - (ctime mod 10000))/10000
ctime = (ctime mod 10000)
else
hend = 0
endif
if ptime>=10000 then
hstart = (ptime - (ptime mod 10000))/10000
ptime = (ptime mod 10000)
else
hstart = 0
endif
// estraggo la differenza in minuti
if ctime>=100 then
mend = (ctime - (ctime mod 100))/100
ctime = (ctime mod 100)
else
mend = 0
endif
if ptime>=100 then
mstart = (ptime - (ptime mod 100))/100
ptime = (ptime mod 100)
else
mstart = 0
endif
secstarttime = hstart*3600+mstart*60+ptime
secendtime = hend*3600+mend*60+ctime
barsec = secendtime-secstarttime
// correggo l'eventuale cambio di giorno
if barsec<0 then
barsec = 3600*24-secstarttime+secendtime
endif
a=(x/y)
if open<close then
a=a
endif
if open>close then
a=-a
endif
T=a[1]+a
return T
Spiego quello che è la mia idea:
dovrebbe venire come la foto allegata dove il verde è il prezzo e il magenta è l’indicatore