Features of the mql5 language, subtleties and tricks - page 170

 

If the EA receives data from another symbol/TF and it has not been ticking for a minute and a half, the next request of indicator from this instrument TF will return nonsense, although the CopyBuffer will work without errors, and the line above iTime and iOpen will also return the correct values.


About "time-series cache lifetime" I know (though, it seems, it was 3 minutes there), but why it "falls off", if there are no ticks, I don't understand at all. Made periodic jerking CopyClose by timer.

 
Andrey Khatimlianskii:

If the EA receives data from another symbol/TF and it has not been ticking for a minute and a half, the next request of indicator from this instrument TF will return nonsense, although the CopyBuffer will work without errors, and the line above iTime and iOpen will also return the correct values.


About "time-series cache lifetime" I know (though, it seems, it was 3 minutes there), but why it "falls off", if there are no ticks, I don't understand at all. Made periodic jerking CopyClose by timer.

Every two minutes you have to yank someone else's timeseries. Not less.
 
Artyom Trishkin:
Every two minutes you have to yank someone else's timeseries. Not less.

It was 150 seconds, calling on the ticks of that very foreign instrument. It worked fine. Only when such pauses in ticks happened it failed.

I have made it 50 seconds and timed it. I hope it will work. It is difficult to catch such "peculiarities".

 
Andrey Khatimlianskii:

It was 150 seconds, calling on the ticks of that very foreign instrument. It worked fine. Only when such pauses in ticks happened it failed.

I have made it 50 seconds and timed it. I hope it will work. It is difficult to catch such "peculiarities".

Somewhere Slava said about two minutes - not less. I usually set the timer for 90 seconds - normal.
 
fxsaber:

On a hedge a position can consist of several IN trades. This is done by partial execution.

In this case the order that is partially executed will change its ORDER_TIME_SETUP(_MSC) to the time of the first (possibly penultimate) trade. In other words, it would be impossible to determine from the history when, for example, BuyLimit was placed.


As a consequence, the position in the hedge can have a fractional open price, as it can often be seen on the netting.

Could you elaborate on this in more detail?

I've been struggling with the netting tool for a long time now. I use Stop and Limit order prices to keep the grid step intact. I want to understand, you are saying that the time of order placing changes when the order is partially executed? Can it happen? How can multiple IN trades affect an order?

Thank you for the highlighted one. I'll put a check on it. It is in the opening price of the order that something happens at times and the grid gets knocked off.

 
Alexey Viktorov:

Can you elaborate on that?

Here is the opening price of a live position still on the hedge.

The timing of the order is changing exactly in the history. The live order for the remaining volume - don't know.

 
fxsaber:

Here is the opening price of a live position still on the hedge.

The timing of the order is changing exactly in the history. The live order for the remaining volume - don't know.

Is it the price of the order or the position? I can of course assume that the time of the order for the remaining volume may have changed, after all, part of it has been executed, and the other part may have been placed on a separate order. But if we choose the history by position ID, the time of order with index 0 in the list of orders should not change, I think so. But I have put the price to be checked by print.

 
Alexey Viktorov:

Is it the price of an order or a position?

Positions.

Of course, I may admit that the time of the order for the remaining volume may change, after all, a part of it has been executed, and for the second part an individual order could be placed. But if you select the history by position ID, the time of order with index 0 in the list of orders should not change, it seems to me.

The opening order changes its time in the history.

 
fxsaber:

Positions.

The opening order changes its time in history.

The time the order was placed is not recorded on the image, but it was definitely yesterday as indicated in the history. And it was activated today. But it is the opening of the full volume. But I haven't had a partial opening yet. I will keep watching.


 
Alexey Viktorov:

The time of placing the order is not recorded in the picture, but it was definitely yesterday as indicated in the history. And it was activated today. But it is the opening of the full volume. But I haven't had a partial opening yet. I will continue to watch.

In the green frame at partial execution I have become equal to the lower red frame. Partial was two trades.