|
Re-Boot Causes Duplicate Orders in Demo EA
I have written an EA that is hard-wired to use Daily data. And I'm testing it in a Demo account.
It includes code to close all pending orders for the attached Currency Pair, which match the magic number for that EA, before placing a new order.
And everthing functions properly in backtesting and live execution-- as long as the power doesn't go off. But, if I turn my computer off, the next time I power up a duplicate order will be created.
I can open the EA parameters and turn "allow live trading" off and back on again... and no duplicate orders occurs. I can even close MetaTrader down and reopen... and no duplicate orders occur.
But, if I turn my computer off, I get a duplicate order the next time I power up.
My EA is working well and shows consistent returns. So, I'd like to go live in a real account. But, I need to find a solution to this problem first.
Any suggestions?
Thanks,
Ellie
|