Unable to retrieve correct buffer info with ICustom

 

I am using a 64bit Vista machine. I have written a simple custom indicator that does not have any extern variables, it has 8 buffers filled with the value 1.0 . When I use ICustom to retrieve the buffer information to the EA and print it, in the Journal the values all come out as 0 . Can anybody tell me why this is. Thank you an advance.


Xaun


The Indicator

#property indicator_chart_window
#property indicator_buffers 8

double buf4_up[];
double buf4_down[];
double buf3_up[];
double buf3_down[];
double buf2_up[];
double buf2_down[];
double buf1_up[];
double buf1_down[];

int UniqueNum = 0070;

string shortname = "";
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {
      shortname = "#TFX";
         IndicatorBuffers(8);
   
         IndicatorShortName(shortname);
      //---- indicators
         SetIndexStyle(0,DRAW_ARROW);
         SetIndexArrow(0,110);
         SetIndexBuffer(0,buf4_up);
         SetIndexEmptyValue(0,0.0);
         SetIndexStyle(1,DRAW_ARROW);
         SetIndexArrow(1,110);
         SetIndexBuffer(1,buf4_down);
         SetIndexEmptyValue(1,0.0);
         SetIndexStyle(2,DRAW_ARROW);
         SetIndexArrow(2,110);
         SetIndexBuffer(2,buf3_up);
         SetIndexEmptyValue(2,0.0);
         SetIndexStyle(3,DRAW_ARROW);
         SetIndexArrow(3,110);
         SetIndexBuffer(3,buf3_down);
         SetIndexEmptyValue(3,0.0);
         SetIndexStyle(4,DRAW_ARROW);
         SetIndexArrow(4,110);
         SetIndexBuffer(4,buf2_up);
         SetIndexEmptyValue(4,0.0);
         SetIndexStyle(5,DRAW_ARROW);
         SetIndexArrow(5,110);
         SetIndexBuffer(5,buf2_down);
         SetIndexEmptyValue(5,0.0);
         SetIndexStyle(6,DRAW_ARROW);
         SetIndexArrow(6,110);
         SetIndexBuffer(6,buf1_up);
         SetIndexEmptyValue(6,0.0);
         SetIndexStyle(7,DRAW_ARROW);
         SetIndexArrow(7,110);
         SetIndexBuffer(7,buf1_down);
         SetIndexEmptyValue(7,0.0);
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator deinitialization function                       |
//+------------------------------------------------------------------+
int deinit()
  {
//----
   
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int start()
  {
      int limit;
      int counted_bars = IndicatorCounted();
  //---- the last calculated bar will be recalculated
      if(counted_bars > 0) 
          counted_bars--;
      limit = Bars - counted_bars - 1;
  //---- the main cycle
      for(int i = limit; i >= 0; i--)
        {
          //---- 
         buf4_up[i]=1.0;
         buf4_down[i]=1.0;
         buf3_up[i]=1.0;
         buf3_down[i]=1.0;
         buf2_up[i]=1.0;
         buf2_down[i]=1.0;
         buf1_up[i]=1.0;
         buf1_down[i]=1.0;

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


The EA

property link      ""

double test4_up[];
double test4_down[];
double test3_up[];
double test3_down[];
double test2_up[];
double test2_down[];
double test1_up[];
double test1_down[];

int UniqueNum = 009;

//+------------------------------------------------------------------+
//| expert initialization function                                   |
//+------------------------------------------------------------------+
int init()
  {
//----
      Print("Inside init");
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| expert deinitialization function                                 |
//+------------------------------------------------------------------+
int deinit()
  {
//----
      Print("Inside deinit");
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| expert start function                                            |
//+------------------------------------------------------------------+
int start()
  {
//----
   Print("Inside start");
   int counted_bars=IndicatorCounted();
   int y5m=0, y1h=0, y30m=0, y15m=0, yy=0;
   int i=0;
   int limit=Bars-counted_bars;

    for(i=0;i<limit;i++)
    {
      test4_up[i] = iCustom(NULL, 0, "#TestIndicator",0,i);
      test4_down[i] = iCustom(NULL, 0, "#TestIndicator",1,i);
      
    }
    for(i=0;i<30;i++)
    {
      Print("Test 4 UP ", test4_up[i]," Bar ",i );
      Print("Test 4 DOWN ", test4_down[i]," Bar ",i );
      //Print("This is a test");
    }
    
//----
   return(0);
  }
//+------------------------------

The Results