
Стратегия представляет собой динамическую региональную систему отслеживания трендов, основанную на двухместных линиях (быстрой EMA и медленной EMA). Различные торговые зоны делятся на зависимость от местоположения цены от двухместных линий, в сочетании с динамической цветовой индикационной системой, которая дает трейдерам четкие сигналы о покупке и продаже. Стратегия использует классическую теорию пересечения равномерных линий и улучшает работоспособность традиционной двухместной системы с помощью инновационных методов регионального деления.
В основе стратегии лежит разделение состояния рынка на шесть различных зон через перекрестную связь между быстрой EMA (задачной 12-й цикл) и медленной EMA (задачной 26-й цикл), в сочетании с положением цены. Когда быстрая линия находится над медленной линией, рынок считается находящимся в многополосной тенденции; наоборот, она рассматривается как пустая.
Это стратегия отслеживания тенденций, которая сочетает в себе традиционную двухлинейную систему и современную идею регионализации. Она обеспечивает трейдерам надежную торговую базу с помощью интуитивной визуальной обратной связи и четких торговых правил. Несмотря на проблемы, связанные с отсталостью, присущие однолинейной системе, эта стратегия позволяет добиться стабильной производительности на трендовых рынках с помощью разумной оптимизации параметров и управления рисками.
/*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))