Dynamic Moving Average Dual Strategy
Overview
This strategy uses the slope of the Moving Average (MA) and the slope of momentum indicators for trading decisions. It compares the MA slope and momentum slope with set thresholds, and generates trading signals when both slope exceed the thresholds. The strategy also contains a low volatility filter that uses a different MA to generate signals when the market volatility is low.
Strategy Logic
The core of this strategy lies in comparing two slope curves. Firstly, it calculates the slope of the MA and momentum indicator. The slope reflects the rate of change and direction of the curve. Then two thresholds are used, when both the MA slope and the momentum slope exceed the corresponding thresholds, trading signals are generated.
For example, when both the MA slope and momentum slope exceed the upper line, a buy signal is generated; when both curves fall below the lower line, a sell signal is generated. This can filter out some false signals.
The low volatility filter uses a long-term MA to determine market volatility. When volatility is low, a MA with different parameters is used to generate trading signals to adapt to different market states.
Advantage Analysis
This strategy has the following advantages:
-
The dual filter for setting up trading signals can filter out some noise and improve signal quality.
-
The low volatility filter allows the strategy to adapt to different market conditions with elasticity.
-
High customizability for different parameters can be optimized for different products.
-
It contains no repainting function to reduce the impact from curve fitting.
Risk Analysis
This strategy also has some risks:
-
The dual filter may filter out some real signals and miss opportunities. This can be optimized by adjusting parameters.
-
The threshold determination of the low volatility filter needs careful testing. Improper settings may cause signal deviations.
-
Parameter settings for MA and momentum indicators need to be optimized for specific products, and universal parameters are hard to determine.
-
The no repainting function cannot completely avoid the backtest curve fitting problem, and real trading performance still needs verification.
-
High customizability increases the complexity of the parameter space and the difficulty of optimization.
Optimization Directions
The strategy can be optimized in the following directions:
-
Test more combinations of MA and momentum indicators to find the best matching indicators.
-
Optimize the length parameters of MA and momentum indicators to balance lag and noise.
-
Optimize the parameters for calculating slope to find more stable indicator combinations.
-
Test different low volatility indicators and parameters to improve elasticity.
-
Test on different products and timeframes to find the best applicable scope.
-
Build parameter adaptive mechanisms to reduce manual optimization workload.
Conclusion
This is a very flexible and customizable dual MA strategy. It references both price and momentum information for decision making, which can effectively filter out false signals. The low volatility filter also makes the strategy more elastic to adapt to market changes.
With improvements in parameter optimization and indicator selection, this strategy can become a viable choice for real life trading. It provides a reference template for trading decisions using MA and momentum indicators.
/*backtest
start: 2023-11-12 00:00:00
end: 2023-12-12 00:00:00
period: 1h
basePeriod: 15m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © Allenlk
//@version=4
strategy("DRSI DMA Scalping Strategy", shorttitle="DRSIDMA", overlay=false, initial_capital=1000, pyramiding=2, default_qty_type=strategy.percent_of_equity, default_qty_value=100)- 1

