With what to replace OnTradeTransaction() in mql4? - page 2

 
Ihor Herasko:

And the availability of light and internet? Not to mention the usual network packet loss. Cool MetaQuotes have become - they all guarantee everything! ))

Igor, the solution to all this is simple or very simple. If there are frequent power outages, rent a VPS. If such problems occur on VPS too, change the service provider. The same applies to loss of Internet on the part of the user. It is only possible to add an option to switch Internet provider. If the problem occurs at the side of DC... you know how and where to send them...
 
Ihor Herasko:

And the availability of light and internet? Not to mention the usual network packet loss. Cool MetaQuotes have become - they all guarantee everything! ))

Maybe you don't have a computer either?

 
Alexey Viktorov:
Igor, the solution to all this is simple or very simple. If there are frequent power outages, rent a VPS. If such problems happen on VPS too, change the service provider. The same applies to loss of Internet on the part of the user. It is only possible to add an option to switch Internet provider. If the problem occurs at the side of DC... you know how and where to send them...

And tell all this to ordinary users who work with experts? Users should not care about such things, otherwise such software is worthless.

 
prostotrader:

Maybe you don't have a computer either?

Yes, on the internet I am telepathic ))

 
Ihor Herasko:

Yes, on the internet I am telepathic ))

I see, but then don't make vague statements that might mislead

the members of this forum confused.

 
prostotrader:

I see, but then don't make vague statements that might mislead

members of this forum misleading.

This statement is false

Forum on trading, automated trading systems and strategy testing

How to replace OnTradeTransaction() in mql4?

prostotrader, 2020.01.26 14:59

You are hopelessly out of touch!

These events have been guaranteed for a long time!


To bank on the absence of a cliffhanger on VPS when trading is an additional financial risk.

 
prostotrader:

I see, but then don't make vague statements that might mislead

the members of this forum confused.

There are no misconceptions. If you are developing software, the first thing required of it is correct and reliable operation. If your Expert Advisor only uses OnTrade and OnTradeTransaction to support its positions and orders, the slightest failure in receiving information from them will distort the overall picture (we do not know for sure if a packet is lost from the server or not). The only more/less reliable way to collect this information is to loop through the list of positions/orders. Even then, if packet loss does occur, it cannot be permanent. Eventually (after two or three queries) the data will be retrieved and the overall picture will come into full agreement with reality.

Having said that, I am not claiming that using OnTrade() and OnTradeTransaction() is pointless. They can be used as an alternative channel for getting data. If the information came through this channel, we don't need to check the lists too much.

 

I am writing portable code. MT4/MT5 - thanks to MT4Orders.mqh from Mr. fxsaber. And tester/fighting - thanks to conditional compilation.

For the Strategy Tester, I use OnTradeTransaction and environment state storing in variables, which greatly speeds up optimization. For real - server polling, speed doesn't matter here.

 
Edgar Akhmadeev:

I use OnTradeTransaction and environment state storing in variables for tester, which speeds up optimization.

I would be grateful if you could provide some reproducible example (without interrogation of trading history).

 

If we need a quick solution, then I would place all the tickets toCArrayInt and compare the tickets of open orders with CArrayInt; the Search() method is there; if there is no ticket, we stop comparing CArrayIntwith counters of open orders, reset CArrayInt and write all the tickets into CArrayInt again and set globally described flag MyOnTradeTransaction - the sign that the order list has changed - the code will be quite compact