Problem with Export iCustom Values

 

Hi all,

i have one problem with this code:

 

void write_data()
{
  int handle;
  string filename = Symbol()  + ".csv"; 
  handle = FileOpen(filename,FILE_CSV|FILE_WRITE,',');
  if(handle < 1)
  {
    Print(" #", GetLastError());
    return(0);
    //FileClose(handle);
  }
  
  FileWrite(handle, "DATE","TIME","HIGH","LOW","CLOSE","OPEN","VOLUME","VALUE"); 
  int i;
  for (i=length-1; i>=0; i--)
  {
    FileWrite(handle, TimeToStr(Time[i], TIME_DATE), TimeToStr(Time[i], TIME_SECONDS),
                      High[i], Low[i], Close[i], Open[i], Volume[i],iCustom(NULL,0,"NameIndicator",parameter1,parameter2,parameter3,parameter4,i));
  }
  FileClose(handle);
  return(0);
}

 In column of "VALUE", all is 0.

The values of Open, Close... are all corrects.

What am i having wrong?

Thank you very much 

 

Assuming that you have the correct amount of parameters for the iCustom call.

After parameter4 you need to add the buffer index 

 
Messi86:

 But only put in csv the latest value. Can be because the market is close?

Possibly. Test it in the strategy tester, You can test indicators now. Files created in the strategy tester by an EA are put in the tester folder, so it is probably the same for indicators.
Reason: