[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[amibroker] Re: Exportt To ASCii: How To Limit Number Of Bars In The Loop?



PureBytes Links

Trading Reference Links

Thanks a lot, Tomasz. Now everything works like a charm.

> TJ: Change
for( i = 0; i < BarCount; i++ )
to
for( i = BarCount - 2 ; i < BarCount; i++ )
> 
> Best regards,
> Tomasz Janeczko
> amibroker.com

> ----- Original Message ----- 
> 
> > Here is a sample code that exports eod data from AB to "ticker.CSV" files in C:\ZZ folder (based on Graham's article in AFL 
> > Library). How to limit the number of days exported from the current "all available" to just two days. I would obviously need to 
> > modify this line, but I don't have a clue how this "BarCount" loop really works:
> >
> > for( i = 0; i < BarCount; i++ )
> >
> > Here is the full code:
> >
> > /*** START ***/
> >
> > output_folder = "C:\\ZZ";
> > output_file   = "Mseod.csv";
> >
> > fh = fopen( output_folder + "\\" + output_file, "a");
> > if (fh)
> > {
> >  t = Name();
> >  p = "D";
> >  y = Year()%100;
> >  m = Month();
> >  d = Day();
> > for( i = 0; i < BarCount; i++ )
> >  {
> >  fputs( t + "," , fh );
> >  fputs( p + "," , fh );
> >  ds = StrFormat( "%02.0f%02.0f%02.0f,", y[i], m[i], d[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 ***/



Content-Description: "AVG certification"
No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.5.432 / Virus Database: 268.16.3/614 - Release Date: 1/2/2007 2:58 PM