hi,
please, could you help me to undersand where is my mistake ?
i would like to draw an arrow on my graph only when low(3)>low(2) and low(1)>low(2) on price and stochastic at the same time. see attached graph, it works fine in the first graph, but why does it work too on sevond graph ?
here is the code :
// initialisation variables
finprix=0
finsto=0
posfinprix=0
posfinsto=0
// Calcul des pics de fin
if ( (low[3]>low[2]) and (low[1]>low[2]) and (Stochastic[14,3](close[3])>Stochastic[14,3](close[2])) and (Stochastic[14,3](close[1])>Stochastic[14,3](close[2])) ) then
finprix=low[2]
finsto=Stochastic[14,3](close[2])
posfinprix=barindex[2]
posfinsto=barindex[2]
endif
if finprix>0 and finsto>0 and posfinsto>0 then
DRAWARROWUP(posfinprix,finprix)coloured(255,10,10,255)
endif
return
I moved your topic in the right section of the programming forum.
Please use the insert code button, each time you want to post code in a forum message.
Could you explain why the arrow should not be triggered in the second image? If it does, it is obviously because your conditions are true.
Some coding tips: to refer to a previous value, you should use this syntax:
Stochastic[14,3](close)[3]>Stochastic[14,3](close)[2]
Is it possible to adjust the size of “drawarrow” in pro builder?