Awesome...thx so much Mike. Ray
--- In [email protected], "Mike" <sfclimb...@...> wrote: > > Ray, > > A while ago I had reason to write low level custom backtester code in place > of the default backtester. I instrumented my code at every step with many > _TRACE statements, thereby giving me a peak as to what was really going on in > the backtester. > > http://www.amibroker.com/guide/afl/afl_view.php?id=222 > > I have not yet made an attempt to address the open gains issue. However, I do > know how I would initially try to solve it. Tomasz once demonstrated that you > can manually alter the cash property to affect the taking of trades. That > might be the way to go. > > http://finance.groups.yahoo.com/group/amibroker/message/114784 > > Mike > > --- In [email protected], "raymondpconnolly" <raymondpconnolly@> > wrote: > > > > > > > > Mike, > > > > thanks for the info I've spent a week trying to get to the bottom of these > > property relationships and unless I missed something I didn't see any of > > this in the documentation nor did I get any response from support on the > > issue. > > > > So reading between the lines from your posts did you use the detail log of > > the AA to figure this out? As useful as the information you've provided > > is, perhaps more useful to someone like myself who is trying to gain > > proficiency in programming this software are any general diagnostic > > techniques you might be willing to share. > > > > Back to the .cash issue, have you modeled taking additional positions with > > open position gain with low level CBT code? At the moment the basic > > behaviour will suffice for my systems but I would be interested to know if > > you've delt with the issue and if so how in general for future reference. > > > > Ray > > > > > > > > --- In [email protected], "Mike" <sfclimbers@> wrote: > > > > > > One thing to keep in mind is that open position gains are not added to > > > the Cash property and are thus not available for taking additional > > > positions (i.e. the taking of positions is dependent upon the > > > availability of Cash). > > > > > > http://finance.groups.yahoo.com/group/amibroker/message/148014 > > > > > > Mike > > > > > > --- In [email protected], "raymondpconnolly" <raymondpconnolly@> > > > wrote: > > > > > > > > Thanks Mike...I will go through it...I greatly appreciate your response. > > > > > > > > Ray > > > > > > > > --- In [email protected], "Mike" <sfclimbers@> wrote: > > > > > > > > > > A reply that I made to an earlier thread might be helpful. Note that > > > > > despite the verbal description in the link below, I seem to recall > > > > > that AmiBroker stores bo.MarginLoan as a negative number that gets > > > > > added to equity. > > > > > > > > > > http://finance.groups.yahoo.com/group/amibroker/message/127764 > > > > > > > > > > Mike > > > > > > > > > > --- In [email protected], "raymondpconnolly" > > > > > <raymondpconnolly@> wrote: > > > > > > > > > > > > Hi All, > > > > > > > > > > > > I've written some CBT code to calculate custom metrics > > > > > > Max_Equity, Min_Cash, Max_Margin_loan. The problem I am having Is > > > > > > that I'm not sure how to interpret the output because I'm uncertain > > > > > > about the definition of backtester object properties bo.Equity, > > > > > > bo.Cash, bo.MarginLoan where bo is the bactester object. > > > > > > > > > > > > From the User Guide topic "Portfolio-level back testing" : "New > > > > > > backtester works on PORTFOLIO LEVEL, it means that there is single > > > > > > portfolio equity and positionsizing refers to portfolio equity. > > > > > > Portfolio equity is equal toavailable cash plus sum of all > > > > > > simultaneously open positions at given time." > > > > > > > > > > > > Is it correct to conclude from the above that for a margin > > > > > > account Portfolio equity includes Marginloan? Therefore if I > > > > > > defined the equity that I provide as "Owners Equity" vs. the > > > > > > broker provided "Maginloan" the following would be true: > > > > > > > > > > > > (1) bo.Equity = Owners Equity + bo.MarginLoan = bo.Cash + sum of > > > > > > all > > > > > > simultaneously open positions at given time? > > > > > > > > > > > > (2) bo.Equity = Owners Equity/MarginRate = bo.Cash + sum of all > > > > > > simultaneously open positions at given time? > > > > > > > > > > > > or is it the case that: > > > > > > > > > > > > (3) bo.Equity = Owners Equity = bo.Cash + sum of all > > > > > > simultaneously open positions at given time. (and bo.MarginLoan is > > > > > > simply a separate number)? > > > > > > > > > > > > or are there other components in Portfolio equity that I've missed > > > > > > completely? > > > > > > > > > > > > If anyone can help with this I would really appreciate it. > > > > > > > > > > > > Regards, > > > > > > Ray > > > > > > > > > > > > > > > > > > > > >
