You are on page 1of 1

//@version=3

//

study("ygsscalper2", overlay=true,shorttitle="ygsscalp2")

//

// Reference:

//

// === INPUTS ===

//

ShowPAC = input(true, title="Show wave")

ShowBarColor = input(true, title="Show Coloured GRaB Candles")

ShowTrendIndi = input(false, title="Show Trend Indicator")

PACLen = input(50,minval=2,title="EMA ")

src = input(close,title="Source for Wave centre EMA")

// --- CONSTANTS ---

DodgerBlue = #1E90FF

// === /INPUTS ===

// Constants colours that include fully non-transparent option.

green100 = #008000FF

lime100 = #00FF00FF

red100 = #FF0000FF

blue100 = #0000FFFF

aqua100 = #00FFFFFF

darkred100 = #8B0000FF

// === SERIES SETUP ===

// Price action channel (Wave)

pacLo = ema(low, PACLen)

pacHi = ema(high, PACLen)

// === /SERIES ===

// === PLOTTING ===

//

// If selected, Plot the Wave Channel based on EMA high,low and close

L=plot(ShowPAC ?pacLo:na, color=black, linewidth=1, title="up",transp=20)

H=plot(ShowPAC ?pacHi:na, color=black, linewidth=1, title="down",transp=20)

fill(L,H, color=gray,transp=92,title="Fill Channel")

// Colour bars according to the close position relative to the PAC selected.

bColour = close>=open? close>=pacHi? green : close<=pacLo? darkred100 : yellow :


close>=pacHi? green100 : close<=pacLo? darkred100 : yellow

barcolor(ShowBarColor?bColour:na, title = "Bar Colours")

// Show trend direction indication on the bottom

wcolor = high>pacHi and low>pacHi? lime : low<pacLo and high<pacLo ? red : gray

plotshape(ShowTrendIndi?src:na,
color=wcolor,location=location.bottom,style=shape.square,size=size.small,transp=20,title="Tr
end Direction")

// === /PLOTTING ===

// eof

You might also like