This code works. You can change the titles to suit and remove the OI field.
Copy to an indicator. Select symbol to export. Use SCAN on selected symbol. Find your .csv file in C:\"TickerName".csv
/* Export intraday AND EOD data to CSV files, one file for each stock In the first line insert the directory you want to save them to, make sure the directory exists Select your charts to export with the "Apply to" filter in AA window (or just pick "current symbol") Select the timeframe period you want to save as using the AA "Settings" Press Scan button by Graham Kavanagh 05 Feb 2004 Removed intraday fields for Daily databases. Terry 6/4/2005 Added OI field. Terry 3/30/2006 */
fh = fopen( "c:\\"+Name()+".csv", "w"); if( fh ) { fputs( "Ticker,Date,Open,High,Low,Close,Volume,OI \n", fh ); y = Year(); m = Month(); d = Day(); r = Hour(); e = Minute(); n = Second();
for( ii = 0; ii < BarCount; ii++ ) { if (C[ii] > 0 OR V[ii] > 0 OR OI[ii] > 0) { fputs( Name() + "," , fh ); ds = StrFormat("%02.0f-%02.0f-%02.0f,", y[ ii ], m[ ii ], d[ ii ] ); fputs( ds, fh ); /* ts = StrFormat("%02.0f:%02.0f:%02.0f,", r[ ii ],e[ ii ],n[ ii ] ); fputs( ts, fh ); */ qs = StrFormat("%.4f,%.4f,%.4f,%.4f,%.0f,%.0f\n", O[ ii ],H[ ii ],L[ ii ],C[ ii ],V[ ii ], OI[ ii ] ); fputs( qs, fh ); } }
fclose( fh ); }
Buy = 0;
-- Terry
-----Original Message-----
Hello, I want to export OHLC data (Dly quotes) from amibroker to an excel spreadsheet. My required format in excel is "Scrip Name, Open, High, Low, Close, Volume". Pls tell me if there is any way of doing it. Regards, Tanmay. Please note that this group is for discussion between users only. To get support from AmiBroker please send an e-mail directly to SUPPORT {at} amibroker.com For other support material please check also: http://www.amibroker.com/support.html
SPONSORED LINKS
YAHOO! GROUPS LINKS
|