On my demo account I'm trying out an EA that simultaneously opens multiple orders (in different currency pairs).
Each line is in the form of
OrderSend("AUDUSD",OP_SELL, Lot, MarketInfo("AUDUSD",MODE_BID), 2, NULL, NULL, NULL, 0, 0, CLR_NONE);
OrderSend("AUDJPY",OP_BUY, Lot, MarketInfo("AUDJPY",MODE_ASK), 2, NULL, NULL, NULL, 0, 0, CLR_NONE);
etc
However, I've run into a little problem. The EA opens all orders and then opens all orders again and then opens all orders again and keeps doing it till the account has no free margin left.
How do I limit it to a run once?
Each line is in the form of
OrderSend("AUDUSD",OP_SELL, Lot, MarketInfo("AUDUSD",MODE_BID), 2, NULL, NULL, NULL, 0, 0, CLR_NONE);
OrderSend("AUDJPY",OP_BUY, Lot, MarketInfo("AUDJPY",MODE_ASK), 2, NULL, NULL, NULL, 0, 0, CLR_NONE);
etc
However, I've run into a little problem. The EA opens all orders and then opens all orders again and then opens all orders again and keeps doing it till the account has no free margin left.
How do I limit it to a run once?