Buongiorno,
sono neofita sulla programmazione di indicatori con PRT.
E’ possibile programmare uno strumento che tracci le trend line di un indicatore( ad esempio RSI) nella stessa maniera in cui lo fa ProReal Trend sul grafico dei prezzi?
Grazie mille in anticipo
Chiccone
Stai parlando di una linea di tendenza obliqua?
Si una trend line obliqua che unisca minimi o massimi dell’indicatore
Grazie
chiccone
ok, ecco un esempio con un RSI: disegna una linea di tendenza sugli ultimi top e bottom, puoi controllare i periodi regolando l'impostazione "lookback".
defparam drawonlastbaronly = true
//---settings
lookback = 10
showSR = 0
//---
i = rsi[14](close)
//fractals
cp = lookback
if i[cp] >= highest[(cp)*2+1](i) then
LLH = 1
else
LLH = 0
endif
if i[cp] <= lowest[(cp)*2+1](i) then
LLL = -1
else
LLL = 0
endif
if LLH = 1 then
oldLTOPy = LTOPy[1]
oldLTOPx = LTOPx[1]
LTOPy = i[cp]//high[cp]
LTOPx = barindex[cp]
endif
if LLL = -1 then
oldLBOTy = LBOTy[1]
oldLBOTx = LBOTx[1]
LBOTy = i[cp]//low[cp]
LBOTx = barindex[cp]
endif
//trend line
DRAWLINE(oldLTOPx,oldLTOPy,LTOPx,LTOPy)coloured(112,169,161)
DRAWLINE(oldLBOTx,oldLBOTy,LBOTx,LBOTy)coloured(211,78,36)
//support/resistance
if showSR then
DRAWHLINE(LTOPy) COLOURED(207,215,199,100)
DRAWHLINE(LBOTy) COLOURED(207,215,199,100)
endif
RETURN i
Ciao Nicolas,
scusa la domanda( forse potrà sembrare poco intelligente ma ha un suo perchè):
se volessi disegnare le linee che uniscono solo i massimi decrescenti o i minimi crescenti, cambia qualcosa nella formula?
Grazie
Chiccone