This strategy integrates multiple indicators for trend identification, and generates trading signals based on aligned directional changes. It combines moving average speed, STOCH and MACD to form a comprehensive and robust trend following system.
The core indicators are:
Moving average speed: Reflects price momentum.
STOCH: Oversold/overbought for trend changes.
MACD: Trend changes from dual moving averages.
The trading rules are:
Rising moving average speed gives bullish signal.
STOCH in overbought zone gives bearish signal.
MACD positive crossover gives bullish signal.
Enter when any 2 indicators align signals.
Exit when indicator signals change.
The combination evaluates trend from multiple dimensions, filtering noise for high-conviction signals.
Compared to single indicators, the combo strategy has the following pros:
Combined view improves accuracy.
Ensemble filtering reduces false signals.
Incorporates trend and mean-reversion indicators.
Aligned signals have high conviction, avoiding false breakouts.
Simple and clear rules, easy to implement.
Flexible parameter tuning, robustness.
Applicable to different timeframes.
Can train indicator weights with machine learning.
Overall better stability and profitability than single indicators.
Despite the merits, risks to consider include:
Increased complexity with multiple indicators.
Challenging parameter optimization and weighting.
Conflicting indicator signals may occur.
Some lag always exists, cannot avoid all losses.
Uncertain unidirectional holding period with luck factor.
Ensemble signals cannot eliminate inherent trend trading risks.
High trade frequency increases transaction costs.
Need to monitor reward/risk ratios.
Based on the analysis, enhancements may involve:
Evaluate indicator efficacy across different markets.
Add parameter robustness checks to prevent overfitting.
Optimize indicator weighting to reduce conflicts.
Implement stops to limit severe losses.
Use time exits to control unlimited holding periods.
Assess trading frequency impact on transaction costs.
Incorporate risk metrics constraints.
Test robustness across multiple markets.
Continually validate strategy efficacy.
This strategy forms stable ensemble signals by integrating multiple indicators for trend assessment. But continual optimization is key for any strategy, monitoring risks and preventing overfitting. Quant trading is a continuous learning process.
/*backtest start: 2022-09-16 00:00:00 end: 2023-09-22 00:00:00 period: 1d basePeriod: 1h exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}] */ // By TradeStation //@version=5 strategy("Mov Avg Speed Strategy", overlay=true) src = input(close, title="Source") // MA Speed avg_len = input.int(50, minval=1, title="Avg Length", group="MA Speed") roc_len = input.int(1, minval=1, title="Rate of Change Length", group="MA Speed") avg_roc_len = input.int(10, minval=1, title="Avg Rate of Change Length", group="MA Speed") // Stochastic stoch_len = input.int(14, minval=1, title="Stochastic Length", group="Stochastic") smooth_k = input.int(3, minval=1, title="Stochastic Smooth K", group="Stochastic") overbought = input.float(80, title="Stochastic Overbought", group="Stochastic") oversold = input.float(20, title="Stochastic Oversold", group="Stochastic") // MACD fast_length = input(12, title="Fast Length", group="MACD") slow_length = input(26, title="Slow Length", group="MACD") macd_avg_length = input.int(9, title="MACD Avg Length", minval=1, group="MACD") // MA Speed avg = ta.sma(src, avg_len) roc = ta.roc(avg, roc_len) avg_roc = ta.sma(roc, avg_roc_len) avg_roc_signal = avg_roc > 0 ? 1 : avg_roc < 0 ? -1 : 0 // Stochastic k k = ta.sma(ta.stoch(close, high, low, stoch_len), smooth_k) stochastic_signal = k <= oversold ? 1 : k >= overbought ? -1 : 0 // MACD fast_ma = ta.ema(src, fast_length) slow_ma = ta.ema(src, slow_length) macd = fast_ma - slow_ma macd_avg = ta.ema(macd, macd_avg_length) macd_signal = macd_avg > macd_avg[1] ? 1 : macd_avg < macd_avg[1] ? -1 : 0 // set the signal couint long_count = 0 short_count = 0 if macd_signal == 1 long_count += 1 else if macd_signal == -1 short_count += 1 if stochastic_signal == 1 long_count += 1 else if stochastic_signal == -1 short_count += 1 if avg_roc_signal == 1 long_count += 1 else if avg_roc_signal == -1 short_count += 1 if (long_count >= 2) strategy.entry("Long", strategy.long) if (short_count >= 2) strategy.entry("Short", strategy.short)