[R-SIG-Finance] Importing and exporting portfolio with blotter

Brian G. Peterson brian at braverock.com
Wed Oct 16 14:30:51 CEST 2013


On 10/16/2013 04:05 AM, Alan Pardew wrote:
> I can't find a satisfactory answer to this so decide to post here. We wish
> to possibly start using R to manage some portfolios with fairly low
> frequency transactions (say a few a week in each portfolio). Currently we
> have some custom stuff written in Python but I am starting an investigation
> into R as it has some nice features we want to take advantage of without
> reinventing the wheel.
>
> Clearly Blotter and PerformanceAnalytics seem highly relevant. My question
> is, how can I interface all my existing and new transactions into Blotter
> on a daily basis so that I can rerun various measures that I need? A CSV
> file would seem to do the trick but seems nasty.
>
> Are there any real world examples (not just backtesting) that people can
> point me to as to how these tools are used in practice?

PerformanceAnalytics is widely used for production portfolios in 
returns-space, by banks and asset managers of every stripe.  I would 
venture from the emails on this list and the ones sent to me privately 
that 'production' use is by far the prevalent use for PerformanceAnalytics.

blotter is, as the name says, a 'trade blotter'.  It is also still under 
development and not on CRAN. blotter was initially designed to support 
backtesting, and this is by far its predominant use.

blotter is also used for 'production' post-trade analysis.  We use it to 
reconcile our production P&L, and are able to match our daily custody 
statements. Importing from csv should be pretty easy.  You would load 
your trades into an xts object, and then call addTxns, which Josh Ulrich 
recently rewrote in C to support processing several hundred thousand 
transactions.  You could then use any of blotter's functions, or 
generate returns and send them over to PerformanceAnalytics.

I'll close with a comment that all this code is open source.  We're 
always looking for contributions from users who find our code useful, 
and are open to any 'generally useful' additions to the packages.  This 
code grows because people use it, and gets better because people work 
with us to resolve problems.  We appreciate that, and that's one of the 
large reasons we release code to the community, for the virtuous cycle 
that ensues.

Regards,

Brian


P.S.:
The largest 'known issue' with blotter relates to trying to mark a 
cash-FX book in one of the counter-currencies.  This may work fine, 
depending on the setup, or may cause circular references as the 
portfolio tries to mark itself against an exchange rate that you are 
trading.  If this described your portfolio, contact me off-list and we 
can discuss either fixing it or a simple workaround.


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



More information about the R-SIG-Finance mailing list