In this article, I will look at a recent article by Kevin Davey. Kevin when back to the first issue of Technical Analysis Of Stocks & Commodities (TASAC) magazine to test a simple momentum-based trading idea. The EasyLanguage code for the strategy is provided. Let's get started.
What Is A Momentum Trading System?
Momentum trading systems are based on the idea that markets tend to continue moving in the same direction for some time. These systems aim to capitalize on this momentum by identifying trends and entering trades in the order of the movement.
One way to do this is using a momentum indicator, such as the Moving Average Convergence Divergence (MACD) or the Relative Strength Index (RSI). These indicators measure the trend's strength by comparing the current price to past prices. When the indicator is above a certain threshold, it may signal that the trend is strong, and the trader should enter a trade in the direction of the movement.
However, it's important to note that momentum can change quickly, and traders must be prepared for a trend reversal. This is where the concept of retracement comes in. By waiting for a retracement, or pullback, against the trend before entering a trade, traders can reduce the risk of being caught in a trend reversal or enter at a better price if the trend continues.
The Momentum Trading System
The TASAC magazine has been around for over 40 years! That's fertile ground for trading ideas. I've subscribed to TASAC for many years, and you can find interesting ideas to test.
Kevin discovered a simple concept in an article titled "Handling Market Reactions" by John Rosenstock. Rosenstock's basic idea is to enter trades after a retracement against the trend. In the article, he writes: "All markets exhibiting prolonged price trends invariably have reactions against the trend."
The article posits that momentum reversal is an excellent way to jump back on the trend after a pullback. Momentum will be defined as today's closing price minus the closing price X days ago.
Kevin's interpretation used two momentum calculations. First, a longer-term momentum (LTM) will determine the market trend.
- LTM > 0 is a bull market (long trades only)
- LTM <= 0 is a bear market (short trades only)
Second, a shorter-term momentum (STM) calculation will determine a pullback in the overall market trend, which will be our entry point.
- STM crosses above zero = buy
- TM crosses below zero = sell short
The code in TradeStation EasyLanguage for the strategy looks like this:
if momentum1 crosses above 0 and close>close[2*mlookback] then buy next bar at market;
if momentum1 crosses below 0 and close<close[2*mlookback] then sellshort next bar at market;
Next, Kevin added exits to the strategy, defined as after a few bars go against the trade. For long trades that means exiting after a recent lowest close is hit, and for short trades, that means exiting after a recent high. Below is the EasyLanguage code.
if marketposition=-1 and close=highest(close,rlookback) then
What we have here is not a trading system. This strategy code is just a simple price pattern-based entry and exit. This is a Key Idea and the start of a potential trading system. We will test this Key Idea on different markets and timeframes to see how it performs. I want to know what market or timeframes this Key idea is viable on. Doing so will give me a starting point for building a final trading system.
Testing Across Different Markets & Timeframes
I will use Tradesq to test this momentum code across all available futures markets and time frames. Tradesq is an online tool that will allow you to test your code and many popular futures markets across eight intraday timeframes. You can read more about Tradesq in the article, "How I Trade Like A Hedge Fund."
Futures markets tested include AD, BD, BO, BP, C, CC, CD, CL, CT, DX, EMD, ES, EU, FV, GC, GF, HE, HG, HO, JPY, KC, KW, LB, LE, MW, NG, NQ, OJ, PA, PL, RB, RR, RTY, S, SB, SF, SI, SM, TY, US, W, XG, YM.
The timeframes tested include the following:
- Daily
- 1,440-minute
- 600-minute
- 360-minute
- 240-minute
- 180-minute
- 120-minute
- 60-minute
I had Tradesq vary the rlookback between 2-20 in steps of one and mlookback between 25-100 in steps of 5.
I performed two tests with Tradesq. The first was to look at the daily results and then look at the intraday results.
Interpreting The Results
When Tradesq has completed all backtests, it generates a results table. This table lists the markets and the number of edges.
What is an "edge?" An edge is a successful run that's passed filter requirements. Remember, we tested different lookback periods.
When a particular run passes the filter, this is called an "edge." The higher edges mean more backtests in that specific category passed the filter. So, many edges show that more backtest produced passing results. For example, the different input values (our lookback period) had a passing performance.
When a particular run passes the filter, this is called an "edge." The higher edges mean more backtests in that specific category passed the filter. So, many edges show that more backtest produced passing results.
The filter applied to the backtest required that a backtest must...
- Minimum number of trades 50
- Minimum PnL: $0
- Minimum R2: .50
- Minimum NP vs. DD: 1.0
Remember, this is a market study, not a complete trading system. It's a market study. We're not looking for great numbers; thus, the filter is not overly restrictive.
Best Performing Markets on Daily Timeframe
I took the results from Tradesq and loaded them into a spreadsheet to find the best-performing markets.
The top-performing markets on the daily timeframe are
- Spring Wheat (MW)
- Hard Red Winter Wheat (KW)
- Lean Hogs (LH)
- E-mini Russel 2000 (RTY)
- VIX (VX)
I'm unfamiliar with the first two markets (MW, KW), but I traded LH, so this may interest me. I don't trade VX either, but RTY I have traded.
Out of the top five, only the RTY version would be available as a micro contract. Thus, building a daily momentum strategy on RTY is an excellent place to start for a lot of traders, and looking into a momentum strategy on LH seems promising if you have a large enough account.
Best Performing Markets On Intraday Timeframes
I took the results from Tradesq and loaded them into a spreadsheet to find the best-performing markets.
The top-performing markets on the daily timeframe are
- Bitcoin (BTC)
- Etherium (ETH)
- Lean Hogs (LH)
- Soybean Oil (BO)
- Soybean Meal (SM)
We see the crypto markets rising to the top. I'm not too keen on trading these on a daily bar as those markets don't have a lot of history thus, they are generating too few trades.
We also have Lean Hogs making an appearance again. Because lean hogs appear on both the intraday and daily results, this may be an excellent market to trade this strategy. I'm not overly familiar with the other markets, BO and SM.
What's Next?
We covered just the first step in creating a trading system. We used tradesq to help us locate potential markets to look into. Next is to test the momentum key idea using my development process. My process is called the Profit Lab Method and consists of 10 steps. I teach this method as part of System Development Master Class.
- Test various filters
- Test exits
- Validate the strategy
- Attempt to incorporate into a portfolio
I would start with Lean Hogs on a daily bar and then explore Lean Hogs on a 240-minute bar.
If you want to work exclusively with micro contracts, look at the RTY & ES markets. Keep in mind just because we don't see other index markets like NQ or YM rising to the top, that we can't make a strategy for those markets. The Tradesq results are just great places to start.
What Else Can You Test?
Remember, we're testing both long and short trades. You could separate these. Build a version of this that only goes long. Then build another version that only goes short. This will allow you to have a unique lookback period for each. You could then use Tradesq to test all markets and time frames while only taking long trades. Then short trades only. Kevin Davey prefers not to do this, but it might be worth looking into.
Conclusion
In conclusion, Kevin Davey tested a momentum-based trading system using John Rosenstock's concept of entering trades after a retracement against the trend. The system used two momentum calculations to determine the overall market trend and identify pullbacks for entry points. The trading idea was tested across various futures markets and time frames using the Tradesq tool, and the results showed several promising markets. The next step would be to test various filters, exits, and stops to create a final trading system.
Hi,
Doesn’t GSB, which you use, provide a perfect and a desirable solution with what Tradesq allows?
GSB is completely different than Tradesq. GSB strategy building tool. Tradesq is a backtesting tool. In short, what I showed in this article can’t be done in GSB.