Need help with "dn = DateNum();"

#1
Hi,

From :
http://www.amibroker.com/kb/2006/03/04/how-to-export-quotations-from-amibroker-to-csv-file/

The following code exports AB Database to ASCII with any TF of choice, however the dates are in the YYMMDD format which would be much better in the standard YYYYMMDD format.

Im sure its something to do with the "DateNum();" function.

Ive looked up :
http://www.mail-archive.com/[email protected]/msg14144.html

and other links but din make much sense to me, any help would be greatly appreciated.

The AFL :
========================================
fh = fopen( Name()+""+".csv", "w" );
if( fh )
{
fputs("Symbol,Date,Time,Open,High,Low,Close,OpenInt,Volume\n", fh );

dn = DateNum();
tn = TimeNum();

for( i = 0; i < BarCount; i++ )
{
Line = Name() +
StrFormat(",%06.0f,%06.0f,%g,%g,%g,%g,%g,%g\n",
dn[ i ] % 1000000,
tn[ i ],
Open[ i ],
High[ i ],
Low[ i ],
Close[ i ],
OpenInt[ i ],
Volume[ i ] );

fputs( Line, fh );
}

fclose( fh );
}

Buy=Sell=0; // for scan
Filter = Status("lastbarinrange");
AddTextColumn("Export done", "Status");
=============================================

Thanks
 

Similar threads

Zerodha – Open Paperless Account

Open online account with Zerodha. Free delivery trading and Max Rs 20 for Intraday, F&O, Currency and Commodity Trading. Intraday High leverage with MIS, CO and BO.

Name:Phone:
Email:City:
State:
Are you a day trader?