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

RE: [amibroker] Substuting ";" with "," in a TWS trade file



PureBytes Links

Trading Reference Links

Thanks everyone for the replies!
 
My mind wasn't to clear last night and I was looking for a quick and easy solution; yes I'll use the afl str functions. I'll also email to AB-sugggest that the delimiter be made optional in the StrExtract(), like StrExtract( list, item, Delimiter="," )
 
I have been using StaticVariables to plot real trades on my charts but I think reading the actual TWS tradelist and plotting those values will be better and easier.
 
best regards,
herman
-----Original Message-----
From: Michael.S.G. [mailto:OzFalconAB@xxxxxxxx]
Sent: Friday, April 08, 2005 1:56 AM
To: amibroker@xxxxxxxxxxxxxxx
Subject: Re: [amibroker] Substuting ";" with "," in a TWS trade file

Herman,
    How do you want to do it?

I have a JScript file that does just what you are after.

Or (Prefered method) do as Ara said. Use StrFind etc
to locate each sub section.

eg (not real code)
Line = Readline from file....
for I = 1 to StrLen(Line)
Loc = StrFind(Line); //Find 1st occurance left to right
Part(I) = StrLeft(Line,Loc); //Allocate x part.
RightNum = StrLen(Line) - Loc; //Calc remaining  str len.
Line = StrRight(RightNum);
Next I;

Or something like that  (Have to check the RightNum assignment - I think
it's not quite right*)
Anyway gota go - Just popped home for 5min and out again. ;-)

*Umm yeah - The for loop will continue after the string has been
dismembered. You'd have to fix that.

Atb
    Michael.

Herman van den Bergen wrote:

> would anyone have code or know how to substitute semi-colons in a file
> with commas?

> The TWS outputs trade records in semi-colon separated text file, like so:

> RIMM;SLD;50;72.56;13:32:59;20050407;ISLAND;U84507;;;534;
> RIMM;BOT;100;73.04;13:37:49;20050407;ISLAND;U84507;;;534;
> RIMM;SLD;50;73.44;13:41:56;20050407;ISLAND;U84507;;;534;
> RIMM;SLD;50;73.44;13:41:56;20050407;ISLAND;U84507;;;534;

> I want to read the files with afl which would be so much easier if the
> semi-colons were commas.

> many thanks for any help you can give!

> herman
>
>
> 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*
>
>     * To visit your group on the web, go to:
>       http://groups.yahoo.com/group/amibroker/
>       
>     * To unsubscribe from this group, send an email to:
>       amibroker-unsubscribe@xxxxxxxxxxxxxxx
>       <mailto:amibroker-unsubscribe@xxxxxxxxxxxxxxx?subject=Unsubscribe>
>       
>     * Your use of Yahoo! Groups is subject to the Yahoo! Terms of
>       Service <http://docs.yahoo.com/info/terms/>.
>
>



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





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