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
Some DCs in real accounts assign all sorts of prefixes like "." or "FXF" to symbol names.
How can I use these prefixes?
I did so:
#define DEF_SPEC "FXF"
string SymbolsTrade[] = {"AUDCAD "DEF_SPEC ... -does not work
string SymbolsTrade[] = {"AUDCAD "+DEF_SPEC ... -it doesn't work like that either
all I get is FXF instead of the required AUDCADFXF.
Could you tell me how to implement this?
First, filling of an array with enumeration is only possible in the global scope, so no + will work there, only string constants.
Secondly, you have a static array that is not distributed, while a dynamic array cannot be filled with an enum.
The easiest way is to write a function that distributes and fills a dynamic array, it can do everything, add definitions to constants, etc.
First, filling an array with an enumeration is only possible in the global scope, so no + will work there, only string constants.
Secondly, you have not distributed static array, and dynamic array cannot be filled by enumeration.
The easiest way is to write a function that distributes and fills the dynamic array, it can do everything, add definitions with constants, etc.
You can also try to search all currency pairs existing in BC/BROKER and analyze composite currencies in them.
After that you can create a dynamic array of currency pairs taking into account adding any prefixes.
As far as I remember it is one of the universal options for MT5.
First, filling an array with an enumeration is only possible in the global scope, so no + will work there, only string constants.
Secondly, you have not distributed static array, and dynamic array cannot be filled by enumeration.
The easiest way is to write a function that will distribute and fill the dynamic array, it can do everything, add definitions to constants, etc.
In short, if I understood you correctly, you can't create a static string array of compound constants in the global scope, right?
You can see the code in the source code. Two methods are used to find the divergence:
1. The bool CSignalMACD::ExtState(int ind) method prepares data for searching;
2. The bool CSignalMACD::CompareMaps(int map,int count,bool minimax,int start) method looks for a market model with the specified parameters.
If it helps, here are comments to the methods in Russian:
For the bool CSignalMACD::ExtState(int ind) method
For the method bool CSignalMACD::CompareMaps(int map,int count,bool minimax,int start)
I also have a question, how to specify the divergence variant when creating an Expert Advisor using MACD signal? There are several variants of signals in the manual.
As everyone has already noticed, any signal can detect multiple market patterns. To control usage of patterns , call PatternsUsage(int value) method, where value is bit map of pattern usage (bit number and pattern number are the same). Bit is 1 - model is used, bit is 0 - model is not used (by default all bits are 1). The numbering of models as well as bits starts at 0.
Thus, if you want to use only divergence, you should use PatternsUsage(16);. Why 16? 16 is binary 10000b (i.e. bit 4 is 1, all other bits are 0). And just model 4 "divergence of the oscillator and price".
The only "but", you will have to do it "manually".
After completion of the Wizard, the source code will be opened in the editor. Find a place like this in the editor:
and add one line
filter0.PatternsUsage(16);
you'll get it:
That's all for now. If you have any questions, feel free to contact me.
As everyone has already noticed, any signal can detect multiple market patterns. To control the use of patterns , call the PatternsUsage(int value) method, where value is the bit map of pattern usage (bit number and pattern number are the same). Bit is 1 - model is used, bit is 0 - model is not used (by default all bits are 1). Model numbering as well as bits start from 0.
So if you only want to use divergence you need to use PatternsUsage(16);. Why 16? 16 is 10000b in binary (i.e. bit 4 is 1, the other bits are 0). And just model 4 "divergence of the oscillator and price".
The only "but", you will have to do it "manually".
After completion of the Wizard, the source code will be opened in the editor. Find a place like this in the editor:
and add one line
filter0.PatternsUsage(16);
you get:
That's all for now. If you have any questions, feel free to contact me.
Thank you. It worked. And there are more questions right away. In this variant of divergence, what time interval between neighboring tops (troughs) is taken into account?
I have an expert with which I try to deal with events.
I get events that do not correspond to actions.
Exactly corresponding to a click on the chart and a click of a button
A controversial event id=9(CHARTEVENT_CUSTOM), that is generated when e.g. the chart is shifted and there are about 10 similar events.
TheCHARTEVENT_OBJECT_ENDEDIT event was not checked.
Everything is not clear with all the rest. Either the description does not match the event number or the event of creating an object is generated incorrectly when creating the object manually.
In general, please help.
I have an expert with which I try to deal with events.
I get events that do not correspond to actions.
Exactly matches a click on the chart and a click of a button
A controversial event id=9(CHARTEVENT_CUSTOM), that is generated when e.g. the chart is shifted and there are about 10 similar events.
TheCHARTEVENT_OBJECT_ENDEDIT event was not checked.
All the rest are not clear. Either the description does not match the event number or the event of creating an object is generated incorrectly when creating the object manually.
All in all, please help.
You initially assign numeric correspondences to already assigned numeric constants CHARTEVENT_XXXXXXXX...
the problem is this:
you need to:
The others are not clear. Either the description doesn't match the event number, or the event of e.g. object creation is not generated correctly when the object is created manually.
Unfortunately, your question is not clear. What exactly is going wrong?