Overview
This strategy is a composite trading system that combines the Exponential Moving Average (EMA) crossover and the Ichimoku Cloud. The EMA crossover is mainly used to capture trend start signals and confirm buying opportunities, while the Ichimoku Cloud is used to identify market turns and determine selling opportunities. This strategy can effectively grasp trends and avoid risks in a timely manner through the coordination of multi-dimensional technical indicators.
Strategy Principle
The strategy operation mechanism mainly consists of two core parts:
- EMA Crossover Buy Signal: Use the crossover of the short-term (9-day) and long-term (21-day) exponential moving averages to confirm the trend direction. When the short-term EMA crosses the long-term EMA upward, it indicates that short-term momentum is increasing and generates a buy signal.
- Ichimoku Cloud Chart Sell Signal: The trend reversal is determined by the positional relationship between the price and the cloud chart and the internal structure of the cloud chart. When the price falls below the lower boundary of the cloud chart or the leading band A falls below the leading band B, the sell signal is triggered. The strategy also sets a stop loss and profit taking mechanism, with the stop loss set at 1.5% and the profit target at 3%.
Strategy Advantages
- Multi-dimensional signal confirmation: Through the coordinated use of EMA crossover and Ichimoku Cloud Chart, the reliability of trading signals can be verified from different angles.
- Perfect risk control: Setting fixed percentage stop loss and profit targets can effectively control the risk of each transaction.
- Strong ability to grasp trends: EMA crossover can capture the start of trends in a timely manner, while Ichimoku Cloud chart can better identify the end of trends.
- The signals are clear and objective: trading signals are automatically generated by technical indicators, reducing the interference of subjective judgment.
Strategy Risks
- Risk of volatile market: Frequent false signals may be generated in a sideways and volatile market, resulting in continuous stop losses.
- Lag risk: Both the moving average and the Ichimoku Cloud chart have a certain lag, and you may miss the best entry point in a fast market.
- Parameter sensitivity: The effectiveness of the strategy is sensitive to the parameter settings, and parameters may need to be adjusted in different market environments.
Strategy Optimization Direction
- Add market environment filtering: You can add volatility indicators or trend strength indicators to adjust strategy parameters in different market environments.
- Optimize stop loss mechanism: Consider using dynamic stop loss, such as trailing stop loss or ATR-based stop loss setting.
- Improve the signal confirmation mechanism: Auxiliary indicators such as volume and momentum can be added to improve signal reliability.
- Introducing position management: dynamically adjust position size based on signal strength and market volatility.
Summary
This strategy combines EMA crossover and Ichimoku Cloud Chart to build a trading system with both trend tracking and reversal capture capabilities. The strategy is well designed, risk control is in place, and has good practical application value. Through the recommended optimization direction, the strategy still has room for further improvement. When applying it in real market, it is recommended to first determine the appropriate parameter combination through backtesting, and dynamically adjust it according to the actual market situation.
Strategy source code
/*backtest
start: 2019-12-23 08:00:00
end: 2025-01-04 08:00:00
period: 1d
basePeriod: 1d
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=5
strategy("EMA Crossover Buy + Ichimoku Cloud Sell Strategy", overlay=true)
// Input Parameters for the EMAs
shortEmaPeriod = input.int(9, title="Short EMA Period", minval=1)
longEmaPeriod = input.int(21, title="Long EMA Period", minval=1)
// Input Parameters for the Ichimoku Cloud
tenkanPeriod = input.int(9, title="Tenkan-Sen Period", minval=1)
kijunPeriod = input.int(26, title="Kijun-Sen Period", minval=1)
senkouSpanBPeriod = input.int(52, title="Senkou Span B Period", minval=1)
displacement = input.int(26, title="Displacement", minval=1)
// Calculate the EMAs
shortEma = ta.ema(close, shortEmaPeriod)
longEma = ta.ema(close, longEmaPeriod)
// Ichimoku Cloud Calculations
tenkanSen = ta.sma(close, tenkanPeriod)
kijunSen = ta.sma(close, kijunPeriod)
senkouSpanA = ta.sma(tenkanSen + kijunSen, 2)
senkouSpanB = ta.sma(close, senkouSpanBPeriod)
chikouSpan = close[displacement]
// Plot the EMAs on the chart
plot(shortEma, color=color.green, title="Short EMA")
plot(longEma, color=color.red, title="Long EMA")
// Plot the Ichimoku Cloud
plot(tenkanSen, color=color.blue, title="Tenkan-Sen")
plot(kijunSen, color=color.red, title="Kijun-Sen")
plot(senkouSpanA, color=color.green, title="Senkou Span A", offset=displacement)
plot(senkouSpanB, color=color.purple, title="Senkou Span B", offset=displacement)
plot(chikouSpan, color=color.orange, title="Chikou Span", offset=-displacement)
// Buy Condition: Short EMA crosses above Long EMA
buyCondition = ta.crossover(shortEma, longEma)
// Sell Condition: Tenkan-Sen crosses below Kijun-Sen, and price is below the cloud
sellCondition = ta.crossunder(tenkanSen, kijunSen) and close < senkouSpanA and close < senkouSpanB
// Plot Buy and Sell signals
plotshape(series=buyCondition, title="Buy Signal", location=location.belowbar, color=color.green, style=shape.labelup, text="BUY")
plotshape(series=sellCondition, title="Sell Signal", location=location.abovebar, color=color.red, style=shape.labeldown, text="SELL")
// Execute Buy and Sell Orders
if (buyCondition)
strategy.entry("Buy", strategy.long)
if (sellCondition)
strategy.entry("Sell", strategy.short)
// Optional: Add Stop Loss and Take Profit (risk management)
stopLossPercentage = input.float(1.5, title="Stop Loss Percentage", minval=0.1) / 100
takeProfitPercentage = input.float(3.0, title="Take Profit Percentage", minval=0.1) / 100
longStopLoss = close * (1 - stopLossPercentage)
longTakeProfit = close * (1 + takeProfitPercentage)
shortStopLoss = close * (1 + stopLossPercentage)
shortTakeProfit = close * (1 - takeProfitPercentage)
strategy.exit("Take Profit/Stop Loss", "Buy", stop=longStopLoss, limit=longTakeProfit)
strategy.exit("Take Profit/Stop Loss", "Sell", stop=shortStopLoss, limit=shortTakeProfit)
Strategy Parameters
The original address: Advanced Quantitative Trend Following and Cloud Reversal Composite Trading Strategy