"How Should I Backtest This Volume Spike Strategy?"
By Dave Mabe
Here's a reader question from Wesley (name used with permission, lightly edited for clarity).
Wesley:
I've made a pine script in TradingView that gives me alerts if certain stocks produce a volume spike of 2x average volume (based on the volume MA 20 and on the 2m chart). That is so often "ending" volume or a breakout candle. Now I'm testing how often it really leads to a reversal or breakout if it happens around yesterday's high or low. Do you have any tips on how to approach this to get the best results from the backtest? This is the first time I'm doing this.
Also, how do you automate this with Excel? I'm doing everything manually.
Dave:
First of all, you'll tie yourself in knots trying to do this in TradingView.
The big problem with TradingView is that you can only backtest one symbol at a time, but even more importantly, you can't add custom columns to a backtest.
Because of that, you'll be stuck in backtest world with TradingView, never really making much progress.
Applying an idea like this to the entire US equities market will allow you to come up with a strong signal, since there are so many tradeable equities where this event occurs every day.
When you try to apply this to a signal instrument like a futures contract, you necessarily have to weaken the signal significantly to generate enough trades for the strategy to even make sense.
Here's how I would approach this in Amibroker.
I'd create a backtest that goes long on every volume spike. (Your definition of volume spike will likely need to be a lot tighter, i.e. stronger, otherwise you'll get too much noise in your backtest.)
Apply the MabeKit column library and run the backtest.
Run this through the Cruncher and it will tell you how to improve the strategy on the long side.
However, and this is key, as you iterate and apply rules from the Cruncher to your strategy on the long side, take note of the sets of trades you're removing.
They'll be strongly negative on the long side, which you'd naturally be removing from your long strategy.
But particularly poor long trades are a great source for creating an opposite strategy on the short side.
So not only will the Cruncher show you the way for a long strategy here, but it will tell you how to generate a short strategy at the same time.
I'd look for a natural way to split these trades into long and short strategies based on the rules suggested by the Cruncher.
So you start with one basic concept, but you end up with two distinct strategies from it.
Great question, Wesley, and thanks for sharing with the list.
-Dave
P.S. Do you wish you had a column library that would tell YOU how to make your strategy profitable? My column library is now included with MabeKit. Get Instant Access ยป