Download MetaTrader 5
To add comments, please log in or register
Do you want to become a well-known developer? Execute the orders of traders in the Freelance service!
Carl Schreiber
5940
Carl Schreiber 2016.10.18 14:18 

.. this does not work as the ArraySize is zero:

//within OnInit() of an indicator:

         int i=0;
         SetIndexBuffer(i,Buff_A);
         SetIndexStyle( i,DRAW_LINE,STYLE_SOLID,1);
         SetIndexLabel( i,"EmaFast");
         i++;
         SetIndexBuffer(i,Buff_Ta1);
         SetIndexStyle( i,DRAW_NONE,STYLE_SOLID,1);
         SetIndexLabel( i,"EmaFast Tmp1");
         i++;
         SetIndexBuffer(i,Buff_Ta2);
         SetIndexStyle( i,DRAW_NONE,STYLE_SOLID,1);
         SetIndexLabel( i,"EmaFast Tmp2");
...

 and this

Comment("b: ",b,"  sz: ",ArraySize(Buff_FA),"  Hi[b] ",DoubleToString(High[b]));

shows:


Is there no way to automate the buffer indices?

I get the error 4051 = ERR_INVALID_FUNCTION_PARAMVALUE??

BTW I tried to use char, uchar, short, ushort, .. and even 1 ?

Now I have found it - if I use 0 it works 1 or and variable does not :(

//   #############      Problem solved    ########## //

As I was installing my oop-indi in an indicator (copied from a script and an EA) I forgot to set the initial Indi.-stuff:

#property  indicator_chart_window

#property  indicator_buffers 13
#property indicator_color1  clrYellow //fast
#property indicator_color2  clrNONE  //slow
#property indicator_color3  clrNONE   // high
#property indicator_color4  clrAqua   // low


Now even i++ works perfect!

Sorry

whroeder1
13610
whroeder1 2016.10.18 18:02  
gooly: .. this does not work as the ArraySize is zero:
SetIndexBuffer(i,Buff_A);
SetIndexBuffer(i,Buff_Ta1);
SetIndexBuffer(i,Buff_Ta2);
Comment("b: ",b,"  sz: ",ArraySize(Buff_FA),"  Hi[b] ",DoubleToString(High[b]));
Of course the size is zero, you never made Buff_FA a buffer.
Carl Schreiber
5940
Carl Schreiber 2016.10.18 19:32  
WHRoeder:
gooly: .. this does not work as the ArraySize is zero:
Of course the size is zero, you never made Buff_FA a buffer.
That was only my typo in this post. There were 13 buffers and both (Buff_FA and Buff_A) as the remaining 11 suffered from the same problem.
/
To add comments, please log in or register