Trading Strategies Performance Report with R and Knitr

本文介绍了一种使用RandKnitr创建合成报告的方法,用于展示基本交易策略性能图表、统计数据和最新性能指标,以跟踪策略衰减。通过一个简单的CSV文件输入,生成美观的PDF报告。

I’ve been looking for template reports using R and Knitr for a while but I didn’t find anything that suits my needs so far. I therefore decided to create them myself.

What I like to see about trading strategies are basic performance charts (daily, monthly and yearly), some basic trading statistics and above all most recent performance figures to track potential strategy decay. I also want all of the information to be displayed on a single page. All this already exists obviously but not within a synthetic report like the one I present here. Therefore some custom formatting was required.

The input necessary to create this report is a simple 2 columns csv file with daily date and return. The output is a good looking pdf file (see image below).

I created a GistGitHub repository with 3 files:

  • performanceReportREADME.txt: it contains the usual disclaimer
  • performanceReportWithKnitr.R: This is the main R function that creates the charts and the input for LaTeX tables
  • performanceReport_AssetAllocation.Rnw: This file calls the R function above and generates the pdf report.

Any comments welcome

performanceReport

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值