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
Good afternoon, Yedelkin!
Sorry, here are the answers to your questions.
The indicator is created, but its colour is RED.
One more thing. The previous message was not meant for you, but for stringo,
except for the MA indicator parameters.
If it offended you in any way, I apologise.
Sincerely, Mikhail.
One more thing. The previous message was not meant for you, but for stringo,
I usually read exactly what it says: "Good afternoon, stringo and Yedelkin!". Urain already noted yesterday that I "can't read between the lines".
From the main response it's clear that zeroing of params array is not performed (and each variable ofMqlParam type has 4 fields, not 2). You can't see the answer to the comment: "Also, the IND_MA(iMA) indicator doesn't have such parameter as "Color", while you have it. You can see an example of how to use iMA here: MQL5 Reference / Access to timeseries and indicators / IndicatorCreate".
The returned error code is not specified.
Dear Yedelkin!
There is no need to zero the params array, because it is a static array (params[5]) and I
fill in all its fields. by the way, filling in 2 fields is enough. I think depending on TYPE one of 3
subsequent fields.
Noerror (ma_handle != INVALID_HANDLE), the indicator is created.
Tell me, how many parameters does the indicator have in the picture?
Mikhail
Noerror code, the indicator is created.
First you write"This code should have worked, BUT.... alas...". Now it turns out that"the indicator is being created". ....To "No error code" - there is always an error code, even if it is zero.
About the picture. You repeatedly reduce the question to a discussion of a possible, in your opinion, bug. But you have originally started to speak about using the IndicatorCreate() function in your code. As you yourself understand, the IndicatorCreate() function does not work with pictures. Once again I suggest: look through the documentation and its examples. Find (guess) why in the parameters tab appears the option "Style", but in the input parameters of the iMA indicator you don't have such an option. Find out what input parameters are provided for the indicator you've chosen and which of them should be reflected in the function IndicatorCreate().
I see, thank you.
Tell me, how many parameters does the indicator have in the picture?
Unlike iMA(4 parameters), the function
IndicatorCreate function must enter all possible parameters
MQL5 Reference:
int IndicatorCreate(
string symbol, // symbol name
ENUM_TIMEFRAMES period, // period
ENUM_INDICATOR indicator_id, // indicator type from the ENUM_INDICATOR enumeration
int parameters_cnt=0, // number of parameters
const MqlParam& parameters_array[]=NULL, // array of parameters
);
parameters_array[]=NULL
[in] Array of MqlParam type, the elements of which contain the type and value of each input parameter of a technical indicator.
You are sending me to the reference book, but you're not reading it?
You're referring me to a guidebook and you haven't read it yourself?
Here we go. With that approach, you may find yourself alone with your problem.
On the subject. The fact that you looked in the handbook is good. Now re-open it on the same page. You see the following line: "An array of MqlParam type, the elements of which contain the type and value of each input parameter of the technical indicator". What is "input parameter" is "input parameter"(MQL5 Reference / MQL5 Basics / Variables / Input variables). Now look for the answer to the question "how many input parameters does the iMA technical indicator have ?
Unlike iMA (4 parameters), the IndicatorCreate function must enter all possible parameters
The MA indicator has 7 parameters!
For the iMA function 4 parameters are enough
ma_handle = iMA( _Symbol, TimeFrame, 10, 0, MODE_SMA, PRICE_MEDIAN );,
but forthe IndicatorCreate() function all 7 indicator parameters must be possible
parameters_array[]=NULL
[in] Array of type MqlParam the elements of which contain type and value of each input parameter of the technical indicator.
One more thing... What is your profession?
and all 7 indicator parametersmust be possible forIndicatorCreate().