[R-SIG-Finance] Portfolio management in R for private use
Brian G. Peterson
brian at braverock.com
Thu Jan 12 11:32:06 CET 2017
On 01/12/2017 02:16 AM, Johannes Lips wrote:
> Hi all,
>
> I've just wanted to share some code I've written to keep track of my
> small portfolio in R, since I couldn't find anything suitable on the
> internet.
> https://github.com/hannes101/myRportfolio/
> I would be glad if someone could offer me some nice documents on good
> ways to keep track on the performance of the whole portfolio and
> possible summaries one could easily obtain. I couldn't really find a lot
> of documentation on all these packages and most of it was rather
> academic and not really suited for a portfolio, mainly following a
> Buy&Hold strategy.
> If you have any suggestions or additional comments, please let me know.
Johannes,
Thanks for sharing your code. It is always useful to see how other
people are using the packages.
I'm a little unclear on what your question is.
I'm also not clear what you are referring to when you discuss 'not
really suited for a portfolio', since among other things we use blotter
for reconciliation of accounts doing many thousands of trades per day,
which is not quite 'buy and hold' nor 'academic'. Perhaps you could
provide links to what you've referenced so far?
Anyway, I'll guess at what you might be asking, and see if that
clarifies things.
You're using addTxns() to load your trades into blotter, which is as
expected for trade accounting on actual trades.
After you've called updatePortf() and updateAcct(), you have all the
'tracking' and 'performance' data for your portfolio.
I don't see calls to tradeStats(), perTradeStats(), dailyStats(), or
dailyEqPL(), which might give you more of the 'tracking' information
you're looking for.
I also don't see a call to PortfReturns(), which would extract %-returns
from your blotter portfolio, and make all the standard portfolio
analysis of packages such as PerformanceAnalytics or PortfolioAnalytics,
which generally expect %-returns, available.
So, maybe this answers your question, and maybe it doesn't. If I
haven't answered your question, could you please be more specific about
what you want to do?
Regards,
Brian
--
Brian G. Peterson
http://braverock.com/brian/
Ph: 773-459-4973
IM: bgpbraverock
More information about the R-SIG-Finance
mailing list