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

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



PureBytes Links

Trading Reference Links

Hello,

Change
for( i = 0; i < BarCount; i++ )

to

for( i = BarCount - 2 ; i < BarCount; i++ )

Best regards,
Tomasz Janeczko
amibroker.com
----- Original Message ----- 
From: "Lester Vanhoff" <ebsn247lsm@xxxxxxxxxxxxx>
To: <amibroker@xxxxxxxxxxxxxxx>
Sent: Tuesday, January 02, 2007 5:37 PM
Subject: [amibroker] Exportt To ASCii: How To Limit Number Of Bars In The Loop?


> 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 ***/
>
>
>
>
> 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 NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
> http://www.amibroker.com/devlog/
>
> For other support material please check also:
> http://www.amibroker.com/support.html
>
> Yahoo! Groups Links
>
>
>
>
> 


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