OpenSourceQuant


 

Monte Carlo Simulation for your Portfolio PL [0.07]

Posted on Aug. 9, 2017, 11:07 p.m. by OpenSourceQuant @ [source]

You shake it.

In my early days of looking at trading strategies, getting to the equity curve felt like the final piece of the puzzle.

backtest maxdd mcsim parameter PL replacement sampling simulation strategy values

 

R-view: Backtesting – Harvey & Liu (2015) [0.04]

Posted on Nov. 17, 2016, 8:14 p.m. by OpenSourceQuant @ [source]

In this post i take an R-view of “Backtesting – Harvey & Liu (2015).” The authors propose an alternative to the commonly practiced 50% discount that is applied to reported Sharpe ratios when evaluating backtests of trading strategies. HL argue that the appropriate “haircut Sharpe ratio” is non-linear, in that the highest Sharpe ratios (SR’s) are only moderately penalized whilst marginal SR’s more so.

HL hypothesis manager returns sharpe ratio significance single SR strategy test

 

I have had the pleasure of getting to know and work with Brian Peterson of late building out the blotter::mcsim function in the blotter package. I will be writing about this function soon and where it is headed, but in this post i wanted to share a presentation Brian gave the CapeR User Group last week on Developing and Backtesting Systematic Trading Strategies with an application in R, and in particular using the quantstrat and blotter packages.

Brian CapeR developing gave headed post presentation user wanted writing

 

Block Bootstrapped Monte Carlo – in R [0.10]

Posted on April 26, 2016, 10:06 p.m. by OpenSourceQuant @ [source]

A few weeks back i wrote a post including the source code for a Monte Carlo simulation function in R. The idea was to randomly sample daily returns produced by a backtest and build a confidence interval distribution of the middle 50% and 90% of returns. Since then Brian Peterson got in touch with me asking if i would work with him in getting some form of Monte Carlo simulation functionality standardized within the R blotter package.

backtest blotter blotter package carlo functionality include meboot monte package replicates simulation standardized

 

Create an R Package in Rstudio [0.00]

Posted on April 3, 2016, 5:31 p.m. by OpenSourceQuant @ [source]

 

In this post on bettersystemtrader.com, Andrew Swanscott interviews Kevin Davey from KJ Trading Systems who discusses why looking at your back-test historical equity curve alone might not give you a true sense of a strategy’s risk profile. So i wrote a Monte Carlo-type simulation function (in R) to see graphically how my back-test results would have looked had the order of returns been randomized.

analysis csv data drawdown middle replacement returns ribbon simulation stream true type

 

I recently came across a question that required logic and coding skills to solve.

Let there be a stick of length 1.

break Enjoy longest pick pieces random resulting side smaller uniformly