Bonjour,
J’ai adapté un ProBuilder “DIVERGENCES RSI” pour pouvoir l’utiliser sur un graphique hebdo et l’exploiter dans un Proscreener afin de détecter les valeurs qui répondent aux critères RSI haussier ou baissier.
L’application du ProBuilder sur le graphique fonctionne bien (voir exemple sur le screenshot du Crédir Agricole).
Mais en l’utilisant ds un ProScreener ça fonctionne pour le RSI haussier mais pas pour le RSI baissier.
Alors si qqn pouvait m’aider à comprendre pourquoi ça fonctionne pour détecter les triangles hauts (=1) mais pas les triangles bas (=-1) car je sèche depuis un bout de temps.
Merci à vous.
Voir joint au message le code du Probuilder et des 2 ProScreener ainsi que des screenshot pour exemple.
// DIVERGENCES RSI
x = RSI[p]
y=average[2](x)
// DIVERGENCES BAISSIERES RSI
if x>overboughtzone then
hi=max(hi,x)
hico=max(hico,max(high,high[1]))
endif
if x crosses under y then
sto2b=sto1b
sto1b=hi
hi=0
p3b=p1b
p2b=max(p1b,hico1)
p1b=max(highest[3](high),hico)
if p2b=p1b then
p2b=max(p3b,p4b)
endif
hico=0
hico1=0
endif
if x<y then
p4b=hico1
hico1=max(hico1,high)
endif
if p1b>p2b and sto1b<sto2b and x crosses under y and x<x[1] then
signB= -1
else
signB= 0
endif
// DIVERGENCES HAUSSIERES RSI
if x<oversoldzone then
lo=min(lo,x)
lowco=min(lowco,min(low,low[1]))
endif
if x CROSSES OVER y then
sto2h=sto1h
sto1h=lo
lo=100
p3h=p1h
p2h=min(p1h,lowco1)
p1h=min(lowest[3](low),lowco)
if p2h=p1h then
p2h=min(p3h,p4h)
endif
lowco=100000
lowco1=100000
endif
if x>y then
p4h=lowco1
lowco1=min(lowco1,low)
endif
if p1h<p2h and sto1h > sto2h and x crosses over y and x>x[1] then
signH= 1
else
signH= 0
endif
////////////////////////////////////////////////
return signH as " div RSI H ", signB as " div RSI B "
ProScreener RSI H
// code proscreener RSI H
mydivRSIH, ignored = CALL "Divergence RSI"[21, 70, 30]((high+low+2*close)/4)
monRsi = rsi[21]((high+low+2*close)/4)
i = 0
WHILE mydivRSIH [i] <> 1 and i < 10 Do
i = i + 1
wend
filtre= mydivRSIH [i]
//screener [filtre and monRsi] (filtre as "mydivRSIH")
screener [monRsi [i] < 30 and filtre] (i as "i")
avec ce ProScreener RSI H => Je trouve 3 valeurs sur France PEA par exemple qui répondent à mon ProScreener. J’affiche i pour vérifier et pour SMTPC i=2 où je trouve bien mon indicateur « haussier » = 1 => tout va bien (voir Sreenshot SMTPC)
ProScreener RSI B
// code proscreener RSI Baissier
ignored, mydivRSIB = CALL "Divergence RSI"[21, 70, 30]((high+low+2*close)/4)
//monRsi = rsi[21]((high+low+2*close)/4)
i = 0
WHILE mydivRSIB [i] = 0 and i < 200 Do
i = i + 1
wend
filtre= mydivRSIB [i]
//screener [filtre and monRsi] (filtre as "mydivRSIH")
//screener [monRsi [i] < 30 and filtre] (i as "i")
screener [filtre] (i as "i")
Mais lorsque je veux faire le test du RSI baissier là je ne capte aucune valeur sur France PEA par exemple alors que l’exemple suivant (Crédit Agricole) montre bien l’indicateur baissier (le triangle bas à -1 en bas à droite du screenshot). Pourtant je vais chercher loin dans le passé puisque que je teste jusqu’à i < 200.
Il semble que mydivRSIB [i] soit tjs à 0 et donc ne retourne rien alors qu’avec l’exemple du Crédit Agricole l’indicateur devrait être = -1 quand i = 11 (voir screenshot CA)