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

RE: [amibroker] Re: How to write to a file with a dynamic name including a date



PureBytes Links

Trading Reference Links

No, I meant 
fh = fopen( "d:\\newfold\\msdata.txt", "a");
where msdata is a string that is dynamically constructed in
the afl and takes input from Date()

This should prevent overwriting old files.

Joseph Biran
____________________________________________
-----Original Message-----
From: amibroker@xxxxxxxxxxxxxxx
[mailto:amibroker@xxxxxxxxxxxxxxx] On Behalf Of Mike
Sent: Tuesday, July 01, 2008 2:23 PM
To: amibroker@xxxxxxxxxxxxxxx
Subject: [amibroker] Re: How to write to a file with a
dynamic name including a date

You can use any valid filename that you want.

Assuming that you will be looping through bars, you can just
use the 
Day(), Month(), Year() functions, then construct your file
name using 
the indexed value on a bar by bar basis.

See this library example for reference: 
http://www.amibroker.com/library/detail.php?id=1044&hilite=Y
EAR

You will, of course, have to modify it to suit your needs.
But, the 
concept of iterating through bars and accessing the
individual 
year/month/day is illustrated. Combine this with
fopen/fputs/fgets 
and you should be good to go:

http://www.amibroker.com/guide/afl/afl_view.php?id=225

Mike

--- In amibroker@xxxxxxxxxxxxxxx, "J. Biran" <jbiran@xxx>
wrote:
>
> 
> Is there a simple way in afl to read / write to a file
which
> name includes the date? 
> i.e. myfile20080701.txt 
> 
> Joseph Biran
> ____________________________________________
>



------------------------------------

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




------------------------------------

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

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/amibroker/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/amibroker/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:amibroker-digest@xxxxxxxxxxxxxxx 
    mailto:amibroker-fullfeatured@xxxxxxxxxxxxxxx

<*> To unsubscribe from this group, send an email to:
    amibroker-unsubscribe@xxxxxxxxxxxxxxx

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/