Display separate indicator on tester chart

 

hello,


In my EA, I use this line to display a stream of signals:

iCustom(Symbol(),0,"Djahma_DisplayEA", signalea,1,0,1);


Then, within the indicator, I assign "signalea" to the indicator buffer:

#property indicator_separate_window
#property indicator_buffers 1
#property indicator_color1 Red

string short_name;
//---- Buffers
double EAvalue[];

//---- Extern variables
extern double valeurEA;
extern int numbar;
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int init()
{
short_name="EAvalue";
IndicatorShortName(short_name);
//---- indicators
IndicatorBuffers(1);
SetIndexStyle(0,DRAW_LINE);
SetIndexBuffer(0,EAvalue);
//----
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator iteration function |
//+------------------------------------------------------------------+
int start()
{
//Print("valeurEA=",valeurEA);
EAvalue[numbar]=valeurEA;

return(0);
}
//+------------------------------------------------------------------+


By calling this indicator from within the EA in tester mode, I actually get 7 windows for this indicator, none of which are showing the data I am passing across.


Any idea why is that?


Thanks,

D.

 

some thots for you to ponder ;)


In my EA, I use this line to display a stream of signals:


iCustom(Symbol(),0,"Djahma_DisplayEA", signalea,1,0,1);
.......... .................................................^^^^^^ A B C

"^^^" what is this?

Could it be that you meant to pass into the indicator "signalea" ?

if so, that would suggest that string short_name; should have extern attribute AND be the FIRST visually speaking in the source code, followed by valeurEA and finally by numbar

.

A,B,C...? the ordering gets confusing.
Please have a look at ed docs for iCustom()
where you have "signalea" should be the FIRST value which is loaded into the FIRST extern of indicator
where "A" is should be the SECOND value which is loaded into the SECOND extern of indicator
and so on.
"B" should be 0 as that means index buffer 0, IE, EAvalue[]

"C" is the element number of EAvalue[] which ClientTerminal extracts double value and that value is return value from iCustom()

.

.

.

Then, within the indicator, I assign "signalea" to the indicator buffer:

#property indicator_separate_window
#property indicator_buffers 1
#property indicator_color1 Red

string short_name;
//---- Buffers
double EAvalue[];

//---- Extern variables
extern double valeurEA;
extern int numbar;