[R-SIG-Finance] Accounting in blotter query

Brian G. Peterson brian at braverock.com
Fri Oct 5 02:50:45 CEST 2012


On 10/04/2012 07:39 PM, Worik Stanton wrote:
> 2012-10-04 00:00:00       1    210.39                0.00
> 2012-10-04 00:00:00      -3   -631.17              127.26
<...>
> So I would expect the equity in the account to be the initial equity
> plus (127.26 - 9.67) == 1,000,000 + 117.59 == 1,000,117.59
>
> But getEndEq(account, end(IBM)) == 999813.3
>
> what am I missing here?

you have non-unique timestamps.  The xts documentation, and the blotter 
documentation, make it clear that non-unique timestamps will cause 
undefined and incorrect behavior, that's why the make.unique.index 
command exists.

-- 
Brian



More information about the R-SIG-Finance mailing list