This strategy is based on momentum indicators combined with moving averages to track market trends. It goes long when there is strong upside momentum and goes short when there is strong downside momentum. It belongs to the category of trend following strategies.
Calculate the momentum of price as: (Current Price - Price N periods ago) / Price N periods ago
Calculate the moving average mid of price over N periods
Normalize the momentum value to the range of 0-1
When the normalized momentum is greater than 0.5 and price is above moving average, go long
When the normalized momentum is less than 0.5 and price is below moving average, go short
Use a moving stop loss mechanism with proper stop loss levels
The above covers the basic trading logic. When the market is trending, price will move persistently in one direction, generating large momentum values. The strategy judges the strength of the trend using the momentum and the direction using the moving average to decide on entry. Also, the stop loss is critical for controlling risks.
This strategy has the following advantages:
Tracks market trends, with potentially large gains
Momentum is sensitive to price changes and responds quickly to trends
Moving averages filter out random noise and combine well with momentum
Stop loss mechanism limits loss on individual trades
Simple and clear logic, easy to implement and backtest
Flexible parameters can adapt to different periods and market regimes
Overall, this is a great strategy for trending markets. It can profit significantly from directional trends.
Despite the advantages, some risks need to be noted:
Breakout risk in uptrends when price reverses after breaking out
Reversal risk in downtrends when price bounces after breaking down
Whipsaw signals when price oscillates around moving average
Wrong signals if parameters are not properly set
Underperforms in rangebound choppy markets
Strict stop loss and movement required to prevent premature exit
To address these risks, stop loss strategy needs optimization, filter unnecessary signals with loose parameters, adjust parameters for different periods, and control position sizing.
Here are some ways the strategy can be further optimized:
Test different parameter combinations for best backtest results
Incorporate the Turtle Trading rules of exiting at 2N loss and 1N profit
Optimize stop loss with volatility indicators for adaptive stop loss
Add position sizing rules based on drawdown, time, etc
Test different momentum calculation methods like exponential moving average momentum
Add candlestick pattern filters for more robust signals
Utilize machine learning for parameter optimization, feature selection, etc
Incorporate some discretionary human input at key points
With these enhancements, the strategy may achieve better stability, adaptability, and profitability. But any optimization needs strict statistical validation to avoid overfitting.
The momentum tracking strategy is a simple and practical trend following approach. It can nimbly capture market trends and profit from riding bubbles and crashes. But curve fitting risks need to be managed with disciplined risk controls to maintain robustness. With parameter tuning and functionality extensions, the strategy can yield steady profits in more market regimes.
/*backtest start: 2023-11-02 00:00:00 end: 2023-11-09 00:00:00 period: 15m basePeriod: 5m exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}] */ //@version=3 strategy("Momentum Strategy, rev.2", overlay=true) // // Data // src = input(close) lookback = input(20) cscheme=input(1, title="Bar color scheme", options=[1,2]) // // Functions // momentum(ts, p) => (ts - ts[p]) / ts[p] normalize(src, len) => hi = highest(src, len) lo = lowest(src, len) res = (src - lo)/(hi - lo) // // Main // price = close mid = sma(src, lookback) mom = normalize(momentum(price, lookback),100) // // Bar Colors // clr1 = cscheme==1?black: red clr2 = cscheme==1?white: green barcolor(close < open ? clr1 : clr2) // // Strategy // if (mom > .5 and price > mid ) strategy.entry("MomLE", strategy.long, stop=high+syminfo.mintick, comment="MomLE") else strategy.cancel("MomLE") if (mom < .5 and price < mid ) strategy.entry("MomSE", strategy.short, stop=low-syminfo.mintick, comment="MomSE") else strategy.cancel("MomSE") //plot(strategy.equity, title="equity", color=red, linewidth=2, style=areabr)