updated 28 May 2018

Agenda

  • Performance Simulations
  • Round Turn Trade Simulations
  • Stylized facts & Round Turn tradeDef
  • Empirical examples
  • Future Work
  • Conclusion

Pat Burns - "If we generate a random subset of the paths, then we can make statistical statements about the quality of the strategy."

Jaekle & Tomasini - "Changing the order of the performed trades gives you valuable estimations about expected maximum drawdowns."

Lopez de Prado et al - "…because the signal-to-noise ratio is so weak, often the result of such calibration is that parameters are chosen to profit from past noise rather than future signal."

Harvey et al - "We argue that most claimed research findings in financial economics are likely false."

What all these methods have in common, is an element of random sampling based on some constraint. What we propose in blotter:::txnsim() is the random sampling of round turn trades bound by the constraint of the stylized facts of the observed strategy.

Why Round Turn Trade Simulation?

  • Increased transparency

  • More realistic

  • Effectively creating simulated traders with the same style but zero skill

Stylized Facts

  • Round turn trade durations

  • Ratio of long:short durations

  • Quantity of each round turn trade

  • Direction of round turns

  • Number of layers entered, limited by maximum position

Round Turn Trades

  • tradeDef = ?

  • flat.to.flat

  • flat.to.reduced || increased.to.reduced

Longtrend

chart.Posn("longtrend", Symbol="GSPC")

set.seed(333)
lt.wr <- ex.txnsim('longtrend',n=1000,replacement=TRUE,chart=FALSE,tradeDef="flat.to.flat")
plot(lt.wr)

Position Fill

  • Original strategy vs winning replicate

Long Period Distribution

Flat Period Distribution

Ranks and p-values

##                         mean median stddev maxDD sharpe totalPL
## txnsim.wr.longtrend.664    1   96.0    681  28.0      4       1
## txnsim.wr.longtrend.640    2  554.5    744  28.0      9       2
## txnsim.wr.longtrend.955    3   23.0    120 198.0     44       3
## txnsim.wr.longtrend.951    4   51.0     62 711.0     55       4
## txnsim.wr.longtrend.870    5  554.5    770  10.5     10       5
## txnsim.wr.longtrend.945    7  554.5    431  70.0     25       6
## txnsim.wr.longtrend.503    8  554.5    886  38.0      5       7
## txnsim.wr.longtrend.660    9  554.5    459 154.5     28       8
## txnsim.wr.longtrend.935   10  554.5    559  66.0     21       9
## longtrend                  6  554.5    846   7.0      6      10


##    mean  median  stddev   maxDD  sharpe totalPL 
##  0.0060  0.5539  0.8452  0.0070  0.0060  0.0100

hist(lt.wr, methods="sharpe")

hist(lt.wr, methods="maxDD")

Layers and Long/Short strategies with 'bbands'

chart.Posn(Portfolio='bbands',Symbol="AAPL",TA="add_BBands(on=1,sd=SD,n=N)")

bbands txnsim plot

bbands winner

win_rep <- names(bb.wr$ranks[,6][which(bb.wr$ranks[,6]==1)])
chart.Posn(Portfolio=win_rep,Symbol="AAPL",TA="add_BBands(on=1,sd=SD,n=N)")

bbands positionFill

bbands Long Period distributions

bbands Short Period distributions

Future work

  • Refining the layering process
  • Pat Burns’ 10-day non-overlapping pvalues
  • Additional simulation methodologies
  • Additional stylized facts
  • Simulation studies of ETF portfolios
  • Simulations with simulated or resampled market data
  • Applying txnsim stylized facts to "OOS" market data
  • A vignette, and hopefully a paper

Round turn trade Monte Carlo simulates random traders who behave in a similar manner to an observed series of real or backtest transactions. We feel that round turn trade simulation offers insights significantly beyond what is currently available as open source and txnsim() in particular is well suited to evaluating the question of "skill versus luck or overfitting".

References

Burns, Patrick. 2006. "Random Portfolios for Evaluating Trading Strategies." http://www.burns-stat.com/pages/Working/evalstrat.pdf

Tomasini, Emilio & Jaekle, Urban. 2009. "Trading Systems: A New Approach to System Development and Portfolio Optimization"

Bailey, David H, Jonathan M Borwein, Marcos López de Prado, and Qiji Jim Zhu. 2014. “The Probability of Backtest Overfitting.” http://papers.ssrn.com/sol3/papers.cfm?abstract_id=2326253.

Harvey, Campbell R., and Yan Liu. 2015. “Backtesting.” SSRN. http://ssrn.com/abstract=2345489.

Peterson, Brian G. 2017. "Developing & Backtesting Systematic Trading Strategies." http://goo.gl/na4u5d

Thank you

Thank You for Your Attention

Thanks to Brian Peterson, Joshua Ulrich, all the contributors to quantstrat and blotter, to the R/Finance committee and sponsors, R community and last but certainly not least, UIC and Mary Deering.