Buongiorno, vorrei chiedere se fosse possibile fare comparire un indicatore direttamente sul grafico del prezzo anziché nel box separato. L’ indicatore che mi interessa in particolare è l’indice di forza relativa (paragone). Grazie
Per mettere un indicatore nel prezzo devi trasformarlo. Per fare ciò, puoi prendere come riferimento, ad esempio, un canale di massimi e minimi. Nell'esempio seguente hai un RSI all'interno del prezzo, supportato da un canale Donchian.
//-----------------------------------------------------------------//
//PRC_RSI & Donchian Channel
//Iván González Varela
//03.06.2024
//formacionenbolsa.com
//-----------------------------------------------------------------//
//-----Inputs------------------------------------------------------//
//N=7
//M=100
//background=0//Color background?
//rsilinecolor=0//color rsi line?
//a=80
//-----------------------------------------------------------------//
//-----Donchian Channel--------------------------------------------//
lmax=highest[M](high)
lmin=lowest[M](low)
dist=lmax-lmin
//-----------------------------------------------------------------//
//-----RSI---------------------------------------------------------//
myrsi=rsi[N](close)
RSItransf=lmin+myrsi/100*dist
RSIOB=lmin+OB/100*dist
RSI50=lmin+50/100*dist
RSIOS=lmin+OS/100*dist
//-----------------------------------------------------------------//
//-----Pivot Points RSI
once rsimin=100
if myrsi crosses under OS then
prevrsimin=rsimin
prevlowprice=lowprice
rsimin=myrsi
lowprice=low
elsif myRSI < OS then
rsimin=min(myrsi,rsimin)
lowprice=min(low,lowprice)
else
rsimin=rsimin
lowprice=lowprice
endif
diver = rsimin>prevrsimin and lowprice<prevlowprice
if myrsi crosses over OS and diver and showdiv then
drawarrowup(barindex,low-0.35*tr)coloured("green")
endif
//-----------------------------------------------------------------//
//-----BackGround -------------------------------------------------//
if background then
if RSITransf >= RSIOB then
backgroundcolor(255,0,0,50)
elsif RSITransf =< RSIOS then
backgroundcolor(0,255,0,50)
endif
endif
//-----RSI Line color----------------------------------------------//
//-----------------------------------------------------------------//
if rsilinecolor then
if RSITransf >= RSIOB then
r=255
g=0
b=0
elsif RSITransf =< RSIOS then
r=0
g=255
b=0
else
r=0
g=0
b=255
endif
else
r=0
g=0
b=255
endif
//-----------------------------------------------------------------//
return RSItransf as "RSI price"coloured(r,g,b,a)style(line,2),lmax as "RSI 100", lmin as "RSI 0",RSIOB as "RSI OB"style(dottedline), RSI50 as "RSI 50"style(dottedline2), RSIOS as "RSI OS" style(dottedline)
Tuttavia, l'indicatore da te citato non può essere trasformato poiché al momento non possiamo fare riferimento ad altri asset all'interno della finestra di pianificazione.