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

Re: [amibroker] Re: Trade Log for Amibroker and IB



PureBytes Links

Trading Reference Links

Ed. You're correct that Vout is used in the function. But what if oprice[i] equals zero the first time you are using this function ? Then you will have an error ... Would be better I think to initialize Vout before the IF ...
 
Regards, Ton.
 
----- Original Message -----
Sent: Friday, June 08, 2007 2:51 PM
Subject: Re: [amibroker] Re: Trade Log for Amibroker and IB

Chris,
 
the hard thing to solve this on my side is that indeed the files ts1.afl and ts_proc.afl you send to me I put in C:\ and it works for me.  If I look at your Word file all looks fine.  The error message has to do with the fact that it can not find the open price for ABX.
 
As you can see vout is used in the function:
 
function getOpenPrice(oprice) {
 
 for (i = 0; i < BarCount; i++) {
 
  if (oprice[ i ] != 0) {
    
   vout = oprice[ i ];
   break;
  
  }
 
 }
 
 return vout;
 
}
 
at some point in ts_proc.afl it tries to find the open price using the following code:
 
   oo = Foreign( symb, "O");
   oprice = IIf(DateTime() == dateNumber,oo,Null);
   oprice = getOpenPrice(oprice);
 
My code extracts "ABX" from the output.txt file and calls it symb.  However if ABX in your database has an additional space then  oo = Foreign( symb, "O");  then it can give this error. I tested for instance the following:
 
   // extract symbol
   sp1 = strpos[ 0 ];
   symb = StrMid(ss,0,sp1);
   symb = symb + " ";
 
adding a space to symb and then I also get the same error.
 
So my code puts into symb  "ABX" for sure.  Then ABX in your databse is not really called "ABX" but maybe "ABX ".  This you need to find out.  What do you see when you add the line:
 
"name: " + Name() + " length: " + StrLen(Name());
inside one of your other chart windows? The show ABX. It show give:  name: ABX length: 3
 
in the interpretation window.
 
rgds,
 
Ed 
 
 
 
----- Original Message -----
Sent: Friday, June 08, 2007 2:10 PM
Subject: Re: [amibroker] Re: Trade Log for Amibroker and IB

hi
so it works at you without problems on c:
I will send you one time the word file ( i have ziped i now ) maybe it works
when you like you can have a look.
if you find something its ok otherwise its also ok .
thanks that you tryed.
regards
chris



Edward Pottasch <empottasch@xxxxxxxbe> schrieb:

hi,
 
I can't read the word file for some reason.
 
I put your files in the c:\   and ran it with the file (attached) containing the data. Works fine on this side. So not sure what the problem is if you say that you have the AFL running inside a database that contains ABX. If it still gives the same error message it can not read the open price of ABX. So it is not able to see ABX for some reason.
 
rgds,
 
Ed
 
 
 
----- Original Message -----
Sent: Friday, June 08, 2007 12:00 PM
Subject: Re: [amibroker] Re: Trade Log for Amibroker and IB

HI Ed

ok this was a mistake ADX .. its ABX (BARRICK GOLD CORP-COM) .
I have pu now the files:
output.txt
ts1.afl
ts_proc.afl

at c:\ drive and change also the paths in the files.
so i have now in the ts1.afl this include file

#include "C:\ts_proc.afl"

and for the output file this

fn = "C:\\output.txt";

i send you also the summery in a wordfile with pictures.


regards
christos






Edward Pottasch <empottasch@xxxxxxxbe> schrieb:
Cgristos,
 
let me check first if you have ABX in your database. It is not ADX but ABX.  I ask this because vout is initialised when it finds the open price of ABX and this is the error you get.
 
So if you have ABX in your database and it has data in it from at least May the 9-th then it will find the open price and it will initialise vout.
 
If you have all this and it still doesn't work then possibly it can not find the file output.txt. So check also if you have the path set right and there is not a mistake made with a typo error. If it still doesn't work let me know,
 
rgds, Ed
 
 
 
----- Original Message -----
Sent: Friday, June 08, 2007 10:40 AM
Subject: Re: [amibroker] Re: Trade Log for Amibroker and IB

Hi Ed

