katsParticipant
Junior
Bonjour,
je souhaite mettre une flèche m’indiquant que la réalisations de la condition est remplie mais uniquement sur le chandelier sur laquelle elle se réalise.
Cependant la condition est une condition de close supérieur ou inferieur à une autre close sur un indicateur calculé ce qui fait que la flèche se positionne sur la bougie concernée mais également sur toutes les autres bougies qui suivent tant que la condition est vraie.
Voilà le code que j’utilise:
if c1 and c3 then
DRAWARROWUP (barindex,low-slippage)coloured(255,255,0)
endif
if c2 and c4 then
DRAWARROWDOWN (barindex,high+slippage)coloured(255,255,0)
endif
Ma question : est il possible de limiter cette indication sur la seule bougie ou la condition se réalise et si oui comment?
Merci d’avance
cdlt
JSParticipant
Senior
Hi,
You can try this:
Once Up=0
Once Down=0
If C1 and C3 and Up=0 then
DrawArrowUp(BarIndex,Low-Slippage)Coloured(0,255,0)
Up=1
Down=0
EndIf
If C2 and C4 and Down=0 then
DrawArrowDown(BarIndex,High+Slippage)Coloured(255,0,0)
Down=1
Up=0
EndIf
Hi!
You have to create a variable which change when conditions are met first time and this variable will change again when short conditions or exit conditions are met first time.
// define your conditions
c1 = close > close[1]
c2 = high > high[1]
longconditions = c1 and c2
sh1 = close < close[1]
sh2 = low < low[1]
shortconditions = sh1 and sh2
If longconditions and LngArrowOK = 0 THEN
DRAWARROWUP(barindex, low-0.1*tr) coloured(0,255,0)
LngArrowOK = 1
SrtArrowOK = 0
ELSif shortconditions and SrtArrowOK = 0 THEN
DRAWARROWDOWN(barindex, high+0.1*tr) coloured(255,0,0)
LngArrowOK = 0
SrtArrowOK = 1
ENDIF
RETURN
katsParticipant
Junior
Bonsoir
tout d’abord merci pour ces réponses rapides.
Par contre je n’ai pas compris le second message, est ce que je dois prendre le 1 ou le 2 pour répondre a ma demande svp
Cdlt
JSParticipant
Senior
Hi Kats,
The answers have crossed each other but basically say the same thing…