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" <raymondpconno...@...> 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 >
