Well, this does not take into account how many orders may be open at the same time; otherwise, we would have to add the OrdersTotal (probably, minus the pending orders).
Not exactly, we need to count the number of orders in the history a = (OrdersHistoryTotal()+ 1) % 40
Well, this does not take into account how many orders may be open at the same time; otherwise, we would have to add the OrdersTotal (probably, minus the pending orders).
And what if there were open positions in other symbols or other Expert Advisors? Think about what you are writing
For starters, your lot calculation function is declared inside the start function. Take it out. Then there will be some errors with undeclared variable, but I think you can handle them on your own.
One more question, in which function to declare lot calculation? init, deinit?
Can the computer slow down because of the abundance of code (not optimised) in the EA? I.e. will the opening of trades and the process of making decisions by the EA itself be slowed down if it has a large code ?
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
Guys!
how do i make every 40th order a bigger lot? :: market and pending
How about this?
Not exactly, you should count the number of orders in the history a = (OrdersHistoryTotal()+ 1) % 40
Well, this does not take into account how many orders may be open at the same time; otherwise, we would have to add the OrdersTotal (probably, minus the pending orders).
Not exactly, we need to count the number of orders in the history a = (OrdersHistoryTotal()+ 1) % 40
Well, this does not take into account how many orders may be open at the same time; otherwise, we would have to add the OrdersTotal (probably, minus the pending orders).
And what if there were open positions in other symbols or other Expert Advisors? Think about what you are writing
For starters, your lot calculation function is declared inside the start function. Take it out. Then there will be some errors with undeclared variable, but I think you can handle them on your own.
Another question, in which function should I declare lot calculation? init, deinit?
Better to make a separate function and use it when needed (before opening a new position)
Better to make a separate function and use it when needed (before opening a new position)
Keeping Teak History
Hi all!
Question is - there is a script for saving tick history
...
FileSeek(ExtHandle,0,SEEK_END);
FileWrite(ExtHandle, TimeToStr(TimeCurrent(), TIME_DATE | TIME_SECONDS), Bid, Ask, iVolume(Symbol(), NULL, 0));
...
it writes like this:
...
2011.08.15 08:38:49;76.936;76.946;1389
2011.08.15 08:38:51;76.934;76.953;1390
2011.08.15 08:38:56;76.929;76.958;1391
2011.08.15 08:38:56;76.935;76.945;1392
...
That is, it turns out that the minimum unit of time is a second. So my question is, is there any way to write ticks in milliseconds ?
Thank you in advance.
So it turns out that the minimum unit of time is a second. So question - is there any way to write ticks in milliseconds ?
Look at GetTickCount... or else refer to the Windows function
Victor, following your advice I added the function. Now it doesn't compile.
Nested functions are not allowed
Nested functions are not allowed