Features of the mql5 language, subtleties and tricks - page 208
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
Apparently, I misunderstood the trading situation.
The way I pictured it: the pending limit order was executed by several trades. All this time it was hanging in live orders and the ORDER_TIME_SETUP field was not a constant. After the last trade it entered the history. At that moment, ORDER_TIME_SETUP became a constant.
Or it was not?
ORDER_TIME_SETUP is always a constant. When it got into the history - ORDER_TIME_DONE appeared.
ORDER_TIME_SETUP is always a constant. When hit in history - ORDER_TIME_DONE appeared.
Here I am now setting the delayed limit. Then I change it by hand and script and ORDER_TIME_SETUP changes.
What am I doing wrong?
You have posted about similar cases in the past:
https://www.mql5.com/ru/forum/170952/page170#comment_15824249
https://www.mql5.com/ru/forum/170952/page172#comment_15829154
Here I am now setting a delayed limiter. Then I change it manually and by script and ORDER_TIME_SETUP changes.
What am I doing wrong?
It does not change the set time.
You have posted about similar cases in the past:
https://www.mql5.com/ru/forum/170952/page170#comment_15824249
https://www.mql5.com/ru/forum/170952/page172#comment_15829154
Indeed I have. But I couldn't remember it at all. I think it's a bug.
I don't know what will happen with the repeated partial execution.
Now I know - at this broker (I'm leaning towards a bug in their software) it won't change any more.
Sometimes it is useful to know how often tics are broadcast.
A CloseBy transaction generates two trades. Swap of the first (first position in CloseBy) transaction contains the sum of swaps of both positions. Swap of the second trade is zero.
If partial closing of the position is done via CloseBy, then remaining part of the open position is deprived of swap - it is zeroed.
Result.
So there may well be a huge swap on the smallest position that has never gone through a rollover. And zero swap for a large position that has rolled over.
Calculating the number of rollovers (not the fastest option).
Example of use.
Result.
A CloseBy transaction generates two trades. Swap of the first (first position in CloseBy) transaction contains the sum of swaps of both positions. Swap of the second trade is zero.
If partial closing of a position is done via CloseBy, remaining part of the open position is deprived of swap - zeroed.
...
So there may well be a huge swap on a minimum position that has never gone through a rollover. And zero swap on a large position that has rolled over.
Amazing!
Is it because of rounding (so as not to lose or add a cent)?
Or is it just a rarely used operation, so it doesn't matter?
Amazing!
Is it because of rounding (so as not to lose or add a cent)?
Definitely not, as partial closures (OrderClose not full OrderLots) will drain the swap accordingly.
Or is it just a rarely used operation, so doesn't matter?
I don't think much thought has gone into the scenarios.