Type/to search

Momentum Crossover Strategy with Dynamic Trailing Stop Loss

Common strategy
Created: 2024-02-29 13:55:16
Last modified: 2 years ago
1
Follow
1802
Followers

img

Overview

This strategy combines moving average indicators and directional movement index (DMI) indicators to generate buy and sell signals based on dual-indicator crossovers. It also incorporates a dynamic trailing stop loss to control risks.

Strategy Logic

  1. Construct moving average indicators using a short 9-day EMA and a long 21-day EMA. A buy signal is generated when the short EMA crosses above the long EMA. A sell signal is generated when the short EMA crosses below the long EMA.
  2. Construct DMI indicators using ADX, +DI and -DI. A buy signal is triggered when +DI crosses above -DI. A sell signal is triggered when -DI crosses above +DI.
  3. Combine the signals of EMA and DMI, requiring both indicators to satisfy conditions before issuing actual buy or sell signals.
  4. Use a dynamic trailing stop loss to track the highest price/lowest price for stop loss.

Advantage Analysis

  1. Dual-indicator combos filter fake signals and improve signal accuracy. Short-term indicators capture trend changes while long-term ones determine overall direction.
  2. Momentum indicators can capture trend shifts early with some leading characteristics.
  3. Dynamic trailing stop loss locks in profits as much as possible while controlling risks.

Risk Analysis

  1. With dual-indicator combos, signal frequency is reduced, possibly missing some opportunities.
  2. Poor parameter tuning of indicators may lead to over-trading or low-quality signals.
  3. Stop loss set too wide increases loss risks while set too tight increases trend disconnection risks.

Optimization Directions

  1. Test EMA combos with different short and long term lengths to find optimum.
  2. Optimize ADX parameters to improve DMI signal quality.
  3. Fine tune stop loss parameters to lock profits while managing risks.
  4. Consider adding more filters to further boost signal quality.

Conclusion

This strategy combines the strengths of moving averages and momentum indicators for dual confirmation of signals, complementing each other to enhance profitability. Meanwhile, the dynamic trailing stop loss effectively controls risks. Further parameter optimization and strategy refinement could improve both profitability and stability.

Source
Pine
/*backtest
start: 2023-02-22 00:00:00
end: 2024-02-28 00:00:00
period: 1d
basePeriod: 1h
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/

//@version=5
strategy("Combined EMA and DMI Strategy with Enhanced Table", overlay=true)

// Input parameters for EMA
Strategy parameters
Strategy parameters
Short-Term EMA Period
Long-Term EMA Period
Risk Percentage EMA
ADX Smoothing
DI Length
Comment
All comments (0)
No data
No data
  • 1
Forums
PINE Language
Get the app
iPhone Download
© 2015 - ∞ INVENTOR PTE LTD (SG)