Skip to content
All library documents

Testing Whether Entry Volatility Explains Trade Outcomes

Article Robot Wealth

Summary

This tutorial shows how to export a factor measured at trade entry from a Zorro simulation and compare it with subsequent trade returns in R. The example records rolling volatility before entry, attaches it to closed trades, and writes asset, entry date, return, and volatility to a file. It then creates plots of volatility against absolute and signed trade returns, separates observations by asset, and compares entry-volatility distributions for winning and losing trades.

The article also groups trades into volatility quantiles and plots mean return by bucket, offering a basic way to inspect whether a candidate factor is associated with performance. The included sample contains only a few dozen trades per asset, which the article explicitly identifies as a limitation. The graphs and quantile averages are exploratory: they do not establish causality, statistical significance, or out-of-sample predictive value. Costs are set to zero in the simulation, so the example also omits an important source of real-world performance drag.

Key ideas

  • A trade-level factor can be recorded at entry and linked to closed-trade outcomes for later analysis.
  • Scatterplots can explore relationships between entry volatility and both signed and absolute trade returns.
  • Comparing factor quantiles provides a simple view of how average trade returns vary across factor levels.
  • The example has small per-asset samples, so apparent relationships may be unreliable.
  • Zero spread, commission, and slippage make the simulation results less representative of live trading.

Tags

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