// open file for writing
// file name depends on currently processed ticker
fh = fopen( "c:\\DataExport\\" + Name() + ".txt", "w" );
// proceed if file handle is correct
if ( fh )
{
dt = DateTime();
// write header line
fputs( "Ticker,Date/Time,Open,High,Low,Close,Volume\n", fh );