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

 
Combinator:
there can be tick skips.

The absence of skips is more for the tester. For real - just convenient, because possible omissions are not critical at all.

Forum on trading, automated trading systems and trading strategies testing

MT4 or MT5. What are the advantages and disadvantages?

fxsaber, 2018.01.30 21:09

  1. Missing quotes at a millisecond timer has almost nothing to do with the TS - nothing to do with time. Moreover, these quotes came dead (from the past), as there is a lag of several milliseconds even with MT5 with zero ping. Unfortunately, all quotes that have come to the terminal are always > 2-5 ms.
  2. OnTick execution may well be within 1 ms.
  3. If we talk about the tester, the current implementation of multisymbols through events is a super brake. And through a timer, there is no braking.
 
fxsaber:

The absence of skips is more for the tester. For real - just convenient, because possible misses are not critical at all

I think it's better to work by timer. I went to ontimer, requested last ticks for required instrument and you have actual information with minimal lag.

Especially when I last measured the speed of event delivery (to be fair, it was a long time ago), it was not happy.
 
Combinator:

I think it's better to work with timer.

I tell you, the solution has no alternative for the tester. For the real some advantage over the timer only in convenience and unloading of the timer. The overhead, of course, is large and on the real.

 
Combinator:
there may be skips of ticks

Of course there will be, but it will be less than when using OnTimer

 

In MT5, positions have no commission (as opposed to MT4). Because of this there are peculiarities

  • In the MT5 the commission for opening a position, as well as for closing a position is deducted directly from the balance.
  • For this reason the Equity before closing all positions does not show what the Balance will be after closing.
  • This means that you will not be able to calculate Breakeven in MT5.
 
fxsaber:

In MT5, positions have no commission (as opposed to MT4). Because of this there are peculiarities

  • In the MT5 the commission for opening a position, as well as for closing a position, is deducted from the balance immediately.
  • For this reason the Equity before closing all positions does not show what the Balance will be after closing.
  • This means that you will not be able to calculate the Breakeven in MT5.


You can calculate in the history of transactions of this position what commission was taken and multiply by 2

 
Vladislav Andruschenko:

You can calculate in the history of transactions for this position what commission was taken and multiply by 2.

This is a peculiarity of MT5. Here we have an example. As it turned out, Equity_MT4 and Equity_MT5 are different concepts.

The problem is solved with the mentioned breakeven in MT5, of course. But it is, to put it mildly, through ass, if we compare it with MT4.


I tried to play with ACCOUNT_PROFIT, it works like that.

 
On netting, it is elementary to lose the comment of an open position. To do this, it is enough to make any trade without a comment on the position symbol.
 
fxsaber:
On netting, it is elementary to lose the comment of an open position. To do this, all you have to do is make any trade without a comment on the position symbol.


This is an opportunity to change the position comment :)

 
Vladislav Andruschenko:

This is the ability to change the comment of the positions :)

As well as the magick, volume and opening price.