I have tried creating a dummy indicator:
bool get_indicator_params_type(ENUM_INDICATOR enum_ind, ENUM_DATATYPE &datatype[]) { int handle = IndicatorCreate(_Symbol, PERIOD_CURRENT, enum_ind); MqlParam parameters[]; ENUM_INDICATOR dummy_type; int num_params = IndicatorParameters(handle, dummy_type, parameters); PrintFormat("handle: %d, num_params: %d", handle, num_params); ArrayResize(datatype, num_params); for(int p = 0; p < num_params; p++) datatype[p] = parameters[p].type; return true; }
with no results. The output is:
"handle: 10, num_params: -1"
and then the "datatype" var is empty because the loop block is not processed.
Any other ideas?
Thanks, Cyberglassed.
I have tried creating a dummy indicator:
with no results. The output is:
"handle: 10, num_params: -1"
and then the "datatype" var is empty because the loop block is not processed.
Any other ideas?
Thanks, Cyberglassed.
Please read the documentation :
Return Value
The number of input parameters of the indicator with the specified handle. In case of an error returns -1. For more details about the error call the GetLastError() function.
The error I get is:
"4006: Array of a wrong type, wrong size, or a damaged object of a dynamic array"
so I think in this case the error description is a bit meaningless because I have used those three lines like that with success in other codes:
MqlParam parameters[]; ENUM_INDICATOR dummy_type; int num_params = IndicatorParameters(handle, dummy_type, parameters);
also I have tried with:
MqlParam parameters[1024];
but also no success.
The error I get is:
"4006: Array of a wrong type, wrong size, or a damaged object of a dynamic array"
so I think in this case the error description is a bit meaningless because I have used those three lines like that with success in other codes:
also I have tried with:
but also no success.
What is the value of enum_ind ?
I called the function with:
ENUM_DATATYPE datatype[]; get_indicator_params_type(IND_BANDS, datatype);
so, the value of "enum_ind" is: IND_BANDS
Anyway my goal is to get a list of parameters type given an indicator type,
so, if there is some other way than create a dummy indicator for me is Ok
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hello, I would like to get a list of parameters type given an indicator type.
for example, some function like:
thanks, Cyberglassed.