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

RE: [amibroker] Creating a text file - NEVER MIND. Figured it out.



PureBytes Links

Trading Reference Links

here is an example Graham coded a while back.  use it as an example to do what you want.  it creates a .csv file for every symbol...
 
hth,
ron
 

/*

Export 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

Select the timeframe period you want to save as using the AA "Settings"

Press Scan button

by Graham Kavanagh 05 Feb 2004

Modified 4/1/2004 by ronbo to remove the Time column,

1. remove the dashes in the date

2. remove the Time column

3. customize the file location

*/

fh = fopen( "C:\\Program Files\\PFScan 2\\Data\\"+Name()+".csv ", "w");

if( fh )

{

fputs( "Ticker,Date,Open,High,Low,Close,Volume \n", fh );

y = Year();

m = Month();

d = Day();

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

{

fputs( Name() + "," , fh );

ds = StrFormat("%04.0f%02.0f%02.0f,",

y[ i ], m[ i ], d[ i ] );

fputs( ds, fh );

qs = StrFormat("%.3f,%.3f,%.3f,%.3f,%.0f\n",

O[ i ],H[ i ],L[ i ],C[ i ],V[ i ] );

fputs( qs, fh );

}

fclose( fh );

}

Buy = 1;

-----Original Message-----
From: amibroker@xxxxxxxxxxxxxxx [mailto:amibroker@xxxxxxxxxxxxxxx]On Behalf Of Dan Clark
Sent: Saturday, August 13, 2005 9:09 AM
To: amibroker@xxxxxxxxxxxxxxx
Subject: RE: [amibroker] Creating a text file - NEVER MIND. Figured it out.

 

 


From: amibroker@xxxxxxxxxxxxxxx [mailto:amibroker@xxxxxxxxxxxxxxx] On Behalf Of Dan Clark
Sent: Saturday, August 13, 2005 8:49 AM
To: amibroker@xxxxxxxxxxxxxxx
Subject: [amibroker] Creating a text file

 

Hi,

 

I’m trying to read from and save data to a file.   There is an fdelete function, but I can’t find an fcreate function.  How do you CREATE a file in AFL if it does not already exist?  

 

Regards,

 

Dan.




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





YAHOO! GROUPS LINKS