indiquer la condition réalisée avec une flèche
Forums › ProRealTime English forum › ProRealTime platform support › indiquer la condition réalisée avec une flèche
- This topic has 4 replies, 3 voices, and was last updated 1 year ago by
JS.
-
-
03/21/2024 at 3:41 PM #230210
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)
endifMa 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
03/21/2024 at 4:18 PM #230217Hi,
You can try this:
Limit Arrow Draw1234567891011121314Once Up=0Once Down=0If C1 and C3 and Up=0 thenDrawArrowUp(BarIndex,Low-Slippage)Coloured(0,255,0)Up=1Down=0EndIfIf C2 and C4 and Down=0 thenDrawArrowDown(BarIndex,High+Slippage)Coloured(255,0,0)Down=1Up=0EndIf1 user thanked author for this post.
03/21/2024 at 4:20 PM #230218Hi!
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.1234567891011121314151617181920// define your conditionsc1 = close > close[1]c2 = high > high[1]longconditions = c1 and c2sh1 = close < close[1]sh2 = low < low[1]shortconditions = sh1 and sh2If longconditions and LngArrowOK = 0 THENDRAWARROWUP(barindex, low-0.1*tr) coloured(0,255,0)LngArrowOK = 1SrtArrowOK = 0ELSif shortconditions and SrtArrowOK = 0 THENDRAWARROWDOWN(barindex, high+0.1*tr) coloured(255,0,0)LngArrowOK = 0SrtArrowOK = 1ENDIFRETURN1 user thanked author for this post.
03/21/2024 at 5:49 PM #23022603/21/2024 at 6:21 PM #230227 -
AuthorPosts