Problem with Export iCustom Values

Back to topics list To post a new topic, please log in or register
avatar
26
Messi86 2015.09.05 10:55
 

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 

avatar
Moderator
3418
GumRai 2015.09.05 12:18 #
 

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

After parameter4 you need to add the buffer index 

avatar
Moderator
3418
GumRai 2015.09.05 13:59 #
 
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.
Back to topics list  

To add comments, please log in or register