Ciao a tutti,
sto cercando di costruire uno screener (su time frame intraday) che identifichi i titoli che soddisfano la seguente condizione:
Il prezzo nella settimana [1] (cioè la settimana scorsa) ha incrociato al ribasso 3 volte il massimo della settimana [2] (cioè di due settimane fa).
Nello specifico:
Calcolo il massimo (Max W[2]) e minimo (Min W[2]) della settimana [2];
Nella settimana [1], il prezzo deve superare al rialzo e poi tornare sotto il Max W[2] per almeno 3 volte (quindi 3 incroci ribassisti);
Lo screener deve identificare questa condizione nella settimana corrente.
Time frame di riferimento: intraday (preferibilmente 1h).
L’evoluzione dello script è che mi individui anche in alternativa 3 incroci al rialzo sul minimo della settimana [2].
Grazie mille in anticipo per l’aiuto !
Allego anche uno schema per chiarezza.
Ciao! Vi darò lo screener per gli incroci superiori al massimo della settimana. Come minimo si farebbe in modo simile.
if opendayofweek<opendayofweek[1] then
maxweek1=maxweek
crossweek1=cross
maxweek=high
bars=0
cross=0
else
maxweek=max(maxweek,high)
bars=bars+1
if close crosses under maxweek1 then
cross=cross+1
endif
endif
screener[crossweek1>=3]
Con questo indicatore è possibile verificarlo.
if opendayofweek<opendayofweek[1] then
drawvline(barindex)
drawsegment(barindex[bars+1],maxweek1,barindex,maxweek1)
maxweek2=maxweek1
minweek2=minweek2
maxweek1=maxweek
minweek1=minweek
crossweek1=cross
maxweek=high
minweek=low
bars=0
cross=0
else
maxweek=max(maxweek,high)
minweek=min(minweek,low)
bars=bars+1
if close crosses under maxweek1 then
cross=cross+1
drawarrowdown(barindex,maxweek)coloured("red")
endif
endif
if islastbarupdate then
drawsegment(barindex[bars],maxweek1,barindex,maxweek1)
drawsegment(barindex[bars],maxweek2,barindex,maxweek2)
drawtext("lastweekCross=#crossweek1#",barindex+5,maxweek2)
endif
return