Your code ignores the first cross and draws a vertical line for the second. again ignores the third and draws a vertical line for the forth cross and so on for 20 candles.
What is wrong now? What do you expect?
Every time the vertical line is replaced with the same name:"2nd cross over".
Here at my end the code only counts up to 1 and at some points it starts it goes back and forth betwen 0 and 1 and when it reaches the second crossover its count_D becomes 1 again and the process repeats again and it doesnt the yellow line anymore.I have taken the liberty to read 100 bars and the output points out it must definately be something with the way i loop through candles .Results the EA detected a crossover but jumped back and forth ignoring the second crossover and going to and from the third crossover with the count value changing from 0 and 1 as shown in the image output.png below
You need a separate(unique) name for each vertical line.
thank you ,kkkk i now think the problem is with the loop let me tweak around that i added the seperate uname and the output is shown in the crossover_error.png
Thanks you are right . i reassigned a variable to check handle value in case its equal or below 0 in this case raise an alert
What is wrong now? What do you expect?
Every time the vertical line is replaced with the same name:"2nd cross over".
Here at my end the code only counts up to 1 and at some points it starts it goes back and forth betwen 0 and 1 and when it reaches the second crossover its count_D becomes 1 again and the process repeats again and it doesnt the yellow line anymore.I have taken the liberty to read 100 bars and the output points out it must definately be something with the way i loop through candles .Results the EA detected a crossover but jumped back and forth ignoring the second crossover and going to and from the third crossover with the count value changing from 0 and 1 as shown in the image output.png below
You need a separate(unique) name for each vertical line.
You need a separate(unique) name for each vertical line.
thank you ,kkkk i now think the problem is with the loop let me tweak around that i added the seperate uname and the output is shown in the crossover_error.png