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

Re: [amibroker] Re: fopen read/write



PureBytes Links

Trading Reference Links

hi,
 
not really. I thought that was intended to introduce multi-dimensional arrays in Amibroker. I will have a look,
 
rgds, Ed
 
 
 
----- Original Message -----
From: vlanschot
Sent: Wednesday, June 13, 2007 10:25 AM
Subject: [amibroker] Re: fopen read/write

Have you thought about using the Osaka plug-in?

PS
--- In amibroker@xxxxxxxxxps.com, "Edward Pottasch" <empottasch@...>
wrote:
>
> ok thanks Ara. Indeed I believe one can not use fopen(fn,rw);
where rw means reading as well as writing. I just want to be able to
replace 100 but not during trading just when I am checking my basket
after I set it up. Then I can compare exit and profit target orders
with the existing positions,
>
> rgds, ed
>
>
>
> ----- Original Message -----
> From: Ara Kaloustian
> To: amibroker@xxxxxxxxxps.com
> Sent: Tuesday, June 12, 2007 4:21 PM
> Subject: Re: [amibroker] fopen read/write
>
>
>
> Ed,
>
> When you use text files (as in AFL), I beleive you can not change
contents. You can just add lines. (You might try replacing the line
with a blank and then re-write with desired contents - but am not
sure)
>
> Suggest you change the format and add a correction to the
existing line. This is possible as long as you have not closed the
file or added a carriage return.
>
> The new line could look like this:
>
> SELL, 100, CHRW, STK, SMART, LMT, 52.44, 1,80,
>
> where you have ordered 100 shares and got filled on 80.
>
> This would require to write each line in 2 write operations
>
> For statistical info this might be better, so you know how often
you get partial fills.
>
> Ara
> ----- Original Message -----
> From: Edward Pottasch
> To: amibroker@xxxxxxxxxps.com
> Sent: Tuesday, June 12, 2007 5:38 AM
> Subject: Re: [amibroker] fopen read/write
>
>
> hi Joe,
>
> thanks for your reply. I have a basketfile with lines like:
>
> SELL, 100, CHRW, STK, SMART, LMT, 52.44, 1,
>
> a whole bunch of lines like this one above I send to the TWS. I
wrote some code that checks if the number of shares correspond to the
number of shares I have in my portfolio at IB.
>
> So I want to be able to look at the number 100 in this example,
compare it to the real number of shares I have and then adjust the
number 100 if necessary. I know I could open a second file and use
it to write to. I however want to use the same file and change a
number in that file if necessary. In C or C++ or any other language
this is possible. Since AFL uses more or less the C syntax I wondered
if we could do this in AFL as well,
>
> rgds, Ed
>
>
>
> ----- Original Message -----
> From: Joe Landry
> To: amibroker@xxxxxxxxxps.com
> Sent: Tuesday, June 12, 2007 2:19 PM
> Subject: Re: [amibroker] fopen read/write
>
>
>
> Ed, as I read your question literally, YES, one can read,
write and append to a file. Like so from the Users Guide.
> Simultaneously - NO. Programs including AFL are serial.
>
> Now if you mean you want to change some elements or fields in
that file, you'll have to read in the record of that file, change the
field and write the record back out.
>
> HTH
> Joe
>
> >>>
> fputs( string, filehandle )
> RETURNS NOTHING
> FUNCTION Writes (puts) the string to the file.
> The filehandle must be a number returned by fopen function
used to open the file.
> The file has to be open for writing or appending ("w" or "a")
for this fputs to work.
>
>
>
> ----- Original Message -----
> From: Edward Pottasch
> To: amibroker@xxxxxxxxxps.com
> Sent: Tuesday, June 12, 2007 6:26 AM
> Subject: [amibroker] fopen read/write
>
>
>
> hi,
>
> anyone know if one can read + write to a file. I need to
read a file and change some numbers if necessary. Seems that AFL can
only read or write or append. In C or C++ it is possible
simultaneously. Anyone know how to do it in AFL?
>
> thanks, Ed
>

__._,_.___

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





SPONSORED LINKS
Investment management software Investment property software Investment software
Investment tracking software Return on investment software

Your email settings: Individual Email|Traditional
Change settings via the Web (Yahoo! ID required)
Change settings via email: Switch delivery to Daily Digest | Switch to Fully Featured
Visit Your Group | Yahoo! Groups Terms of Use | Unsubscribe

__,_._,___