[R-SIG-Finance] Backing out a portfolio snapshot?

Brian G. Peterson brian at braverock.com
Fri Feb 6 21:14:15 CET 2015


Matt,

If you have all the trades, or at least the starting position and cost 
basis, and all the trades after that point, then blotter can do what you 
want.

see

?addTxns #loading everything in in one go

and

?getPos # for looking up positions as of a certain time

If you don't have the starting position and average cost, you can back 
into the starting position (but not average cost) by entering all the 
trades as though you started flat, and taking the difference to your 
ending position.

As to whether you could back out average cost, you'd have to tell us 
more about your inputs.

Regards,

Brian

On 02/06/2015 09:33 AM, matt at considine.net wrote:
> Hi,
> Let's say I have a snapshot of a portfolio's holdings on a given day, as
> well as the trades covering the two years up to that date.  Does anyone
> know of an already-made module or toolchain that would allow me to back
> out the portfolio's holdings on any given day up to that point (but that
> is obviously covered by the trading data)?  While it is a pretty
> straightforward - and tedious - mechanical exercise, I can see that
> there might be a twist in that one needs to create the implied cash
> balance, as all the cash positions are not included (just the ending
> balance).
>
> So I recognize that the result might only be a close approximation.  But
> under the assumption that the portfolio was always effectively fully
> invested I think the results would be robust.
>
> If anyone is aware of a solution out there that is based in R, I'd be
> appreciative.
>
> Regards,
> Matt Considine
>
> _______________________________________________
> R-SIG-Finance at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-sig-finance
> -- Subscriber-posting only. If you want to post, subscribe first.
> -- Also note that this is not the r-help list where general R questions
> should go.

-- 
Brian G. Peterson
http://braverock.com/brian/
Ph: 773-459-4973
IM: bgpbraverock



More information about the R-SIG-Finance mailing list