Discussion of article "Universal Expert Advisor: Pending Orders and Hedging Support (Part 5)" - page 2
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
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.