bonjour a tous! j’ai trouver ce code sur un site http://sohocool.over-blog.com/article-26490268.html et je souhaiter ajouter une fleche d’achat directement sur le graf quand la ligne croise a la hausse la ligne 20 et une fleche de vente quand la ligne croise a la baisse la ligne 80 j’ai essayer plusieurs combinaison pour y arrivé mais je n’est pas réussie! quelqu’un pourrait’il m’aider svp merci d’avance!!
// oscillateur % b bollinger
// variable p = longueur moyenne mobile -
// s = coef standard deviation -et t = ma type
// par defaut p =20 - s =2 - t = simple prix = typicalprice =( c+h+l)/3
prix=customclose
gd2 = average[p,t](prix)
sd= s*STD[p](prix)
bollsup= gd2 + sd
bollinf = gd2 - sd
if close crosses over 20 then
DRAWARROWUP (barindex +1,low -1*pointsize)coloured(70,130,180)
endif
B1 = 100*(close - bollinf)/ ( BOLLSUP -BOLLINF)
RETURN B1 as "%b bollinger",20,50,80
On ne peut pas tracer des objets des graphiques hors fenêtre, c’est à dire que ton oscillateur ne peut pas créer de flèches sur le graphique du prix. Il faut donc modifier un peu le code original, pour ne pas retourner l’oscillateur Bollinger %b et appliquer le code au prix (pour voir les flèches sur celui-ci).
// oscillateur % b bollinger
// variable p = longueur moyenne mobile -
// s = coef standard deviation -et t = ma type
// par defaut p =20 - s =2 - t = simple prix = typicalprice =( c+h+l)/3
p=20
s=2
t=0
prix=typicalprice
prix=customclose
gd2 = average[p,t](prix)
sd= s*STD[p](prix)
bollsup= gd2 + sd
bollinf = gd2 - sd
B1 = 100*(close - bollinf)/ ( BOLLSUP -BOLLINF)
if close crosses over 20 then
DRAWARROWUP (barindex +1,low -1*pointsize)coloured(70,130,180)
endif
if close crosses under 80 then
DRAWARROWUP (barindex +1,high+1*pointsize)coloured(255,0,0)
endif
RETURN
Je n’ai pas testé.
bonjour nicolas!
merci de ta reponse et d’avoir repris le code je vais tester voir ce que sa donne
super sa fonctionne merci nicolas! j’ai fait une petite modif car pour avoir le signal c’est pas avec la close mais b1 qu’il faut mettre je repartage le code avec la petite modif!
merci encore nicolas!
// oscillateur % b bollinger
// variable p = longueur moyenne mobile -
// s = coef standard deviation -et t = ma type
// par defaut p =20 - s =2 - t = simple prix = typicalprice =( c+h+l)/3
p=20
s=2
t=0
prix=typicalprice
prix=customclose
gd2 = average[p,t](prix)
sd= s*STD[p](prix)
bollsup= gd2 + sd
bollinf = gd2 - sd
B1 = 100*(close - bollinf)/ ( BOLLSUP -BOLLINF)
if b1 crosses over 20 then
DRAWARROWUP (barindex ,low -1*pointsize)coloured(70,130,180)
endif
if b1 crosses under 80 then
DRAWARROWdown (barindex ,high+1*pointsize)coloured(255,0,0)
endif
RETURN
Bien vu ! Quel idiot je fais 😆
non, tu as peut etre voulut que je cherche un peut ;)! merci c’est sympa d’avoir repris le code et de la rapidité de ta réponse!