Download MetaTrader 5
To add comments, please log in or register
Deposit to your account using bank cards via Gate2Shop
tomas1983
26
tomas1983 2016.02.15 04:57 

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

Carl Schreiber
5960
Carl Schreiber 2016.02.15 08:27  
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]?
Ovo Cz
2953
Ovo Cz 2016.02.15 08:33  
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.
Carl Schreiber
5960
Carl Schreiber 2016.02.15 21:01  
Ovo:
You need to allocate the buffer with #property indicator_buffers.
Wouldn't he get a compiler error or at least a warning?
whroeder1
13644
whroeder1 2016.02.16 00:51  
nope; lack of a preprocessor directive can't generate a warning.
Zirkon
123
Zirkon 2016.02.16 08:05  
WHRoeder:
nope; lack of a preprocessor directive can't generate a warning.

Yes it does.

indicator buffers amount is less than needed       

/
To add comments, please log in or register