EA is triggering too many orders at the same Bar

 

Hello

I have noticed that my EA is trigger is triggering too many orders at the same Bar although I've done my calculations to be judged for bar only once. (see attached EA triggers...png) 

This is making it so hard for me to debug/analyze each order to evaluate my EA

EA algo is as simple as updating a boolean flags depending on some indicators and if the whole flags are equal TRUE, EA do the order (see Judging Flags.png)

 I am also zeroing the flags when order is issued.



Any idea how EA can trigger many orders at the same bar although judging is supposedly based on only one index of the array e.g. Close[0] 

 
younis_traveller:

Hello

I have noticed that my EA is trigger is triggering too many orders at the same Bar although I've done my calculations to be judged for bar only once. (see attached EA triggers...png) 

This is making it so hard for me to debug/analyze each order to evaluate my EA

EA algo is as simple as updating a boolean flags depending on some indicators and if the whole flags are equal TRUE, EA do the order (see Judging Flags.png)

 I am also zeroing the flags when order is issued.



Any idea how EA can trigger many orders at the same bar although judging is supposedly based on only one index of the array e.g. Close[0] 

Can you please press Alt+S and write your code here?

 
 
younis_traveller: Any idea how EA can trigger many orders at the same bar although judging is supposedly based on only one index of the array e.g. Close[0] 
  1. You do realize that Close[0] is the same as Bid? And that it changes each tick?
  2. Either, wait for a new bar and open once.
              New candle - MQL4 programming forum #3 2014.04.04
  3. Or, act on a change of signal.
              MQL4 (in Strategy Tester) - double testing of entry conditions - MQL5 programming forum #1 2017.12.12


Reason: