April 9, 2020

I thought it might be an appropriate time to make a walk-forward test on the strategy presented in my January 8th article: Financing Your Stock Trading Strategy which showed a 16.9-year simulation with an ending date of 1919-11-29. It would make this new simulation a walk-forward, out-of-sample, test where the strategy would not have seen the last 3-month of market data.

As in every test of this kind, it is usually expected that the trading strategy will break down going forward. At least, that is what you read in academic papers. But, this was not the case. The strategy was designed to adapt, ready to go short at times and uses modulated leverage while planning for the long term. It is based on the payoff matrix equations presented in the above-cited article.

Therefore, it was expected that the strategy not only survived the walk-forward but also continue to thrive over the added months of data. The original simulation, as said, was for 16.9 years while this new one is for 17.19 years, adding 3.25 months. I know it is not that much time, but it should nonetheless make its point. Did it survive this coronavirus crisis and highly volatile market?

Walk-Forward Simulation

A walk-forward simulation is relatively easy to do. It requires changing the end date for the simulation and rerun it. Not having touched that strategy over the last few months, I do not recall all the intricacies the methodology used. I find that secondary since it is a program and if I have done my job properly, it should do what it was programmed to do.

It should be noted that the added months do include the current coronavirus pandemic with its market swings.

It was expected by adding those 3.25 months that the number of executed trades in this 400 stock portfolio increase due to the weekly rebalancing. And due to the increased volatility over the period, we should also see an increase in the average net profit per trade.

As a walk-forward simulation, everything should be the same up to the new market data. It is the last 3 months that would make a difference and show its impact on the final results.

The program did do its job.

You could not forecast how much profit the program would make, but you did know how the trading procedures would react to any price change. The program seeks volatility and in such a period of market turmoil, it switched short at the first signs of market weakness just as it did in prior periods, to then switch back to long at the first signs of strength. The program was not right all the time, at times being too early or too late, but the main objective was to protect the portfolio from major drawdowns and it did do that job.

I would have liked the procedures to be smoother, but at the development stage, you just want answers. During the last 3 months, the strategy was in unknown territories, and the main question was: will it do what it was programmed to do?

I think that the most impressive thing in that program was the continued increase in the number of trades while it was increasing its bet size at an exponential rate and thereby increasing the overall profits. It was like making the bigger bets in the most volatile market of recent years. The strategy was making those big bets simply because that is where it was at after 16.9 years of progress.

One chart I like is the log-scaled cumulative returns where we can see the SPY return compared to the trading strategy. Both lines are relatively straight and what I usually want to see is that the spread between those two lines in continuously increasing thereby showing the stability of its CAGR. And also, that the strategy's CAGR exceeds the SPY CAGR, otherwise the strategy would be underperforming its proxy for the market average return.

April 6, 2020 Cumulative Returns Log Scale
April Returns Log Scale

(click to enlarge) 

Summary stats report for the November 29, 2019 simulation compared to the current April 6 simulation gave:

November 29, 2019 Simulation
November Stats

(click to enlarge)

April 6, 2020 Simulation
April Stats

(click to enlarge)

We can observe the increase in the number of trades as well as the increase in the average net profit per trade as was expected. The strategy kept about the same win rate due to its rebalancing trading structure and almost doubled its profits due to the big bets over the last 2 months or so.

The new equity curve:

April 6, 2020 Equity Curve
April Equity Curve

(click to enlarge)

The program took advantage of the wild price swings as they developed and doubled the portfolio value in a relatively short period of time. The program also made an estimate of the leveraging costs and provided the portfolio's net liquidation value. The bet size has grown considerably. This was expected since it was on a fix-fraction of ongoing equity, thereby making bigger and bigger bets on this 400-stock portfolio.

Most of the portfolio metrics were about the same for the two simulations.

November 29, 2019 Portfolio Metrics
November Metrics

(click to enlarge)

April 6, 2020 Portfolio Metrics
April Metrics

(click to enlarge)

The April 6 simulation increased the overall CAGR to 49.57% compared to the November 29 test with its 45.30%, an overall 4.27% CAGR increase and it almost doubled the outcome. This was entirely due to the surge in the last few months. Comparing the metrics, the Sharpe ratio stayed about the same, just as the maximum drawdown, the average volatility, and the average leverage used. The turnover also stayed the same as expected due to the periodic rebalancing. The strategy's retained its high measure of stability (0.98).

The return distribution is the same except for the added months.

November 29, 2019 Return Distribution
November Return Distribution

(click to enlarge)

April 6, 2020 Return Distribution
April Return Distribution

(click to enlarge)

The cumulative return chart with the added months just went ballistic as illustrated below:

April 6, 2020 Cumulative Returns
April Cumulative Returns

(click to enlarge)

This should not be a surprise since the strategy followed its design. Its payoff matrix did as expected. F(t) = F_0 + Σ (H ∙ ΔP) = F_0 + n ∙ x_(avg) where n is the number of trades and x_(avg) the average net profit per trade. By increasing both those numbers over the trading interval, it resulted in higher profits.

There is more to be said about these two simulations. Especially about the methodology used. I do expect that from this presentation some will be able to duplicate or reverse engineer the strategy and do even better.

See Related Files:

The Making Of A Stock Trading Strategy

Dealing With Stock Portfolio Equations

Durability And Scalability

Financing Your Stock Trading Strategy


 April 9, 2020, © Guy R. Fleury. All rights reserved.