How to read or get the RSI or any indicator parameters in runtime - page 2

 
Cosmas Moses:

in mql5 "  IndicatorParameters()  " return the number of input parameters of the indicator which something that you are looking for , meanwhile in mql4 not much can do . As shown picture below , we can see mql5 offer much better Timeseries and indicator Access compare to mql4. 



I can see it. What a shame. I dream with the day when we can only code with MQL5 in both MT4 and MT5. Well, Cosmas and you all guys thank you so much for your help. Kind regards.

 
Jhojan Alberto Tobon Monsalve: I just discovered how to make it in MQL5 but not in MQL4, Does somebody know how to convert it into MQL4?

No you didn't.

int  IndicatorParameters(
   int               indicator_handle,     // indicator handle
   ENUM_INDICATOR&   indicator_type,       // a variable for receiving the indicator type
   MqlParam&         parameters[]          // an array for receiving parameters

The call requires the handle, which means you already provided the parameters when you got the handle.

Your orginal question is to get the parameters from an indicator not placed by code. Can't be done in either language.

 
William Roeder:

No you didn't.

The call requires the handle, which means you already provided the parameters when you got the handle.

Your orginal question is to get the parameters from an indicator not placed by code. Can't be done in either language.

This part is what I needed it. 

for(int p=0;p<params;p++) 
           { 
            par_info+=StringFormat("parameter %d: type=%s, long_value=%d, double_value=%G,string_value=%s\r\n", 
                                   p, 
                                   EnumToString((ENUM_DATATYPE)parameters[p].type), 
                                   parameters[p].integer_value, 
                                   parameters[p].double_value, 
                                   parameters[p].string_value 
                                   ); 
           } 

I can get the parameters from this snippet.

 
Jhojan Alberto Tobon Monsalve: I can get the parameters from this snippet.

How do you fill parameters[] with values?

 
William Roeder:

How do you fill parameters[] with values?

I only needed to read the parameters not filling or changing anything? Got it? Anyway, thanks.

 
Jhojan Alberto Tobon Monsalve: I only needed to read the parameters not filling or changing anything? Got it? Anyway, thanks.

You declared an array. It has no values unless you filled it. Get it?

 
William Roeder:

You declared an array. It has no values unless you filled it. Get it?

Well, this is not my script as I said before I found this script in the standard library of MQL5 so you need to send a message to MQL5 or metaquotes. For me this code is ok and works for me.