Discussion of article "Library for easy and quick development of MetaTrader programs (part XIV): Symbol object" - page 4
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
Commented out the line from Datas.mqh, recompiled, error: 'CSymbol::CSymbol' - cannot access protected member functionTestDoEasyPart14.mq413120, downloaded part 15, updated Include DoEasy from the archive with part 15, recompiled, error again and there again.
Compiled the 15th part there everything is normal. By the way it is for MT4.
I don't go into details yet, just observing.
I described above the reason. To check, download the library of this part, but name the folder DoEasyPart14. Then in the EA from this part, in line 10 connect the library from its new location:
#include <DoEasyPart14\Engine.mqh>And everything will compile and work as written in this article. Both in MetaTrader4 and MetaTrader5.
The error you mentioned is not present here - I have already explained why. Let me say it again: this part is one step in creating a collection of symbols (already published part 15) and tracking symbol events (which have already been prepared and article #16 is being written). And you, having fully loaded the library from part 15, are trying to compile the intermediate result - creation of one symbol and checking if it works correctly - which is described in this article.
In other words - the test EAs attached to a particular article are compiled and work exactly with the version of the library from the same article.
I am describing the process of library development, not giving you an already polished and finished product from CodeBase. This is educational and creative material, not dry code for self-study.
Hello Artyom -- is there an easy way to extract or compute the average spread for a given symbol using your library, or it is something you recommend I code externally myself?
The average spread of a bar is recorded by the terminal in the parameters of each bar. It can be found by requesting bar data from MqlRates. The library contains this data for each bar.
Add up all the spreads of all bars in the sample under study and divide by their number.
I will not do automatic determination of the average spread for a symbol. Because it will slow down the library, and this is not a frequent need. You can easily implement this yourself if you wish.
The average spread of a bar is recorded by the terminal in the parameters of each bar. It can be found by requesting bar data from MqlRates. The library contains this data for each bar.
Add up all the spreads of all bars in the sample under study and divide by their number.
That's perfect, thank you!
Do you know how reliable is the spread data for each bar when in testing mode? Is this consistent across different brokers, or quality of spread data can vary?
That's perfect, thank you!
Do you know how reliable is the spread data for each bar when in testing mode ? Is this consistent across different brokers, or quality of spread data can vary?
No, unfortunately I do not know.