![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
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
This topic is about backtesting speed. "OOP doesn't affect performance" is just in your mind. OOP affects performance in mql4/mql5, that's a fact, try it, compare and measure to adjust your mind to reality.
That doesn't mean OOP is bad or anything, but speed is certainly not an argument in favor of OOP with mql4/mql5 . I am tired to read "mind view" with no facts to support it. In any sense. Programming, including OOP, doesn't need "supporters", it needs facts and scientific approach.
Attached, well known MovingAverage EA provided with each platform, and the same EA where I used some classes from Standard Library. Make some backtests and come back to tell us that "OOP dont affects to performance".
2017.08.13 14:12:31.109 Core 1 EURUSD,M5: 89021070 ticks, 252073 bars generated. Environment synchronized in 0:00:00.062. Test passed in 0:02:06.782 (including ticks preprocessing 0:00:11.250).
2017.08.13 14:15:50.670 Core 1 EURUSD,M5: 89021070 ticks, 252073 bars generated. Test passed in 0:01:55.875.
2017.08.13 14:19:13.222 Core 1 EURUSD,M5: 89021070 ticks, 252073 bars generated. Test passed in 0:01:58.328.
2017.08.13 14:21:32.225 Core 1 EURUSD,M5: 89021070 ticks, 252073 bars generated. Test passed in 0:01:57.204.
"Normal" version.
2017.08.13 14:24:29.951 Core 1 EURUSD,M5: 89021070 ticks, 252073 bars generated. Environment synchronized in 0:00:00.141. Test passed in 0:02:24.906 (including ticks preprocessing 0:00:11.610).
2017.08.13 14:27:09.976 Core 1 EURUSD,M5: 89021070 ticks, 252073 bars generated. Test passed in 0:02:19.984.
2017.08.13 14:29:28.202 Core 1 EURUSD,M5: 89021070 ticks, 252073 bars generated. Environment synchronized in 0:00:00.031. Test passed in 0:02:13.094.
2017.08.13 14:31:59.773 Core 1 EURUSD,M5: 89021070 ticks, 252073 bars generated. Test passed in 0:02:19.703.
"OOP" version. Such very basic OOP usage is already 12.5% slower at minimum.
I think you are kidding if you use standard library as performance example. But I agree with you. The only truth are facts. Take one. My framework uses OOP deeply but outperforms native Bars datetime form easily. Are you sure OOP is slower or its the standard library implementation who penalty the performance?
https://www.mql5.com/en/forum/213355/page2
I think you are kidding if you use standard library as performance example. But I agree with you. The only truth are facts. Take one. My framework uses OOP deeply but outperforms native Bars datetime form easily. Are you sure OOP is slower or its the standard library implementation who penalty the performance?
https://www.mql5.com/en/forum/213355/page2
Only babbling, as always with you.
I challenge you to show us a faster backtest example using OOP versus "standard" coding.
Only babbling, as always with you.
I challenge you to show us a faster backtest example using OOP versus "standard" coding.
Ok. You have it here. Same performance. And as you know you always will have a small variation in results between tests for obvious reasons. No OOP penalty then if a code is slower with OOP the problem is the code itself, not OOP
Direct code
OOP code
Ok. You have it here. Same performance. And as you know you always will have a small variation in results between tests for obvious reasons. No OOP penalty then if a code is slower with OOP the problem is the code itself, not OOP
Direct code
OOP code
You are a "funny" guy.
You are a "funny" guy.
Why? You say OOP is slower. A class with hierarchy is OOP. But is not slower than direct code. If you are confused about terms is your problem. Anyways as I told you before your example is the worst for blame OOP because that library is not created for be fast, it's for be easy to use. Then is normal have overhead.
Why? You say OOP is slower. A class with hierarchy is OOP. But is not slower than direct code. If you are confused about terms is your problem. Anyways as I told you before your example is the worst for blame OOP because that library is not created for be fast, it's for be easy to use. Then is normal have overhead.
Ok. You have it here. Same performance. And as you know you always will have a small variation in results between tests for obvious reasons. No OOP penalty then if a code is slower with OOP the problem is the code itself, not OOP
Direct code
OOP code
What a beautiful OOP code.
OOP is slower when used in real EA. Anyone can now see how serious you are, with your amazing demonstration. You discredited yourself. Enough time lost.
It's a practical demostration you are wrong. But I agree with you. Its a waste of time...
It's a practical demostration you are wrong. But I agree with you. Its a waste of time...
What a beautiful OOP code.
The good is here...