
Chiến lược này là một hệ thống theo dõi xu hướng khu vực động dựa trên hai đường trung bình (EMA nhanh và EMA chậm). Nó phân chia các khu vực giao dịch khác nhau bằng cách xác định mối quan hệ vị trí giữa giá và đường trung bình.
Trọng tâm của chiến lược là phân chia tình trạng thị trường thành sáu khu vực khác nhau thông qua mối quan hệ chéo giữa EMA nhanh (thường là 12 chu kỳ) và EMA chậm (thường là 26 chu kỳ), kết hợp với vị trí giá. Khi đường nhanh nằm trên đường chậm, thị trường được coi là đang trong xu hướng đa đầu; ngược lại, nó được coi là xu hướng không đầu.
Đây là một chiến lược theo dõi xu hướng kết hợp giữa hệ thống hai đường cong truyền thống và khái niệm phân vùng hiện đại. Nó cung cấp cho các nhà giao dịch một khuôn khổ giao dịch đáng tin cậy thông qua phản hồi trực quan trực quan và các quy tắc giao dịch rõ ràng. Mặc dù có các vấn đề về sự chậm trễ vốn có của hệ thống đường cong, chiến lược này có thể đạt được hiệu suất ổn định trong thị trường xu hướng thông qua tối ưu hóa tham số và quản lý rủi ro hợp lý.
/*backtest
start: 2019-12-23 08:00:00
end: 2024-11-27 08:00:00
period: 1d
basePeriod: 1d
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=5
strategy("NUTJP CDC ActionZone 2024", overlay=true, precision=6, commission_value=0.1, slippage=3)
//****************************************************************************//
// CDC Action Zone is based on a simple EMA crossover
// between [default] EMA12 and EMA26
//****************************************************************************//
// Define User Input Variables
xsrc = input.source(title='Source Data', defval=close)
xprd1 = input.int(title='Fast EMA period', defval=12)
xprd2 = input.int(title='Slow EMA period', defval=26)
xsmooth = input.int(title='Smoothing period (1 = no smoothing)', defval=1)
fillSW = input.bool(title='Paint Bar Colors', defval=true)
fastSW = input.bool(title='Show fast moving average line', defval=true)
slowSW = input.bool(title='Show slow moving average line', defval=true)
xfixtf = input.bool(title='** Use Fixed time frame Mode (advanced) **', defval=false)
xtf = input.timeframe(title='** Fix chart to which time frame? **', defval='D')
startDate = input(timestamp("2018-01-01 00:00"), title="Start Date")
endDate = input(timestamp("2069-12-31 23:59"), title="End Date")
//****************************************************************************//
// Calculate Indicators
f_secureSecurity(_symbol, _res, _src) => request.security(_symbol, _res, _src[1], lookahead=barmerge.lookahead_on)
xPrice = ta.ema(xsrc, xsmooth)
FastMA = xfixtf ? ta.ema(f_secureSecurity(syminfo.tickerid, xtf, ta.ema(xsrc, xprd1)), xsmooth) : ta.ema(xPrice, xprd1)
SlowMA = xfixtf ? ta.ema(f_secureSecurity(syminfo.tickerid, xtf, ta.ema(xsrc, xprd2)), xsmooth) : ta.ema(xPrice, xprd2)
Bull = FastMA > SlowMA
Bear = FastMA < SlowMA
// Define Color Zones
Green = Bull and xPrice > FastMA
Red = Bear and xPrice < FastMA
// Buy and Sell Conditions
buycond = Green and not Green[1]
sellcond = Red and not Red[1]
inDateRange = true
if inDateRange
if buycond
strategy.entry("Long", strategy.long, qty=1)
if sellcond
strategy.close("Long")
//****************************************************************************//
// Display color on chart
bColor = Green ? color.green :
Red ? color.red :
color.black
barcolor(color=fillSW ? bColor : na)
// Display MA lines
FastL = plot(fastSW ? FastMA : na, "Fast EMA", color=color.new(color.red, 0), style=xfixtf ? plot.style_stepline : plot.style_line)
SlowL = plot(slowSW ? SlowMA : na, "Slow EMA", color=color.new(color.blue, 0), style=xfixtf ? plot.style_stepline : plot.style_line)
fill(FastL, SlowL, Bull ? color.new(color.green, 90) : (Bear ? color.new(color.red, 90) : na))