Ci-dessous le code de l’indicateur pour afficher les divergences haussières et baissières de cet indicateur:
//PRC_TTI Stochastic Extreme Divergence | indicator
//https://www.prorealcode.com/topic/screener-divergences-tti/
overboughtzone=80
oversoldzone=20
if close>average[14] then
x1 = std[14]
else
x1 = -1*std[14]
endif
x2 = (summation[3](x1-lowest[5](x1))/summation[3](highest[5](x1)-lowest[5](x1)))*100
x3 = x1*averagetruerange[5]
x4 = (summation[3](x3-lowest[5](x3))/summation[3](highest[5](x3)-lowest[5](x3)))*100
x = average[3,1](x2)
y = average[3,1](x4)
// BEARISH DIVERGENCES CCI
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= -2
else
signB= 0
endif
// BULLISH DIVERGENCES CCI
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= 2
else
signH= 0
endif
////////////////////////////////////////////////
return signH as " div TTI STO H ", signB as " div TTI STO B " , 0 as " zero "
EDIT: je viens de me rendre compte que tu l’avais déjà codé @supertiti : https://www.prorealcode.com/topic/divergences-tti-stoch-extreme/
(j’ai décidément du mal à comprendre …)
Toujours pas de solution ?
Graphe de PVL joint
Le code est juste au dessus, il suffit d’en faire un screener maintenant 🙂 L’assistant de ProScreener devrait pouvoir le faire pour toi.
@ Nicolas
J’ai bien essayé avec l’assistant mais en aucun cas il ne m’aide à trier les “signh” ou ” signb”
Si tu as 5 minutes pour regarder ?
merci, bonne journée
Bonsoir à tous,
Toujours pas de solution pour cet excellent indicateur ?
graphe joint de PVL avec 2 signaux d’achat ……… +11.55 % aujourd’hui !
Tu trouveras ci-joint le code du screener permettant de détecter les divergences de l’indicateur Stochastic Extreme avec le prix. J’ai ajouté une variable “lookback” en haut du code pour vérifier si une divergence a eu lieu entre la bougie courante et la période en arrière définis par cette valeur (10 périodes par défaut).
Les signaux semblent pertinents en effet.
Pour info, dans ProScreener, les paramètres de moyennes mobiles de type [period,typeMA] ne sont pas acceptés, il faut définir les moyennes mobiles en toutes lettres, comme ici avec “exponentialaverage”.
//PRC_TTI Stochastic Extreme Divergence | indicator
//https://www.prorealcode.com/topic/screener-divergences-tti/
overboughtzone=80
oversoldzone=20
if close>average[14] then
x1 = std[14]
else
x1 = -1*std[14]
endif
x2 = (summation[3](x1-lowest[5](x1))/summation[3](highest[5](x1)-lowest[5](x1)))*100
x3 = x1*averagetruerange[5]
x4 = (summation[3](x3-lowest[5](x3))/summation[3](highest[5](x3)-lowest[5](x3)))*100
x = average[3,1](x2)
y = average[3,1](x4)
// BEARISH DIVERGENCES CCI
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= -2
else
signB= 0
endif
// BULLISH DIVERGENCES CCI
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= 2
else
signH= 0
endif
////////////////////////////////////////////////
return signH as " div TTI STO H ", signB as " div TTI STO B " , 0 as " zero "
@ Nicolas
Es tu sûr du code ? en général un srcreener se termine par l’instruction : screener ….
@ Nicolas
Bonjour,
Je pense que tu as oublié de joindre le code du screener , alors quand tu auras le temps pourrais tu le joindre.
merci pour les infos
bonne fin de semaine
En effet c’est une bêtise, rappelle le moi dès lundi.
@ Nicolas
merci de poster le code quand tu pourras
bonne journée
Quel idiot, j’ai du le refaire ! je l’avais supprimé 😐 Bref, voici le code du screener, merci de faire quelques tests et de nous dire si c’est vraiment correct vis à vis de l’indicateur : (je pense que oui en effet)
//PRC_TTI StochExtreme Divergence | screener
//https://www.prorealcode.com/topic/screener-divergences-tti/
lookback = 10
overboughtzone=80
oversoldzone=20
if close>average[14] then
x1 = std[14]
else
x1 = -1*std[14]
endif
x2 = (summation[3](x1-lowest[5](x1))/summation[3](highest[5](x1)-lowest[5](x1)))*100
x3 = x1*averagetruerange[5]
x4 = (summation[3](x3-lowest[5](x3))/summation[3](highest[5](x3)-lowest[5](x3)))*100
x = exponentialaverage[3](x2)
y = exponentialaverage[3](x4)
// BEARISH DIVERGENCES CCI
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= -2
else
signB= 0
endif
// BULLISH DIVERGENCES CCI
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= 2
else
signH= 0
endif
////////////////////////////////////////////////
test = summation[lookback](signB<>0 or signH<>0)>0
screener[test]
Re-
Le code tel quel ne fonctionne pas ?! sur un screen du SRD en date de vendredi (fin de journée) il y a 13 valeurs retournées et une seule répond à la demande ( group open)
voici le code que j’utilise :
// DIVERGENCES TTI STOCHASTIC EXTREME
//TTI Sctochastic Extreme PRC 12.05.2017
//Nicolas @ www.prorealcode.com
if close>average[ma] then
x1 = std[ma]
else
x1 = -1*std[ma]
endif
//x2 = (summation[3](x1-lowest[5](x1))/summation[3](highest[5](x1)-lowest[5](x1)))*100
x3 = x1*averagetruerange[5]
x4 = (summation[3](x3-lowest[5](x3))/summation[3](highest[5](x3)-lowest[5](x3)))*100
//a = average[3,1](x2)
b = average[3,1](x4)
//return b as " ax4 ", 5 style(line) as "level 5", 95 style(line) as "level 95",close as "close"
// a style(dottedline)as "ax2"
// Variable :
// ma = 14 entier
///////////////////////////////////////////////////////////////////////
// DIVERGENCES STOCHASTIQUES BAISSIERES et HAUSSIERES d’après le code de HKlisse
x = b [p]
y=average[2](x)
// DIVERGENCES BAISSIERES TTI
if x>y 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= 5 //-2
else
signB= 0
endif
// DIVERGENCES HAUSSIERES TTI
if x<y 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= 5 //2
else
signH= 0
endif
////////////////////////////////////////////////
return signH as " div TTI H ", signB as " div TTI B " , 0 as " zero "
// Variable : p = 7
ok, je ne vais pas faire le jeu des différences, mais le code de l’indicateur des divergences que j’ai est celui de mon post précédent où je me suis trompé: https://www.prorealcode.com/topic/screener-divergences-tti/page/2/#post-62886
le bon code est celui que j’ai posté aujourd’hui à 11h54.
Ok, tu n’as que 4 lignes à ajouter/modifier, soit:
_ la correction pour les moyennes mobiles exponentielles
_ la variable lookback en début de code
_ la variable test à la fin du code
_ supprimer RETURN et remplacer par l’instruction SCREENER telle que dans ma version