Skip to content

Instantly share code, notes, and snippets.

@marketcalls
Created December 7, 2014 05:58
Show Gist options
  • Select an option

  • Save marketcalls/6d0bc827303faf0cc8b8 to your computer and use it in GitHub Desktop.

Select an option

Save marketcalls/6d0bc827303faf0cc8b8 to your computer and use it in GitHub Desktop.
Export CSV data from Amibroker
fh = fopen( "c://AmiBackup//"+Name()+".csv", "w");
if( fh )
{
fputs( "Ticker,Date,Open,High,Low,Close,Volume
", fh );
y = Year();
m = Month();
d = Day();
//r = Hour();
//e = Minute();
//n = Second();
for( i = 0; i < BarCount; i++ )
{
fputs( Name() + "," , fh );
ds = StrFormat("%02.0f-%02.0f-%02.0f,",
y[ i ], m[ i ], d[ i ] );
fputs( ds, fh );
//ts = StrFormat("%02.0f:%02.0f:%02.0f,",
//r[ i ],e[ i ],n[ i ] );
//fputs( ts, fh );
qs = StrFormat("%.4f,%.4f,%.4f,%.4f,%.0f
",
O[ i ],H[ i ],L[ i ],C[ i ],V[ i ] );
fputs( qs, fh );
}
fclose( fh );
}
Buy = 0;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment