
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
No, but maybe we're talking about different things.
This will always work.
Still made me open the terminal and check... Here are three runs of the same script and three results.
There's only one line in the script.
I mean that if an EA is working and a user decided to change the range of history displaying with his naughty hands, the EA will go crazy during the second switch. Now it will be smaller, now it will be larger, now it will be different from the memorized one. And even if the line
if(HT!=__TotalHist)
put > instead of !=, the situation will not change. If the EA is running when the setting is set to "Today" and switch to "All history"... what happens?
I wouldn't dream of touching OrderHistoryTotal(), why should I?
Just in case:))))
Just in case:))))
:))) OrdersTotal() is good enough for me
Maybe to make two timers? one compares OrdersTotal() values even once in 100 ms, and the second for safety once in a minute (or less frequently) in a loop - no mouse can miss there, if one of two dozen trades closes/opens once in 100500 times a minute later - I certainly will not die, I suppose the deposit too.
:))) OrdersTotal() is enough for me
Maybe I should make two timers? One of them compares OrdersTotal() values even once in 100 ms, and the second one - once in a minute (or less frequently) goes through the loop - not a single mouse can get through there, if one of two dozen trades closes/opens one minute later, than 100500 times - I surely won't die, and I suppose so will my deposit.
And how many orders open at the same time is provided by the algorithm?
Still made me open the terminal and check... Here are three runs of the same script and three results.
There is only one line in the script
What I mean is that if the EA works and a user decided to change the range of history displaying with his naughty hands, the EA will go crazy during the second switch. Now it will be smaller, now it will be larger, now it will be different from the memorized one. And even if the line
The situation will not change if we put > instead of !=. If the Expert Advisor is run at the moment when the setting is "Today" and switch to "All history"... what will happen?
In any case, it will not be equal, and the code will go further. But if we setif(HT >__TotalHist), then we will face problems.
And how many open orders does the algorithm stipulate in total?
Two or three dozen at the most.
In any case, it won't be equal and the code will move on. But if (HT >__TotalHist)then there is a problem
Vitaly, there will be problems in any case. Whatever way you look at it, if the EA is to react to changes in the amount of orders in the history, it will react regardless of how the amount of orders has changed. As a matter of fact, the amount of orders in the history can only increase, that is why I suggested that it would be less dangerous, but it does not solve the problem. Even if you have written it solely for yourself, you cannot rule out the possibility of manual switching. You never know what kind of text message will come to your mind)))
2-3 dozen at the most
For such a number, it would be easier to create an array of tickets or even an array of structures with order properties and check the change of type and close time on each tick. This will allow us to trace the activation of a pending order or closing of a position. And opening immediately after sending OrderSend(), add the size of the array and put everything you need in it.
That's the thing, you can shake orders 86400 times a day, but you didn't want to.
In that case, it would be hard to live without Artem's library.