indiquer la condition réalisée avec une flèche
- This topic has 4 replies, 3 voices, and was last updated 1 month ago by .
Viewing 5 posts - 1 through 5 (of 5 total)
Viewing 5 posts - 1 through 5 (of 5 total)
Forums › ProRealTime English forum › ProRealTime platform support › indiquer la condition réalisée avec une flèche
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
Hi,
You can try this:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
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.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
// 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 |