Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1of 1

//Created new version by Xadiamant

//Original Creator is Jake Bernstein

study(title="Dark Wolf Electri", shorttitle="Dark Wolf Electri")

length = input(14, minval=1, title="Stochastic Length - Default 14")


smoothK = input(5, minval=1, title="Smooth K - Default 5")
ul = input(55, minval=50, title="Buy Entry/Exit Line")
ll = input(45, maxval=50, title="Sell Entry/Exit Line")
st = input(false, title="Change Barcolor To Show Long, Short, or No Trades")

//Stochastic Calculation
k = ema(stoch(close, high, low, length), smoothK)

//Upper and Lower Entry Lines


uline = ul
lline = ll

//Bar Color Definitions


Long() => st and k >= uline ? 1 : 0
Short() => st and k <= lline ? 1 : 0
NoTrade() => st and (k > lline and k < uline) ? 1 : 0

//Color Definition for Stochastic Line


col = k >= uline ? green : k <= lline ? red : blue

//Stochastic Plots
plot(k, title="Stochastic", style=line, linewidth=4, color=col)
p1 = plot(uline, title="Upper Line", style=line, linewidth=4, color=green)
p2 = plot(100, title="100 Line", color=white)
fill(p1, p2, title="Long Trade Fill Color", color=green, transp=90)
p3 = plot(lline, title="Lower Line", style=line, linewidth=4, color=red)
p4 = plot(0, title="0 Line", color=white)
fill(p1, p3, title="No Trade Fill Color", color=blue, transp=90)
fill(p3, p4, title="Short Trade Fill Color", color=red, transp=90)

//Bar Color Plots


barcolor(Long() ? lime : na)
barcolor(NoTrade() ? blue : na)
barcolor(Short() ? red : na)

You might also like