← К каталогу
Исходный код · ID 3980

indicator_gk_trend_ribbon_swing_+_prepare_hud_for_tradingview.txt

Вы автор или правообладатель?

Сообщите нам, если считаете, что материал размещён без разрешения.

Получить полный код

Поиск по коду файла

indicator("GK Trend Ribbon SWING + PREPARE HUD", overlay=true)

len=input.int(200,"Swing Ribbon Length")
mult=input.float(2.0,"Swing Band Mult")
atrLen=input.int(21,"ATR Length")
conf=input.int(2,"Confirm Bars", minval=1, maxval=3)

lag=math.max(int(math.floor((len-1)/2)),0)
zl=ta.ema(lag>0?close+(close-close[lag]):close,len)
atr=ta.atr(atrLen)
up=zl+atr*mult
dn=zl-atr*mult

bull = close>up and close[1]>up[1] and close[conf-1]>up[conf-1] and zl>zl[1]
bear = close<dn and close[1]<dn[1] and close[conf-1]<dn[conf-1] and zl<zl[1]

var int tr=0
tr := bull?1: bear?-1: nz(tr[1],0)
flip = barstate.isconfirmed and tr!=tr[1] and tr!=0

pU=plot(up,color=color.blue,linewidth=2)
pD=plot(dn,color=color.blue,linewidth=2)
plot(zl,linewidth=4,color=tr==1?color.lime:tr==-1?color.red:color.gray)
fill(pU,pD,color=tr==1?color.new(color.lime,55):tr==-1?color.new(color.red,55):na)

pBuy  = not barstate.isconfirmed and bull and tr[1]!=1
pSell = not barstate.isconfirmed and bear and tr[1]!=-1
warnBuy  = pBuy  and not pBuy[1]
warnSell = pSell and not pSell[1]

plotshape(warnBuy,  text="PREPARE GK BUY",  style=shape.labelup,   location=location.top, size=size.tiny, color=color.l

Показано первые 50% кода (символов: 2122)

Что вы получите после оплаты

На этой странице откроется полный исходный код файла вместо ознакомительного фрагмента.

Чтобы оформить заказ, введите email и перейдите к оплате.

Стоимость полного кода: 212 ₽