Here is a version of Graham's code with two digit years:

y = Year()%100;

/*****
1) Execution: AA - ApplyTo (set "filters") - Date Range (doesn't work) - Scan
2) if the output directory (folder) doesn't exist it will NOT be created.
3) Date format: mm/dd/yy.
4) References
   - Graham Kavanagh's code: 
http://www.amibroker.com/library/detail.php?id=327&hilite=fputs
****/

output_folder = "c:\\test\\";

fh = fopen(output_folder + Name() + ".csv", "w");

if (fh)
{
  fputs( "Date,Open,High,Low,Close,Volume,OpenInt\n\n", fh );
    y = Year()%100; // two digit year
    m = Month();
    d = Day();
  for( i = 0; i < BarCount; i++ )
    {
    ds = StrFormat("%02.0f/%02.0f/%02.0f, ", m[i], d[i], y[i] );
    fputs( ds, fh );
    qs = StrFormat("%.4f, %.4f, %.4f, %.4f, %.0f, %.0f\n", O[i], H[i], L[i], 
C[i], V[i], OI[i] );
    fputs( qs, fh );
    }
  fclose( fh );
}
Buy = 0;

/*** END ***/

--- In [email protected], "Tony Lei" <[EMAIL PROTECTED]> wrote:
>
> Thanks for the help.  I was able to find a code that Graham wrote a while
> back that meets my criteria.


Reply via email to