[ARCHIVE] Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Nowhere without you - 3. - page 241
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
You have already been told what the reason is. The point is not i++ or i-- but rather in what end of the list we should start to delete orders from - the beginning of the list (as you did) or from the end of the list (as you must do in this case).
To understand what happens when orders are deleted, you need to know and understand how the orders are stored in the array.
When you delete the first order first (it is indexed by i=0), the indexes of all orders are shifted in the array - the first order becomes null, the second order becomes first, the third - second, and so on. This is why all the orders are not completely removed - in fact, when i becomes 6, the sixth order is shifted to the fifth position in the array of orders and the order is not selected by index 6.
When you delete orders from the end of the list, the shift will not happen - the first order has a zero position in the list, and it will continue to have it. The 10th order had position 9, it was deleted, then the 9th order, which has a position 8 in the list is deleted, and so on, until the first order with a position zero in the array of orders.
What's better and what? )
Please advise, I have set up the multicurrency tool to work with several currencies from one window. But the problem is that switching between currencies is so fast that there is no time to open an order. Within 3 minutes, 4 orders + 4 pending orders have opened. And there was a lot of switching between currencies.
http://vinin.ucoz.ru/forum/11
there are 2 user modifications Mod_1 and Mod_2
both have modification condition:
double TS;
int Min_Dist=MarketInfo(Symb,MODE_STOPLEVEL);
if (TS < Min_Dist)
TS=Min_Dist;
How to change it so the modification doesn't go through with a stop loss condition, for buy stop loss is less than trailing stop,
and for sell, stop loss is bigger than trailing stop
Hello.
Please help me to find a bug.
The code below doesn't work on the tester, while there is no such problem on the demo. There is no error in the logbook.
Thanks in advance.
What is the difference between calling functions from dll in MT4 and MT5? I compile dll, it works fine in MT5, but in MT4 it gives me error:
2011.10.06 23:00:34 Solaris executor EURUSDm,M1: cannot call function 'InfoOfTrading' from dll 'Solaris.dll'(error 127)
What the hell is this? - I`ve been racking my brains. :(
make a Win32 dll project
I will continue with my above question.
I have also used the above code in another EA. The situation with that EA was similar to that described above with the difference that the code conditions were fulfilled exactly the other way around (in the demo, again, everything was working without errors). But one day the tester worked correctly and the code was working properly according to the conditions given to it.
It's a real mysticism.
Also, for some reason optimization sometimes fails to work for me. Sometimes it recalculates something but resets all results to zero for some reason. It happens so on terminals of different brokers. However, when all the stars and constellations in the sky probably converge, everything starts working as it should.