MT5 For those who care about speed.

 

I have a question: How dothe commands work?

There is aCAccountInfo class to work with the account,

When we access this command, terminal initiates a request to the server or this information is received all the time together with quotes and we just take it from the terminal buffer or a file on the disk?

In short, how long does this command take to execute? And if it reads from disk, how it depends on the type of drive or SSD ?

Full Text...

Actually the most important information which is needed operatively is presence of an open position or lack of it and also a price level of an open position.

I understand that this analysis should be done in void OnTrade() - that is, when the position is open, this subroutine will be initialized ?

 
Full texts, post in this forum.
 

So compare the time to request with the time to receive the value or execute the command. I understand it depends on your specific situation (communication line for example).

 

CAccountInfo does not access the trade server, it is issued from memory, it does not climb onto the disk.

 
zfs:

So compare the time to query with the time to get a value or execute a command. I understand it all depends on your specific situation (communication line for example).

And so test each command in this way?

I need to write an EA for quick execution and for that I need to understand the process and how it may turn out. I've seen many times the terminal hangs even though I use 1 tool, 1 EA and a couple of charts... I have also seen other glitches...although I put a fast SSD instead of a hibernating hard drive...

 
Renat:

CAccountInfo doesn't access the trade server, it's output from memory, it doesn't go to disk.

I specified the function incorrectly .I am interested inPositionGet...().

Position has a set of properties available to be read by thePositionGet...()function.

Thank you.

 
shelandr:

And so test each command in this way?

I need to write an EA for quick execution and for that I need to understand the process and how it may turn out. I've seen many times the terminal hangs even though I use 1 tool, 1 EA and a couple of charts... In addition, there are other glitches...although I put a fast SSD instead of a hibernating hard drive...

Compare local time before and after and get the performance, it depends on many factors and is individual for everyone.

https://www.mql5.com/ru/docs/dateandtime/timelocal
Документация по MQL5: Дата и время / TimeLocal
Документация по MQL5: Дата и время / TimeLocal
  • www.mql5.com
Дата и время / TimeLocal - Документация по MQL5
 
zfs:

Compare the local time before and after and get the performance, it depends on many factors and is individual for everyone.


https://www.youtube.com/playlist?list=PLIo3S7h2bgAD8afp8iN-MSy5irsL33PfE

To organise high-resolution counters and timers, use theGetTickCount()function, which outputs values in milliseconds.

Are you suggesting to measure in seconds? Even milliseconds is slow too.

my millisecond counter is always on, but if 1 out of 1000 cycles fails even in a minute, i can't catch it without special program.

I can't even catch 1 in a minute without a special program.

 
shelandr:

https://www.youtube.com/playlist?list=PLIo3S7h2bgAD8afp8iN-MSy5irsL33PfE

To organise high-resolution counters and timers, use theGetTickCount()function, which outputs values in milliseconds.

Are you suggesting to measure in seconds? Even milliseconds is slow too.

my millisecond counter is always on, but if 1 out of 1000 cycles fails even in a minute, i can't catch it without special program.

Besides, when the terminal hangs up, the counter doesn't work

It works up to that point, why measure what is not tangible, the fact that your terminal hangs is more likely an infinite loop in your algorithm, the presence of deep recursion, rather than the speed of the terminal.

 
zfs:

It works up to this point, why measure what is not tangible, the fact that your terminal hangs is more likely a loop in your algorithm, the presence of deep recursion, not the speed of the terminal.

Not at all - the terminal hangs only when there are 2 events - operation such as order modification and sharp price movement on the instrument - the exchange server closes all requests of clients and they hang.

When price movement is stabilized, it starts to serve clients' requests.

The reason is that the server at these moments either does not have time to process requests or it does it on purpose not to allow the client to receive a profit. To understand this, we need an exchange protocol MT%6 with brokerage companies server.

By the way, at this moment the position cannot be hacked even from the terminal - it is unavailable...

When there is no sudden movements, the system works pretty fast and manages to send an open position in a second... But I would like to get the time between the signal to open a position and an open position order up to 100 ms (although I know systems with time of 15 ms.

For this I am doing a lot of work, starting from upgrading hardware, operating system and choosing a provider...

МТ5 | Секреты трейдинга
  • admin
  • shelandr.ru
Маленький экскурс. На сегодня наиболее быстрым терминалом,позволяющим строить и запускать автоматически исполняемые стратегии ( роботы или эксперты ) является терминал метатрейдер 5 или сокращённо МТ5. Почему именно так? Есть ведь терминал МТ4… Да есть..и последний год я активно его применял и писал роботов и индикаторы.. Весьма эффективно...
 
shelandr:

Not at all - the terminal hangs only when there are 2 events - an operation such as modification of the order and sharp price movement on the instrument - the exchange server closes all requests of clients and they hang.

When price movement is stabilized, it starts to serve clients' requests.

The reason is that the server at these moments either does not have time to process requests or it does it on purpose not to allow the client to receive a profit. To understand this, we need an exchange protocol MT%6 with brokerage companies server.

By the way, at this moment the position cannot be hacked even from the terminal - it is unavailable...

You are telling such horror stories) 2 events are not processed together but sequentially, there are errors and they should be analyzed and avoided) Don't confuse server and terminal performance.
Reason: