Tags:

This strategy is a simple trend following strategy based on EMA crossover. It uses two EMA lines with different parameters, a short-term EMA line and a long-term EMA line. When the short-term EMA line crosses above the long-term EMA line, go long. When the short-term EMA line crosses below the long-term EMA line, close position. With stop loss and take profit to manage risk.

EMA indicator is a trend following indicator which exponentially smoothes price. The short-term EMA line responds faster to price changes, reflecting recent trend. The long-term EMA line responds slower, reflecting long term trend. When short EMA crosses above long EMA, it indicates the recent upward momentum is stronger than the long term trend, can go long. Vice versa, when short EMA crosses below long EMA, it indicates the recent downward momentum is stronger, should close long position.

This strategy sets 9 period and 21 period EMA lines. Use the crossover of 9 period short EMA and 21 period long EMA as trading signals:

- When 9 EMA crosses above 21 EMA, go long
- When 9 EMA crosses below 21 EMA, close position

- Use EMA crossover to form trading signals, avoid over-trading
- EMA smoothes price, helps identify trend direction
- Simple and easy-to-understand logic

- EMA has lagging effect during volatile markets, may cause losses
- Rely solely on single indicator, prone to false signals

Risk Solutions:

- Optimize EMA parameters for faster response
- Add other indicators for signal filtration

- Optimize EMA periods, find best combination
- Add volume or other indicators for filtration, avoid false signals
- Add dynamic stop loss and take profit

The strategy capitalizes on EMA crossover of two EMAs to follow trends. Its advantage is simple logic, medium trading frequency, catching mid-to-long term trends. However EMA has lagging effect. Adding more indicators for filtration and optimising dynamic stop loss can reduce risk further. Overall, EMA Crossover is effective from seizing mid-to-long term trends.

/*backtest start: 2023-01-25 00:00:00 end: 2024-01-31 00:00:00 period: 1d basePeriod: 1h exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}] */ //@version=4 strategy("EMA Crossover Strategy", overlay=true) // Input parameters shortPeriod = input(9, title="Short EMA Period") longPeriod = input(21, title="Long EMA Period") stopLossPercent = input(1, title="Stop Loss (%)") / 100 takeProfitMultiplier = input(2, title="Take Profit Multiplier") // Calculate EMAs emaShort = ema(close, shortPeriod) emaLong = ema(close, longPeriod) // Plot EMAs plot(emaShort, color=color.blue, title="Short EMA") plot(emaLong, color=color.red, title="Long EMA") // Strategy logic strategy.entry("Buy", strategy.long, when=crossover(emaShort, emaLong)) strategy.close("Buy", when=crossunder(emaShort, emaLong)) // Risk management atrValue = atr(14) stopLossLevel = close * (1 - stopLossPercent) takeProfitLevel = close * takeProfitMultiplier strategy.exit("Take Profit/Stop Loss", from_entry="Buy", loss=stopLossLevel, profit=takeProfitLevel)

- The Triple Moving Average Channel Strategy for Patiently Mining Valuable Information from Candlestick Lines
- Yin Yang Hanging Man Strategy
- Trailing Stop Loss Percent Strategy
- Triple Moving Average Trend Following Strategy
- Tracking Stop Loss Moving Average Trading Strategy
- Dual Indicator Mean Reversion Trend Following Strategy
- Dynamic Price Channel with Stop Loss Tracking Strategy
- Dynamic Stop Loss Bollinger Bands Strategy
- Reversal Breakout Bandpass Combo Strategy
- Dynamic Moving Average Crossover Strategy
- Short-Term Trading Strategy Based on RSI and SMA
- Momentum Breakout Intraday Trading Strategy
- KDJ Golden Cross Long Entry Strategy
- Breakback Storm Strategy in Hidden Opportunities
- Cross-Timeframe Momentum Tracking Strategy
- Moving Average Trend Following Strategy
- Pivot SuperTrend Strategy Across Multiple Timeframes
- Quantitative Candlestick Pattern and Trend Following Strategy
- Supertrend Combined with RSI Quantitative Trading Strategy
- Cape Town 15-min Candle Breakout Strategy