I have attached a chart and some code. So if we take this signal where the green and red arrows appear as an example on the chart. The code for condition 1 in line 7 states that if the price travels below the previous bar low by 20 ticks then a green arrow should print as the condition is hit. Only after that condition is met and price moves up and crosses over the Open of the last bar the red bar should print as the second condition is met.
Now the problem here is both arrows are being printed once the first first condition is met. I think this is because once the first condition is met i.e. it crosses 20 ticks below the last bar open then second condition is immediately met because price has already been greater than yesterdays open. So I am stumped as far as the second condition. I need the red arrow of the second condition to trigger and print only when condition 1 has been satisfied and only after which price has traveled upwards and crosses yesterdays open. Now if the current bar closes down and does not reach the open of the last bar then the green arrow should stay there on its own as only the first condition was satisfied.
I am not sure if I am missing something here but any further ideas would be appreciated.
Thanks
DJ
Comment