Could someone explain why this indicator is not loading correctly?

 

Hi,

I added a new buffer(trend) so i could call it using icustom from my ea and i also added a new external variable, the description is inside of the indicator. Every time i change the settings of the indicator alone on the chart i get "uninit reason 5" or when i cal it from the ea i get "initialized" & "loaded successfully" on a loop without getting my buffer properly. Here is the indicator i modified. Here is how i call the indicator:

extern string SRSI.Settings="---- SRSI Settings ----";

extern int PeriodRSI=14;

extern int StepSizeFast=4;

extern int StepSizeSlow=7;

extern string desc = "-- Distance between Slow and Fast line in order to trigger the trend buffer 0.0 - 3.0 --";

extern double StepDistance=1.2;

SRSI = iCustom(NULL,0,"StepRSI_v2",PeriodRSI,StepSizeFast,StepSizeSlow,StepDistance,3, 0);

Any inputs?

Thank You

Files:
 

Step RSI + Trend

Hello ,

I am not quite sure to understand everthing in the question but here is again the Indic with some coded lines addedsteprsi_v2.mq4 to visualise the "trend" buffer line.

If this can help...

Have a good trading week.

Tomcat98

Files:
 

You omitted one parameter from the iCustom() call (the "desc" parameter) and since mql passes parameters by position not by name, it is crashing the called indicator

The call should be like this :

SRSI = iCustom(NULL,0,"StepRSI_v2",PeriodRSI,StepSizeFast,StepSizeSlow,"",StepDistance,3, 0);

Even when a parameter is descriptive (like in the example you have), if it is declared as external, you can ommit it in a iCustom() call only if it is at the end of the parameters you use. In the example above I used "" (empty string) but you can use any string as long as it is a string (parameters types must be the same too)

investguy:
Hi,

I added a new buffer(trend) so i could call it using icustom from my ea and i also added a new external variable, the description is inside of the indicator. Every time i change the settings of the indicator alone on the chart i get "uninit reason 5" or when i cal it from the ea i get "initialized" & "loaded successfully" on a loop without getting my buffer properly. Here is the indicator i modified. Here is how i call the indicator:

extern string SRSI.Settings="---- SRSI Settings ----";

extern int PeriodRSI=14;

extern int StepSizeFast=4;

extern int StepSizeSlow=7;

extern string desc = "-- Distance between Slow and Fast line in order to trigger the trend buffer 0.0 - 3.0 --";

extern double StepDistance=1.2;

SRSI = iCustom(NULL,0,"StepRSI_v2",PeriodRSI,StepSizeFast,StepSizeSlow,StepDistance,3, 0);

Any inputs?

Thank You