limiting one order per currency pair

 

I wish to utilize the same EA on many charts.

Last week when I tested it, I had a condition whereby it would only place one order at a time. So if it was on two charts and the signal was generated, it would only place one of the two orders. So I modified it and now, I tested it over night and it kept placing multiple orders with each tick. The general idea was that it would look at the last bar and create only one order per pair.

I could do this with a long series of IF statements, looping through all the open orders and comparing the symbol to Symbol().

However, perhaps there is a better way (?)

If I created a global var called Open_Order and set it to True when the order was created, I could check it before placing another order.

If I place the EA with this logic on multiple currency pairs, it should maintain that var only for the pair that the EA is attached.

Can anyone think of a problem with this method or, is there a better method?

Reason: