DislikedFinally I hope to have solved the problem about multiple orders.
I use this simple bool variable to recognise the new bar:
if( Volume[0] == 1 ) {NumOrder_Long = 0 ;}
if( Volume[0] == 1 ) {NumOrder_Short = 0 ;}
Try this and let me know!
Thank you!Ignored
so before opening a position I'll always have my EA loop through current trades and check for matching symbol and magic number, blah blah...
Inserted Code
if (Time[0] <= OrderOpenTime()) { return (false); } else { return (true); }
I also loop through trades in history just in case, a trade has opened and close out within the same candle and the candle hasn't close yet.
your method is probably less cpu intensive. but I've been using my method for quite a while and it works fine. helps me make my EA work on all timeframes. Just something to consider. cheers and happy trading.
Zen
Programming for a better future.