ok this is a good step, ( yes my Data are the same from the Daily statements, and i also tarde in IB.
Yes i have also the symbol ADX in my Database (ADAMS EXPRESS CO-COM)
I take your trades to minimize the failures , but ok i could take also mine becasue they are the same.
so this is not the failure  case.
When i execute ts1 in the chart--> Press Parameters-->  RunStatistics .. it shows me that "vout" is not been initialized.
So this mean something is missing.

regards
Christos





Edward Pottasch <empottasch@xxxxxxxbe> schrieb:
hi Christos,
 
I run this code inside the US database. So it will look for the symbols in this database to get the open price of ABX.  This code I set up specifically to monitor the difference between the open price and my entry (slippage). 
 
So if your database does not have the stock ABX in it it will not be able to finds its openprice.
 
If you trade stocks as well with IB you should be getting the same Daily Account Statements with IB and therefor can make a similar output.txt file like I do. If you trade something else then I do not know how the Daily Statement will look like.
 
So you set it up OK but I think you do not have a database which includes ABX running underneath this code.
 
rgds, Ed
 
 
 
----- Original Message -----
Sent: Friday, June 08, 2007 9:28 AM
Subject: [amibroker] Re: Trade Log for Amibroker and IB

Hi Ed
Thanks very much for sharing your code.
I have try its but i have some problems.
let me tell you:
To dont make mystakes i take your postest trades se below and put them
in a txt file named output.txt. Also i keep your paths.
this mean i copy the output file at C:\IBOutputFiles\output.txt.

ABX 2007-05-09, 11:00:00 ISLAND -56 31.2800 1,751.68 -1.00 0.00 P
ABX 2007-05-09, 11:00:00 NYSE -100 31.2800 3,128.00 -0.28 0.00 P
ABX 2007-05-09, 11:00:00 IDEAL -100 31.2800 3,128.00 0.00 0.00 P
ABX 2007-05-11, 11:01:18 NYSE 156 30.1000 -4,695.60 -1.00 0.00 P
ABX 2007-05-11, 11:01:18 NYSE 100 30.1000 -3,010.00 -0.28 0.00 P

In the file ts1.afl i keep the path of ts_proc.afl.
This means i copy the file ts_proc.afl at the path
C:\Amibroker Programs\myAFL\tradeStatistics\ts_proc.afl.
There i put also ts1.afl.

So we have all the same.
I open the ts1.afl with the AFL Editor and execute this ( apply
indicator).
in the Amibroker chart i see a new window:
Total Rwetun Practice = 0, Total Return Theory=0.
The chart is empty.

In your email you say that i should run this in a chart window.
i tried to do this . I press Run Statistics.
The answer was that the variable vout has not been initializied.
This variable i serch an dfoud it the the ts_proc.afl file.

I try to explane me steps maybe i done a mistake that you see fast.
I dont want to take you more of your time and nerve you.
but it would relay be fine when you help me.

Asi understand your code shows you the total return practice this
means you will get a chart of your profit and losses of your portofoil.
this is excactly what i need.. ( but ok first i must bring it work
with your help).

regards
christos

--- In amibroker@xxxxxxxxxps.com, "Edward Pottasch" <empottasch@...>
wrote:
>
> hi Christos,
>
> I'll attach code that I use. It is designed for my system where I
track the difference between the entryprice and the openprice so is
basicly useless for general use. My system is designed using the
openprice but in the practice you will never get the exact open price
and I monitor the difference.
>
> It contains files:
> ts1.afl this is the main code you run in a chart window
> ts_proc.afl this file is included in ts1.afl. The path you will
have to adjust yourself.
>
> the main file ts1.afl reads the IB output file. This is a file I
call output.txt and your will have to make this yourself like I
explained in my previous Email. The file looks like:
>
> ABX 2007-05-09, 11:00:00 ISLAND -56 31.2800 1,751.68 -1.00 0.00 P
> ABX 2007-05-09, 11:00:00 NYSE -100 31.2800 3,128.00 -0.28 0.00 P
> ABX 2007-05-09, 11:00:00 IDEAL -100 31.2800 3,128.00 0.00 0.00 P
> ABX 2007-05-11, 11:01:18 NYSE 156 30.1000 -4,695.60 -1.00 0.00 P
> ABX 2007-05-11, 11:01:18 NYSE 100 30.1000 -3,010.00 -0.28 0.00 P
>
> just copy and paste all your trades from the daily statement of IB.
>
> If you have al this setup you can run this program and see what it
does. Then maybe yu could adjust it for your needs,
>
> good luck, Ed
>
>
>
>
> ----- Original Message -----
> From: christos_mav
> To: amibroker@xxxxxxxxxps.com
> Sent: Thursday, June 07, 2007 1:24 PM
> Subject: [amibroker] Re: Trade Log for Amibroker and IB
>
>
> Hi Ed
>
> Ok i tried to understand what you wrote me.
> lets assume.
> You donwload your daily statements from IB .
> I done it also . I donwload it in word format. Then i open it and
> copy the data in a textfile.
> This is what i get. (from my papertrading account).
> The data looks like yours only with some Taps.
> I thing until no its ok ...
>
> F 2007-06-06, 13:45:24 NYSE -1,000 8.2500 8,250.00 -5.00 6,108.2175
> -3.70195 0.00
> F 2007-06-06, 09:30:18 NYSE 1,000 8.2700 -8,270.00 -5.00
> -6,123.0253 -3.70195 0.00
>
> Now the proplems start.
> You say then i could read this with amibroker ( ok i need a software
> for this and i hope you will help me ) .
> So when i do all this steps what you telling me i will get something
> like a chart in AB what shows me the performance of my trades ..?
>
> I do not have understand how you read this textfile into Amibroker...
> Do you mean you Import it ...(import wizard import ascii)
> But there you could only import quotes !?
>
> and also this part with the static variables i dont understand.
> maybe it would be more clear when i understand how you read this
in AB.
>
> But ok now im a little bit confused. i hope you or also the others
> cuold help me to solve this.
> regards
> christos
>
> --- In amibroker@xxxxxxxxxps.com, "Edward Pottasch" <empottasch@>
> wrote:
> >
> > hi,
> >
> > I do not have time today and what I have written in AFL is specific
> for my system but I can tell what I do. The trades of the previous
> day I receive in the daily statement of IB. I copy and paste these
> trades into a text file.
> >
> > Then you can read this textfile into Amibroker but you will have to
> do some programming. The "trick" I use is for the software to
> recognize if the line it reads is a long entry or a short exit etc. is
> to save information for each symbol in static variables. For instance
> the IB data may look like:
> >
> > ABX 2007-05-09, 11:00:00 ISLAND -56 31.2800 1,751.68 -1.00 0.00 P
> > ABX 2007-05-09, 11:00:00 NYSE -100 31.2800 3,128.00 -0.28 0.00 P
> > ABX 2007-05-09, 11:00:00 IDEAL -100 31.2800 3,128.00 0.00 0.00 P
> > ABX 2007-05-11, 11:01:18 NYSE 156 30.1000 -4,695.60 -1.00 0.00 P
> > ABX 2007-05-11, 11:01:18 NYSE 100 30.1000 -3,010.00 -0.28 0.00 P
> >
> > save all relevant information in static variables and check for a
> sign() change of the number of shares. If it finds the positions is
> closed then the static variables are removed and the relavant
> information is stored in Composites at the appropriate date.
> >
> > Now it is easy to copy and paste info from IB every day and keep
> trach of your trades and all kind of statistics you lie to examine.
> Maybe tomorrow I can poste some code.
> >
> > rgds, Ed
> >
> >
> >
> >
> > ----- Original Message -----
> > From: christos_mav
> > To: amibroker@xxxxxxxxxps.com
> > Sent: Thursday, June 07, 2007 12:19 AM
> > Subject: [amibroker] Trade Log for Amibroker and IB
> >
> >
> > Hi.
> > I want to ask if somebody has a trade log for his account on IB.
> > I want only to see my real trades that i have done at my IB
acount in
> > a n Excel-File.
> > When i buy , how much , Price comissions ( all this in one line).
> > The problem is that the Statement of IB is realy bad.
> > You couls export for example your dayly statement but they give
you so
> > much infos that you realy dont need.
> > For me its only important to see very fast ma mistake.
> >
> > There are some softeware what you could buy ( see IB homepage ) .
> > But ok .. only for a trade log --they are to expensive.
> > Therefore i ask if somebody know something else.
> >
> > This would be also a good thing to implement in AB.
> > To press only one button in AB and import for example your dayly
> > trades from IB to AB .
> >
> > regards
> > Chris
> >
>



Telefonieren Sie ohne weitere Kosten mit Ihren Freunden von PC zu PC!
Jetzt Yahoo! Messenger installieren!


Yahoo! Clever - Der einfachste Weg, Fragen zu stellen und Wissenswertes mit Anderen zu teilen.

ÐÏࡱá
ABX 2007-05-09, 11:00:00 ISLAND -56 31.2800 1,751.68 -1.00 0.00 P
ABX 2007-05-09, 11:00:00 NYSE -100 31.2800 3,128.00 -0.28 0.00 P
ABX 2007-05-09, 11:00:00 IDEAL -100 31.2800 3,128.00 0.00 0.00 P
ABX 2007-05-11, 11:01:18 NYSE 156 30.1000 -4,695.60 -1.00 0.00 P
ABX 2007-05-11, 11:01:18 NYSE 100 30.1000 -3,010.00 -0.28 0.00 P


Telefonieren Sie ohne weitere Kosten mit Ihren Freunden von PC zu PC!
Jetzt Yahoo! Messenger installieren!

__._,_.___

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

__,_._,___