Hi..I am using the below script to export 1-minute data. I would like the date to be in YYYYMMDD format and time to be 24 hour with no AMPM designation.
// create folder for exporting purposes
fmkdir( "C:\\DataExport\\" );
// 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 );
fputs( "Date/Time,Open,High,Low,Close,Volume\n", fh );
// iterate through all the bars
for ( i = 0; i < BarCount; i++ )
{
// write ticker name
//fputs( Name() + "," , fh );
// write date/time information
fputs( DateTimeToStr( dt[ i ] ) + ",", fh );
// fputs( DateTimeToStr( str[ i ] ) + ",", fh );
//write quotations and go to the next line
qs = StrFormat( "%g,%g,%g,%g,%g\n", O[ i ], H[ i ], L[ i ], C[ i ], V[ i ] );
fputs( qs, fh );
}
// close file handle
fclose( fh );
}
// line required by SCAN option
Buy = 0;type or paste code here
The format should look like the below:
20070504 10:26,100.03,100.03,100.03,100.03,4700
20070504 10:27,100.04,100.04,100.04,100.04,300
20070504 10:29,100.00,100.00,100.00,100.00,400
20070504 10:31,100.01,100.01,100.01,100.01,200
20070504 10:34,100.02,100.02,100.02,100.02,100
Any help will be much appreciated.
Thanks,
Mike