Back to Community
Market Panics: To Sell or Not to Sell?

The market has taken a nosedive recently, which prompted an interesting analysis by 538 on whether to sell or to hold during a market panic, i.e. when the S&P suffers a big decline. The folks at 538 propose that holding your assets is better than selling during the panic and buying back later.

To drive the point home, 538 included a simulation of a trader who sold upon downturns of 5% and bought back upon 3% rebounds. I wrote an algorithm to let you run similar simulations: you can clone the algo and tweak the parameters to try variations on this strategy. Perhaps you will find something useful. To get started:

  1. Press "Clone Algorithm." You'll be redirected to a window where you can edit your copy of the algorithm.
  2. Hit "Build." This runs a quick backtest on the algo.
  3. Change the n and m parameters!
  4. Hit "Build."

My experience was that it's difficult to meaningfully outperform SPY with such a simple strategy (and in the case of outperformance, to ensure that the result was not due to overfitting). The problem is basically twofold:
1. Movements in price are not very indicative of future movement.
2. Detecting a loss requires taking a loss to begin with. Detecting a gain requires letting the equity appreciate before purchasing.
For many simple, risk-averse strategies that trade SPY, the second point implies that the strategy will underperform SPY. It is possible to improve results by shorting and optimizing n/m pairs (both of which I will do in future notebooks), but at that level of effort, it is probably better to develop a reasonably market-neutral trading strategy to manage the portfolio.

Clone Algorithm
Backtest from to with initial capital
Total Returns
Max Drawdown
Benchmark Returns
Returns 1 Month 3 Month 6 Month 12 Month
Alpha 1 Month 3 Month 6 Month 12 Month
Beta 1 Month 3 Month 6 Month 12 Month
Sharpe 1 Month 3 Month 6 Month 12 Month
Sortino 1 Month 3 Month 6 Month 12 Month
Volatility 1 Month 3 Month 6 Month 12 Month
Max Drawdown 1 Month 3 Month 6 Month 12 Month
# Backtest ID: 55e5f9077ca31c0dfa85e3df
There was a runtime error.
3 responses

Addendum: you can see that in the backtest above, the strategy slightly outperforms SPY. This might be surprising. The reason for this result is that the strategy heavily outperforms SPY between 2002 and 2004. Between 2005 and 2015, it underperforms SPY slightly, as you might expect. Thus, I think of this result as the consequence of (unintended) 2002-specific overfitting.

Plotting linear-scaled cumulative equity is actually pretty deceptive like that.

Agreed. Maybe it'd be helpful to plot the difference between the returns of the two over time? A gradually diminishing difference would show that your strategy's earlier outperformance might have been a fluke.