fail to use externalbuffer, please help

 

hello mql4s ppl, sry for my noob quistion. but im stuck on this for 3 days now, il be heppey to be resque.

i have indicador "A" that send exteralbuffer like that:

#property indicator_label1  "USD Blue"
#property indicator_type1   DRAW_LINE
#property indicator_color1  clrDodgerBlue
#property indicator_style1  STYLE_SOLID
#property indicator_width1  2

double         Label1Buffer[];

int OnInit()
  {
   SetIndexBuffer(0,Label1Buffer);
   return(INIT_SUCCEEDED);
  }

int OnCalculate(const int rates_total,
                const int prev_calculated,
                const datetime &time[],
                const double &open[],
                const double &high[],
                const double &low[],
                const double &close[],
                const long &tick_volume[],
                const long &volume[],
                const int &spread[])
  {

int i = 0;
int mybuffer = "doing some calculation here"
Label1Buffer[i] = mybuffer;

  }

 if i print "mybuffer" from indicator "A" i get result "x", if i print it from indicator "B" i get deffernt result...
this is the code for indicator "B":

Print(iCustom(NULL, 0, "indicatorA", 0,0));

 can u tall what im doing worng?
tnx

 
tomas1983:

hello mql4s ppl, sry for my noob quistion. but im stuck on this for 3 days now, il be heppey to be resque.

i have indicador "A" that send exteralbuffer like that:

 if i print "mybuffer" from indicator "A" i get result "x", if i print it from indicator "B" i get deffernt result...
this is the code for indicator "B":

 can u tall what im doing worng?
tnx

Why don't you make a normal test by assigning a double value to Label1Buffer[i]?
 
tomas1983:

hello mql4s ppl, sry for my noob quistion. but im stuck on this for 3 days now, il be heppey to be resque.

i have indicador "A" that send exteralbuffer like that:

 if i print "mybuffer" from indicator "A" i get result "x", if i print it from indicator "B" i get deffernt result...
this is the code for indicator "B":

 can u tall what im doing worng?
tnx

You need to allocate the buffer with #property indicator_buffers.
 
Ovo:
You need to allocate the buffer with #property indicator_buffers.
Wouldn't he get a compiler error or at least a warning?
 
nope; lack of a preprocessor directive can't generate a warning.
 
WHRoeder:
nope; lack of a preprocessor directive can't generate a warning.

Yes it does.

indicator buffers amount is less than needed       

Reason: