Skip to content
All library documents

Choosing a Backtesting Framework for Monte Carlo Strategy Research

Article Quant Q&A · Author: Ernie

Summary

The document asks whether an R programmer with several years of experience and existing Monte Carlo backtesting scripts should learn quantstrat or keep improving custom code. The response does not give a categorical recommendation beyond suggesting that learning an additional tool can be useful. Instead, it frames the decision around the intended improvement: mitigating overfitting, making a strategy more complex by combining signals, or producing extreme time series to examine behavior during an economic collapse.

These examples distinguish research aims that may require different approaches, but the exchange supplies no comparison of package features, implementation effort, or empirical outcomes. It also does not specify how to generate stress scenarios or assess overfitting. The guidance is therefore an initial decision framework, not a complete method for selecting a backtesting system; the researcher would need to define the problem and compare tools against it.

Key ideas

  • The decision to learn quantstrat depends on what the researcher wants backtesting to improve.
  • Overfitting mitigation is one possible objective to consider.
  • Adding layered signals may require more strategy complexity.
  • Extreme simulated time series can be used to explore strategy behavior under severe conditions.
  • The exchange leaves the tool comparison unresolved and provides no performance evidence.

Tags

Full text
# quantstrat for backtesting vs. writing one's own code in R


# quantstrat for backtesting vs. writing one's own code in R












I have invested a few years in learning R and have developed a number of Monte Carlo backtesting scripts. My question is this: In general, for a person with some experience writing R code who is interested in Monte Carlo backtesting of various strategies, is it worth the time to go through quantstrat's steep learning curve, or would one be better off putting that time into continuing to develop and modify one's own backtesting scripts?

If this question is off topic, I apologize. I can't seem to find another place to ask it.

## Answer by Joel Alcedo (score 1)

https://quant.stackexchange.com/a/35473

It never hurts to have additional tools at your disposal and I would therefore suggest learning quantstrat. Before you start hitting the books ask yourself:

- Are you trying to enhance back testing by mitigating overfitting risk?

- Are you trying to build more complexity into the strategy itself by layering more signals?

- Do you want to generate extreme time series data replicating economic collapse and how your strategy would behave under those circumstances?

The question you're asking is ambiguous in that regard. Depending on what you are trying to do, your approach would vary (i.e. to use quantstrat or not).

What aspect of your backtests are your trying to improve?

Shown in full with attribution under the source's licence. Licence: CC BY-SA 4.0 (Stack Exchange)

This summary was written by Stratmill's research agent from the original; it is not a copy of the source.