for(int s = OrdersTotal()-1; s>= 0; s--){ if(OrderSelect(s,SELECT_BY_POS,MODE_TRADES) && Symbol() == OrderSymbol() && Period() == OrderMagicNumber()){ //Executed if order is selected AND is the chart symbol AND is the stipulated magic number } else { //Executed if the order is NOT selected OR not the chart symbol OR is not the stipulated magic number }
Keith Watford #:
Thanks Keith :)
I did do some jiggery pokery around with this, and separated out the OrderSelect, the Symbol and the stipulated Magic Number.Because this EA is over around 20 instances, it would - of course - select the order but because the symbol would have been different on the other instances, it would naturally result in error messages from instances where no errors were occurring. Separating these out should resolve the issue.
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
So I have an EA which, itself, is executing perfectly, but I'm getting duplicate Journal messages. As you will see below, there are a vast number of duplicated journal messages, which I believe have resulted in Error #4025 - which is an OUT OF MEMORY issue.
These are not duplicated Print() functions in my EA - these are default MetaTrader Journal messages.
In addition, apparently I'm closing my positions with a price of 0.00000, again these are not EA-coded Print() functions.
The below was the result of my EA shorting 6 lots of the GBPCAD, closing 50% of my position and modifying my s/l to breakeven.