Vasiliy Sokolov: Bias towards const methods. I became a programmer in C# - and there it does not exist, because the limitation imposed by the modifier is not effective.
I naively thought that this modifier also tells the compiler where to create more optimal native code during compilation....
The main time in the strategy tester is spent on the work of its infrastructure (bar scrolling, emulation of the trading environment, etc.) The Expert Advisor code itself takes much less time.
On the other hand, profiling has shown that the main resource-intensive methods of CSTartegy are BuyInit, SellInit, BuySupport and SellSupport methods - i.e. the Expert Advisor logic itself. All other strapping is successfully compiled into flat code in an optimal way, or simply cut out if it is not used. That's why high-level OOP programming is justified.
Note that in more or less complex Expert Advisors with many rules and heavy infrastructure, programming in an initially flat form (without functions and OOP) will lead to inevitable programmer's errors, and as a consequence the performance of such an Expert Advisor will be even less than with OOP. The times of assembler are over. The compiler has long ago defeated a human in certain areas of optimisation. It is left for a human to define an initially competent and scalable architecture with a minimum number of interfaces and good manageability. .
I am in favour of OOP with my hands and feet. As long as only crutch solutions don't hide behind it, as with multisymbol OnTick. Which officially developers consider not a crutch solution.
Anton Zverev: I'm for OOP with my hands and feet. As long as only crutch solutions are not hidden behind it, as with multisymbol OnTick. Which is officially considered by developers as not a crutch solution.
Unfortunately, nothing can be done here at the user level. Although OnTick in CStrtategy is multivalent, its multivalence is also emulated through crutches. Simply at each incoming event the tick of another instrument is requested, and if it has changed, a new OnTick event is generated for this instrument. On FORTS, by the way, CStrategy provides a truly multicurrency OnTick, thanks to the OnBookEvent event. But again, this is an emulation when working in the tester.
Another option is to provide CStrategy with a resource indicator. At startup CStrategy launches an instance of this indicator on the necessary symbol and receives the event of a new tick arrival from it. Then it is converted to OnTick CStrategy. That is a classic crutch, but the whole implementation is masterfully hidden behind the scenes, and any strategy works in a unified way without knowing how these ticks were received.
Unfortunately, nothing can be done here at the user level. Although OnTick in CStrtategy is multicurrency, its multicurrency is also emulated through crutches. Simply at each incoming event the tick of another instrument is requested, and if it has changed, a new OnTick event is generated for this instrument. On FORTS, by the way, CStrategy provides a truly multicurrency OnTick, thanks to the OnBookEvent event. But again, this is an emulation when working in the tester.
Unfortunately, this approach misses ticks.
Another option is to provide CStrategy with a resource indicator. At startup CStrategy launches an instance of this indicator on the necessary symbol and receives the event of a new tick arrival from it. Then it is converted to OnTick CStrategy. That is a classic crutch variant, but the whole implementation is masterfully hidden behind the scenes, and any strategy works in a unified way without knowing how these ticks were received.
Yes, this variant and approved by the developers. But, IMHO, it seems terribly crutchy when you consider how the resources of an optimised tester are wasted on a task that is the simplest for other platforms. OOP certainly hides the crutch masterfully.
Yes, this option is approved by developers. But, IMHO, it seems terribly crutchy if we consider how resources of an optimised tester are spent on the simplest task for other platforms. OOP certainly hides the crutch masterfully.
Well, it is not so bad. Because indicators in MQL are very fast and work in their own thread. It turns out that we launch some mini listener that signals us about the arrival of a new event. I will think about this implementation in the next parts of the article.
I've read diagonally, very useful articles, I can hardly get through them - maybe I missed something, I'm interested in pendants, but many data are missing in the impulse, please point fingers... or do I have to enter them myself?????
'Ask' - function not defined Impulse.mqh 51 20
'Ask' - function not defined Impulse.mqh 51 28
'PendingOrders' - undeclared identifier Impulse.mqh 56 16
'GetOrder' - object pointer expected Impulse.mqh 58 44
'IsMain' - member function not defined Impulse.mqh 59 34
'Modify' - member function not defined Impulse.mqh 66 19
'Delete' - member function not defined Impulse.mqh 69 19
'Bid' - function not defined Impulse.mqh 85 20
'Bid' - function not defined Impulse.mqh 85 28
'PendingOrders' - undeclared identifier Impulse.mqh 90 16
'GetOrder' - object pointer expected Impulse.mqh 92 44
'IsMain' - member function not defined Impulse.mqh 93 34
'Modify' - member function not defined Impulse.mqh 100 19
'Delete' - member function not defined Impulse.mqh 103 19
'Bid' - function not defined Impulse.mqh 118 23
'Bid' - function not defined Impulse.mqh 118 31
'Bid' - function not defined Impulse.mqh 124 7
'Ask' - function not defined Impulse.mqh 136 23
'Ask' - function not defined Impulse.mqh 136 31
'Ask' - function not defined Impulse.mqh 142 7
20 error(s), 0 warning(s) 21 1
Сергей Криушин: I've read diagonally, very useful articles, I can hardly get through them - maybe I missed something, I'm interested in pendants, but many data are missing in the impulse, please point fingers... or do I have to enter them myself????
Good afternoon. Please update the trading engine to the latest version. It is attached to the fifth part of the article.
Сергей Криушин: I've read diagonally, very useful articles, I can hardly get through them - maybe I missed something, I'm interested in pendants, but many data are missing in the impulse, please point fingers... or do I have to enter them myself????
If you do not understand anything, you can ask questions in this thread.
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
Bias towards const methods. I became a programmer in C# - and there it does not exist, because the limitation imposed by the modifier is not effective.
I naively thought that this modifier also tells the compiler where to create more optimal native code during compilation....
I use it myself for self-control.
The main time in the strategy tester is spent on the work of its infrastructure (bar scrolling, emulation of the trading environment, etc.) The Expert Advisor code itself takes much less time.
On the other hand, profiling has shown that the main resource-intensive methods of CSTartegy are BuyInit, SellInit, BuySupport and SellSupport methods - i.e. the Expert Advisor logic itself. All other strapping is successfully compiled into flat code in an optimal way, or simply cut out if it is not used. That's why high-level OOP programming is justified.
Note that in more or less complex Expert Advisors with many rules and heavy infrastructure, programming in an initially flat form (without functions and OOP) will lead to inevitable programmer's errors, and as a consequence the performance of such an Expert Advisor will be even less than with OOP. The times of assembler are over. The compiler has long ago defeated a human in certain areas of optimisation. It is left for a human to define an initially competent and scalable architecture with a minimum number of interfaces and good manageability.
.
I naively thought that this modifier also tells the compiler where to create more optimal native code during compilation.....
I use it myself for self-control.
I'm for OOP with my hands and feet. As long as only crutch solutions are not hidden behind it, as with multisymbol OnTick. Which is officially considered by developers as not a crutch solution.
Unfortunately, nothing can be done here at the user level. Although OnTick in CStrtategy is multivalent, its multivalence is also emulated through crutches. Simply at each incoming event the tick of another instrument is requested, and if it has changed, a new OnTick event is generated for this instrument. On FORTS, by the way, CStrategy provides a truly multicurrency OnTick, thanks to the OnBookEvent event. But again, this is an emulation when working in the tester.
Another option is to provide CStrategy with a resource indicator. At startup CStrategy launches an instance of this indicator on the necessary symbol and receives the event of a new tick arrival from it. Then it is converted to OnTick CStrategy. That is a classic crutch, but the whole implementation is masterfully hidden behind the scenes, and any strategy works in a unified way without knowing how these ticks were received.
Unfortunately, nothing can be done here at the user level. Although OnTick in CStrtategy is multicurrency, its multicurrency is also emulated through crutches. Simply at each incoming event the tick of another instrument is requested, and if it has changed, a new OnTick event is generated for this instrument. On FORTS, by the way, CStrategy provides a truly multicurrency OnTick, thanks to the OnBookEvent event. But again, this is an emulation when working in the tester.
Unfortunately, this approach misses ticks.
Another option is to provide CStrategy with a resource indicator. At startup CStrategy launches an instance of this indicator on the necessary symbol and receives the event of a new tick arrival from it. Then it is converted to OnTick CStrategy. That is a classic crutch variant, but the whole implementation is masterfully hidden behind the scenes, and any strategy works in a unified way without knowing how these ticks were received.
Unfortunately, this approach misses ticks.
Yes, this option is approved by developers. But, IMHO, it seems terribly crutchy if we consider how resources of an optimised tester are spent on the simplest task for other platforms. OOP certainly hides the crutch masterfully.I've read diagonally, very useful articles, I can hardly get through them - maybe I missed something, I'm interested in pendants, but many data are missing in the impulse, please point fingers... or do I have to enter them myself????
I've read diagonally, very useful articles, I can hardly get through them - maybe I missed something, I'm interested in pendants, but many data are missing in the impulse, please point fingers... or do I have to enter them myself????
If you don't understand something, you can ask questions in this thread.