|
Help: Simple Save Data To A File
I'm tinkering around trying to figure out how to send 15 minute data to a file. Any help would be appreciated.
It compiles without errors. I put it in the Indicator folder and it's visible, but when I try to add it in MT4, it's not accepted - does not get added to the EURUSD chart.
int start()
{
int handle;
string tSymbol="EURUSD";
double rates_m15[][6];
ArrayCopyRates(rates_m15,tSymbol,PERIOD_M15);
handle=FileOpen("Out.csv",FILE_CSV|FILE_WRITE,',') ;
if (handle<1)
{
Print("File Out.CSV not found, the last error is ", GetLastError());
return(false);
}
else
{
FileWrite(handle,tSymbol,TimeToStr(rates_m15[0][0]),rates_m15[0][1],rates_m15[0][2],rates_m15[0][3],rates_m15[0,4]);
FileClose(handle);
Alert("Sent Data File");
}
}
|