why is my indicator showing only one buffer?

 

Please.. maybe you guys could figure it out.. I've been through it fast, then slow, then fast again.. next thing I know, it's 1am and I still haven't figured out why it will only draw one buffer imdex.


Thanks in advance!



#property copyright """
#property link ""
#property indicator_chart_window
#property indicator_buffers 4
#property indicator_color1 LightBlue
#property indicator_color2 Pink
#property indicator_color3 Lime
#property indicator_color4 Gray


extern string InputFilename     = "ArnNetInput.txt";
 double AWeight1;// = 0.706210026;
 double AWeight2;// = 0.149060496;
 double AWeight3;// = 0.325348281;
 double AConstant;// = -0.267434186;
 
 double BWeight1;
 double BWeight2;
 double BWeight3;
 double BConstant;
 
 double CWeight1;
 double CWeight2;
 double CWeight3;
 double CConstant;
 
 double DWeight1;
 double DWeight2;
 double DWeight3;
 double DConstant;


//---- buffers
double ExtMapBuffer1[];
double ExtMapBuffer2[];
double ExtMapBuffer3[];
double ExtMapBuffer4[];


//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
{
//---- indicators

SetIndexStyle(0,DRAW_LINE);
SetIndexBuffer(0,ExtMapBuffer1);
SetIndexShift(0,1);

SetIndexStyle(1,DRAW_LINE);
SetIndexBuffer(1,ExtMapBuffer2);
SetIndexShift(1,2);

SetIndexStyle(2,DRAW_LINE);
SetIndexBuffer(2,ExtMapBuffer3);
SetIndexShift(2,3);

SetIndexStyle(3,DRAW_LINE);
SetIndexBuffer(3,ExtMapBuffer4);
SetIndexShift(3,4);
//----
return(1);
}




//+------------------------------------------------------------------+
//|  Read                                                            |
//+------------------------------------------------------------------+
void Read()
  {
  int Fhandle;
  double Adjustment;
   
        Fhandle = FileOpen(InputFilename,FILE_CSV|FILE_READ,',');
        if(Fhandle > 0)
        {
              AWeight1 = FileReadNumber(Fhandle);
                        AWeight2 = FileReadNumber(Fhandle);
                        AWeight3= FileReadNumber(Fhandle); 
                        AConstant= FileReadNumber(Fhandle);
                        
                        BWeight1 = FileReadNumber(Fhandle);
                        BWeight2 = FileReadNumber(Fhandle);
                        BWeight3= FileReadNumber(Fhandle); 
                        BConstant= FileReadNumber(Fhandle);
                        
                        CWeight1 = FileReadNumber(Fhandle);
                        CWeight2 = FileReadNumber(Fhandle);
                        CWeight3= FileReadNumber(Fhandle); 
                        CConstant= FileReadNumber(Fhandle);
                        
                        DWeight1 = FileReadNumber(Fhandle);
                        DWeight2 = FileReadNumber(Fhandle);
                        DWeight3= FileReadNumber(Fhandle); 
                        DConstant= FileReadNumber(Fhandle);
                        
                
        } //end if(FileHandle > 0)
        FileClose(Fhandle);
}





//+------------------------------------------------------------------+
//| Custom indicator iteration function |
//+------------------------------------------------------------------+
int start()
{
Read();
Comment(      "Weight1: ",AWeight1, " ", BWeight1, " ", CWeight1, " ", DWeight1, 
         "\n","Weight2: ",AWeight2, " ", BWeight2, " ", CWeight2, " ", DWeight2, 
         "\n","Weight3: ",AWeight3, " ", BWeight3, " ", CWeight3, " ", DWeight3, 
         "\n","Constant: ",AConstant, " ", BConstant, " ", CConstant, " ", DConstant,
         "\n ", ExtMapBuffer2[2]);

int counted_bars=IndicatorCounted();
//---- check for possible errors
if (counted_bars<0) return(-1);
//---- last counted bar will be recounted
if (counted_bars>0) counted_bars--;
int pos=Bars-counted_bars;
double dResult1, dResult2, dResult3, dResult4;

//---- main calculation loop
while(pos>=0)
{

ExtMapBuffer1[pos]= iClose(0,0,pos + 3) * AWeight3 + iClose(0,0,pos + 2) * AWeight2 + iClose(0,0,pos + 1) * AWeight1 + AConstant;
ExtMapBuffer2[pos]= iClose(0,0,pos + 4) * BWeight3 + iClose(0,0,pos + 3) * BWeight2 + iClose(0,0,pos + 2) * BWeight1 + BConstant;
ExtMapBuffer3[pos]= iClose(0,0,pos + 5) * CWeight3 + iClose(0,0,pos + 4) * CWeight2 + iClose(0,0,pos + 3) * CWeight1 + CConstant;
ExtMapBuffer4[pos]= iClose(0,0,pos + 6) * DWeight3 + iClose(0,0,pos + 5) * DWeight2 + iClose(0,0,pos + 4) * DWeight1 + DConstant;

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

I tried running it ... no file!

Code looks okay (that's all I can do), so wonder if those weights are really what you're expecting

 
brewmanz:

I tried running it ... no file!

Code looks okay (that's all I can do), so wonder if those weights are really what you're expecting


Thanks brewmanz, it was the file that was the problem.. Appreciate your help!