EMA Cross Trend Following Strategy with SMA Stop-Loss and Re-Entry Mechanism
Overview
This strategy is a trend-following trading system that combines Exponential Moving Averages (EMA) and Simple Moving Averages (SMA). It generates trading signals based on the crossover of EMA50 and EMA150, uses SMA150 as a stop-loss line, and includes a re-entry mechanism after stop-loss. This design enables both medium to long-term trend capture and effective risk control.
Strategy Principles
The core logic includes several key elements:
- Entry signals: Long positions are triggered when EMA50 crosses above EMA150; short positions when EMA50 crosses below EMA150.
- Stop-loss mechanism: Positions are closed when price falls below SMA150.
- Re-entry mechanism: After a stop-loss, re-entry long positions are triggered when price breaks above EMA150; short positions when EMA50 crosses below EMA150 again.
- Trade execution: The strategy executes trades within a specified time range, considering 0.1% commission and 3 pips slippage.
Strategy Advantages
- Strong trend-following capability: Effectively captures market trends using different period moving average combinations.
- Comprehensive risk control: Clear stop-loss conditions prevent excessive losses.
- Flexible re-entry mechanism: Allows re-entry when market conditions improve, increasing profit opportunities.
- Reasonable parameter settings: EMA50 and EMA150 periods balance sensitivity and stability.
- Considers actual trading costs: Includes commission and slippage factors, closer to real trading environment.
Strategy Risks
- Choppy market risk: May generate frequent false breakout signals in sideways markets.
- Lag risk: Moving averages have inherent lag, potentially missing optimal entry points.
- Re-entry risk: Consecutive stop-losses may occur in highly volatile markets.
- Money management risk: Strategy lacks specific position sizing rules.
- Market environment dependence: Strategy performance may vary significantly across different market cycles.
Optimization Directions
- Incorporate volatility indicators: Add ATR or Bollinger Bands to adjust stop-loss positions adaptively.
- Improve position management: Implement volatility-based dynamic position sizing system.
- Optimize re-entry conditions: Combine with oscillators like RSI to improve re-entry signal accuracy.
- Add market environment filters: Include trend strength indicators to reduce trading frequency in low-trend markets.
- Develop adaptive parameters: Dynamically adjust moving average periods based on market volatility.
Summary
This is a well-designed trend-following strategy that captures trends through moving average crossovers and includes comprehensive risk control mechanisms. Its main strengths lie in systematic trend-following capability and risk management design, but market environment impact needs consideration in practical application. The strategy has potential for further improvement through the suggested optimization directions.
/*backtest
start: 2024-02-22 00:00:00
end: 2025-02-19 08:00:00
period: 1h
basePeriod: 1h
exchanges: [{"eid":"Binance","currency":"SOL_USDT"}]
*/
//@version=6
strategy("EMA 50 and EMA 150 with SMA150 Stop-loss and Re-Entry #ganges", overlay=true, commission_type=strategy.commission.percent, commission_value=0.1, slippage=3)
- 1

