Optimizing an indicator inputs using variables in an EA

 

Hi all.

I have created an EA to get any custom indicator's parameters in string type and pass it to iCustom function with StrToDouble().

I want to optimize indicator inputs using variables (INPUT_1,INPUT_2,INPUT_3).

For example consider this indicator:

NAME = Aroon

INPUTS = 14,false,false

BUFFERS = 0,1


I want to add INPUT_1 as indicator's first input to be optimized,so inputs would be like {INPUT_1,false,false}. But when checking strategy tester Optimization box and inserting INPUT_1 instead of 14 and indicating INPUT_1  value,start,step,stop and checking it's box in EA inputs, no optimization happens and all the values are 0 in Optimization Results like the attached picture.

Bellow code is part of my EA and it's not the whole EA and it's Logic. 

How should i code my ea to do this optimizations?


//--Parts of EA

extern string name        ;
input  string inputs      ;
extern char   buffer1 = 0 ;
extern char   buffer2 = 1 ;

input  double INPUT_1 ;
input  double INPUT_2 ;
input  double INPUT_3 ;

indicator_value1 = iCustom(NULL,0,name,StrToDouble(inputs),buffer1,0);
indicator_value2 = iCustom(NULL,0,name,StrToDouble(inputs),buffer2,0);
Files:
EA.PNG  20 kb
 
Red748: any custom indicator's parameters in string type and pass it to iCustom function with StrToDouble().

Have you actually tested that that works in MT4? I doubt it.

Forget optimization, you haven't debugged your code yet.

 
William Roeder:

Have you actually tested that that works in MT4? I doubt it.

Forget optimization, you haven't debugged your code yet.

Yes i have tested and debugged it.

It works fine with indicator's main inputs, but when i want to use variables (INPUT_1) in inputs it doesn't work.

 
Red748: i want to use variables (INPUT_1) in inputs it doesn't work.

No kidding.

 
William Roeder:

No kidding.

I have seen it working in an EA.So no kidding.I just don't have access to that EA's source code.
Reason: