When does it make sense to keep part of the robot code in an indicator? - page 5
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
Bullshit! (c) A function call is always slower than the same code without a call. Just count the number of asembler operations and their execution time. It's possible only if some brake is specially put in EA at startup simultaneously with indicator (if someone wants to compare performance).
You yourself in your fanaticism count assembler operations, I proposed a concrete competition. Go ahead, write an EA with calculation of EMA in it, you don't need anything but EMA calculation, and I write an EMA indicator and an EA calling it - let's compare the speed of operation.
Also, in an EA, you'll just get tired of doing some of the things that you would do in an indicator like 2x2.
- Where do you want to go? Answered the Cheshire Cat.
- I don't care.
- Then you don't care where you want to go.
Also in the Expert Advisor you will simply get tired of doing some things, which in the indicator can be done as 2x2.
If calculations are absolutely identical, for example, SMA in EA and in the indicator is calculated through the cycle for the whole period, then when you call the external indicator, the testing will go a little longer, by 10-30%.
Why would you use a cycle to calculate the SMA? multiply, subtract, add, divide and no cycle. You do not need an indicator for that. But it is up to the user to figure it out. The optimal calculations are another science.
So why use a cycle to calculate the SMA? multiply, subtract, add, divide and no cycle
This is an example for comparison. Identical calculations in the same volume with and without external indicator call.
You can calculate assembler operations yourself in your fanaticism, I have proposed a specific competition. Go ahead, write an Expert Advisor with EMA calculation in it, you do not need anything but EMA calculation, and I write an EMA indicator and an Expert Advisor calling it - let's compare the speed of work.
The only thing that remains is the improper work of the compiler that allows such things.
Unfortunately I don't believe in perpetual motion or other extraterrestrial wonders. ))
This leaves only a faulty compiler which allows such things.
It is not the compiler malfunction but the coder malfunction
Unfortunately I don't believe in perpetual motion or other extraterrestrial wonders. ))
This leaves only a faulty compiler which allows such things.
I am not suggesting to believe, I am suggesting to be specific - you calculate EMA only in Expert Advisor, I calculate it in indicator and call this indicator from Expert Advisor and compare its speed.
So why use a cycle to calculate the SMA? multiply, subtract, add, divide and no cycle. You do not need an indicator for that. But it is up to the user to figure it out. Optimal computing is a completely different science.
I am not suggesting to believe, I am suggesting to be specific - you calculate EMA in Expert Advisor only, I calculate it in Indicator and call this indicator from Expert Advisor and compare its speed.
So you claim that the same code in the indicator will run faster than in the Expert Advisor, even without considering the handling time?