AliceRioBR:
In my EA I do a lot of comparisons among Custom Indicators' Buffers.
Just to make it easier for understanding, consider the comparison like:
So, considering the two above Indicators, would it be faster (and memory efficient) to continue this approach, or to adopt the following procedure?
- To create custom Buffers within each indicator, loading (as an example) a BOOL value;
- Make the above comparison inside the CALCULATE() routine and load the custom buffer with the result;
- Check these buffers in my EA.
I appreciate any light on this.
In the second case, your indicator calculations will be in another thread, therefore, and depending on the charts thread, these indicators are executed, you might have slower calculation results. But you will have under all circumstances multi-threadding synchronisation tasks to take care of.
Since the first approach is (in CPU-terms) very slim, I suggest you stay with that.
All indicators on a chart run in the same thread, as far as I am aware, this is also true for indicators loaded via EA iCustom. All charts of one symbol share the same thread. Depending on what's going on in this thread, your indicator might be "late" for your EA.
As the EA runs within a separate thread, doing the calculation there, will ensure timely results and chronologically correct execution without the need to synchronize with external data sources.
Dominik Christian Egert #:
In the second case, your indicator calculations will be in another thread, therefore, and depending on the charts thread, these indicators are executed, you might have slower calculation results. But you will have under all circumstances multi-threadding synchronisation tasks to take care of.
Since the first approach is (in CPU-terms) very slim, I suggest you stay with that.
All indicators on a chart run in the same thread, as far as I am aware, this is also true for indicators loaded via EA iCustom. All charts of one symbol share the same thread. Depending on what's going on in this thread, your indicator might be "late" for your EA.
As the EA runs within a separate thread, doing the calculation there, will ensure timely results and chronologically correct execution without the need to synchronize with external data sources.
Thank you Dominic, your answer enlighted me a lot!
Exactly because indicators run in their thread, I supposed that transferring the calculation to their buffers would get faster results and better efficiency.
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
In my EA I do a lot of comparisons among Custom Indicators' Buffers.
Just to make it easier for understanding, consider the comparison like:
So, considering the two above Indicators, would it be faster (and memory efficient) to continue this approach, or to adopt the following procedure?
I appreciate any light on this.