Are there any books/papers/articles to describe how to develop a backtesting software? Something like backtest in quantopian website. How do they calculate the Cumulative performance?
-
$\begingroup$ There are several off-the-shelf backtesting packages. You might want to look at those before rolling your own. Depends in part what it is you want to backtest (e.g. options or stocks? Low-frequency or high-frequency?). $\endgroup$– user42108Commented Nov 3, 2020 at 15:53
2 Answers
There are many resources on the web but you need to think why you would want to do this in the first place. Are there not packages or frameworks out there already that will do what you need?
Also backtesting or any financial trading platform will be suited to a specific style or method of backtesting. Some are vectorised iterative processes (e.g. just a big for loop with some whistles added on) and others are reactive CEP based solutions (they rely on events coming in from a data feed then reacting to these in some ways) so unless you have a specific style of trading the former will work for most people.
http://www.quantstart.com has interesting articles on back testing and there are plenty others. Rob Carvers site is quite informative also: http://qoppac.blogspot.com/
In this blog post I describe how to backtest trading strategies with R:
Backtest Trading Strategies Like a Real Quant
It gives a step-by-step template which consists of the following steps:
- Load libraries and data
- Create your indicator
- Use indicator to create equity curve
- Evaluate strategy performance
Details and the fully documented code can be found in the post.