Help with code

 
Maybe some of you codders can help me.
Sometimes i need to retrieve an indicator signal for an EA and i ve been having a problem with this. Let me show you an example:

================
double atrs1=iCustom(NULL, 0, "atrstops",10,5,2.5,1);

Comment(
"\n atrs1: ",atrs1,
"\n"
);
==================

This just retrieve the first signal "UP" value. But this indicator has 2 signals, an "UP" and a "Down" value. How can i get the 2d signal on my comment? I have the same problem when an indicator has 3, 4 or more signals.

thankx in advance.

Carllos
 
double atrs1=iCustom(NULL, 0, "atrstops",10,5,2.5,1);



You should use the line index to return both buffer values from indicator. I assume your "10,5,2.5" values are for the Parameter Set and the last "1" was your shift value.

Try this;

double atrs1=iCustom(NULL, 0, "atrstops",10,5,2.5,0,1); // Buffer 1
double atrs2=iCustom(NULL, 0, "atrstops",10,5,2.5,1,1); // Buffer 2

Comment('\natrs1: ",arts1,"   atrs2: ",arts2);
 
double atrs1=iCustom(NULL, 0, "atrstops",10,5,2.5,1);



You should use the line index to return both buffer values from indicator. I assume your "10,5,2.5" values are for the Parameter Set and the last "1" was your shift value.

Try this;

double atrs1=iCustom(NULL, 0, "atrstops",10,5,2.5,0,1); // Buffer 1
double atrs2=iCustom(NULL, 0, "atrstops",10,5,2.5,1,1); // Buffer 2

Comment('\natrs1: ",arts1,"   atrs2: ",arts2);




Thankx, it works ;)
Reason: