Ho importato dalla libreria l’indicatore in oggetto (che allego) di Nicolas, ma non ho capito come utilizzarlo in un trading system.
Grazie
//PRC_Another ATR trailing stop | indicator
//24.09.2019
//Nicolas @ http://www.prorealcode.com
//Sharing ProRealTime knowledge
// — settings
p=14 //ATR period
mult=2 //multiplier
mode=1 //trailing stop mode (0=straight line
// — end of settings
atr = AverageTrueRange[p](close) * mult
once trend=1
if trend=1 then
hh=max(hh,close)
ll=hh
if atr<atr[1] then
hhlevel=hh-atr
if hhlevel>ts then
ts=hhlevel
endif
endif
r=0
g=168
else
ll=min(ll,close)
hh=ll
if atr<atr[1] then
lllevel=ll+atr
if lllevel<ts then
ts=lllevel
endif
endif
r=255
g=0
endif
if close crosses over ts then
trend=1
if mode>0 then
ts=ll
endif
elsif close crosses under ts then
trend=-1
if mode>0 then
ts=hh
endif
endif
return ts coloured(r,g,0) style(line,3)
Il codice di questo argomento dovrebbe funzionare per attivare gli ordini quando il prezzo supera il trailing stop ATR: https://www.prorealcode.com/topic/another-atr-trailing-stop/
Ho letto il riferimento , praticamente è la stessa domanda, ma quel codice devo inserirlo nel mio trading system così come è. Inoltre a me l’indicatore si è posizionato al di sotto del grafico.
Grazie
Per metterlo sul grafico devi cliccare su PREZZO (vedi foto), poi seleziona AGGIUNGERE INDICATORE, quindi scegli il nome dall’elenco.