two diiferent EA-on same symbol-execute orders one behind another w/o stopping.Will adding MAGIC NUMBER help in or it has any other issue to resolve.

 

I have attached two different EA on same Symbol.Now when I allow autotrading to them orders are executed immediately like buy-buy-buy-buy non-stop one behind another.But when One of chart is closed the EA runs pefectly.They are two different stratergies that I want to run on EUR/USD.But I am unable to used both EA simultaneously hope you got the issue till now!!

Now how to resolve the problem.Has anyone encountered with the same issue.

I need to find some solution out of it. !!

 
  1. Magic number help isolate the EA's trade from every other. Uuse a OrderSelect loop to see if any order is open by the EA. You should already be doing that, if you don't want one EA to open multiple orders.
  2. You can also use a OrderSelect loop to see if any order is open on the EA's pair and not open if there is.
  3. Either of the above is not going to prevent two EA's seeing their signal and both opening on the same tick. For that you must use a mutex surrounding the OS loop test and opening.