
This strategy is a trend-following trading system based on multiple Exponential Moving Averages (EMAs) and cloud visualization. It utilizes 9-period, 21-period, and 200-period EMAs to determine market trends through price-EMA relationships and crossovers, generating trading signals upon trend confirmation. The system visually represents market trends through cloud color changes.
The core logic is based on the following key elements: 1. Uses triple EMAs (9/21/200) to build a trend framework 2. Determines short-term trends through price relation to 9 EMA and 9 EMA relation to 21 EMA 3. Uses 200 EMA as a long-term trend reference 4. Forms green cloud when price crosses above 9 EMA and 9 EMA crosses above 21 EMA, indicating bullish signal 5. Forms red cloud when price crosses below 9 EMA and 9 EMA crosses below 21 EMA, indicating bearish signal 6. Generates trading signals based on cloud color changes, entering long positions with green cloud and exiting with red cloud
The Multi-EMA Cloud Trend Trading Strategy is a comprehensive trading system combining technical analysis and visual feedback. Through the coordinated use of multiple EMAs, it effectively captures market trends while visually displaying market conditions through cloud formation. While it has inherent lag and false signal risks, appropriate optimization and risk control measures can help achieve stable returns in trending markets. Traders are advised to thoroughly test parameter combinations and optimize according to specific market characteristics before live implementation.
/*backtest
start: 2024-02-21 00:00:00
end: 2025-02-18 08:00:00
period: 1d
basePeriod: 1d
exchanges: [{"eid":"Binance","currency":"DOGE_USDT"}]
*/
//@version=5
strategy("EMA Cloud Strategy", overlay=true, default_qty_type=strategy.percent_of_equity, default_qty_value=10)
// Inputs for EMA periods
ema9_length = input.int(9, title="9 EMA Length", minval=1)
ema21_length = input.int(21, title="21 EMA Length", minval=1)
ema200_length = input.int(200, title="200 EMA Length", minval=1)
// Inputs for EMA colors
ema9_color = input.color(color.new(color.blue, 0), title="9 EMA Color")
ema21_color = input.color(color.new(color.orange, 0), title="21 EMA Color")
ema200_color = input.color(color.new(color.red, 0), title="200 EMA Color")
// Calculate EMAs
ema9 = ta.ema(close, ema9_length)
ema21 = ta.ema(close, ema21_length)
ema200 = ta.ema(close, ema200_length)
// Plot EMAs
plot(ema9, color=ema9_color, title="9 EMA", linewidth=2)
plot(ema21, color=ema21_color, title="21 EMA", linewidth=2)
plot(ema200, color=ema200_color, title="200 EMA", linewidth=2)
// Conditions for clouds
is_bullish = close > ema9 and ema9 > ema21
is_bearish = close < ema9 and ema9 < ema21
// Plot clouds
fill_color = is_bullish ? color.new(color.green, 90) : is_bearish ? color.new(color.red, 90) : na
fill(plot(close, title="Price", display=display.none), plot(ema200, title="200 EMA", display=display.none), color=fill_color, title="Cloud")
// Strategy logic
if (is_bullish)
strategy.entry("Buy", strategy.long) // Enter long position when green cloud starts
if (is_bearish)
strategy.close("Buy") // Close long position when red cloud starts
// Optional: Add alerts for strategy conditions
alertcondition(is_bullish, title="Bullish Condition", message="Price is above 9 EMA and 9 EMA is above 21 EMA")
alertcondition(is_bearish, title="Bearish Condition", message="Price is below 9 EMA and 9 EMA is below 21 EMA")