Bonjour,
Un petit coup de main serait grandement apprécié…
J’utilise le code ci-dessous pour détecter les Doji sur Heikin-Ashi. “Segments blanc sur le graphique”!
J’aimerai pouvoir déclencher des “Alertes” avec cet indicateur, ce qui n’est pas possible avec la seule fonction segment. Je souhaiterai donc rajouter une fonction (+1) dans une fenêtre indicateur.
J’ai beau rajouter l’instruction “Indicateur = 1″…rien n’y fait!!!
Si quelqu’un avait 2 minutes à me consacrer, ce serait vraiment sympa…
//Doji Heikin-Ashi | Indicator
once start=0
// Parameters
DojiSize = 5 //x% percent of body size compared to the complete range of the candlestick
// ---
if barindex>1 then
haclose=(open+close+low+high)/4
haopen=(haopen[1]+haclose[1])/2
xHigh = Max(haOpen, haClose)
xLow = Min(haOpen, haClose)
hahigh = Max(High,xHigh)
halow = Min(Low,xLow)
endif
indicateur=(abs(haopen - haclose) <= (hahigh - halow) * DojiSize/100)
if indicateur then
start=1
startbar=barindex
startprice=haclose
endif
if start=1 then
drawsegment(startbar,startprice,barindex,startprice)
endif
Return
Puisque “startbar” est le moment où le doji est repéré, il suffirait de tester si startbar a changé depuis la dernière bougie:
test = startbar<>startbar[1]
return test
La variable “test” est une booléenne qui retournera 1 si vrai.