0% found this document useful (0 votes)
423 views2 pages

Wolfe Wave OK

This document contains the code for a trading strategy that uses a smoothed average range calculation to filter price data and identify breakout signals. Key aspects include: - It takes an input source, samples it over a period, and calculates a smoothed multipler range. - This is used to generate upper and lower bands to filter the source and identify breakouts. - It tracks directional movement and signals long or short conditions when the source breaks above or below the bands. - Alerts and plot shapes are triggered on buy and sell signals for the trading strategy.

Uploaded by

Daleep Singhal
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
423 views2 pages

Wolfe Wave OK

This document contains the code for a trading strategy that uses a smoothed average range calculation to filter price data and identify breakout signals. Key aspects include: - It takes an input source, samples it over a period, and calculates a smoothed multipler range. - This is used to generate upper and lower bands to filter the source and identify breakouts. - It tracks directional movement and signals long or short conditions when the source breaks above or below the bands. - Alerts and plot shapes are triggered on buy and sell signals for the trading strategy.

Uploaded by

Daleep Singhal
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 2

//@version=4

// New Version > Xadiamant

// === /SETTINGS FOR CRYPTO ===

study(title="Dark Wolf Bloodline", overlay=true)

// === /Source ===

src = input(defval=close, title="Source")

// === /Sampling Period ===

per = input(defval=69, minval=1, title="Dark Period")

// === /Range Multiplier ===

mult = input(defval=6.9, minval=0.1, title="Dark Range")

// === /Smooth Average Range ===

smoothrng(x, t, m) =>
wper = t * 2 - 1
avrng = ema(abs(x - x[1]), t)
smoothrng = ema(avrng, wper) * m
smoothrng
smrng = smoothrng(src, per, mult)

// === /Range Filter ===

rngfilt(x, r) =>
rngfilt = x
rngfilt := x > nz(rngfilt[1]) ? x - r < nz(rngfilt[1]) ? nz(rngfilt[1]) : x - r
:
x + r > nz(rngfilt[1]) ? nz(rngfilt[1]) : x + r
rngfilt
filt = rngfilt(src, smrng)

// === /Filter Direction ===

upward = 0.0
upward := filt > filt[1] ? nz(upward[1]) + 1 : filt < filt[1] ? 0 : nz(upward[1])
downward = 0.0
downward := filt < filt[1] ? nz(downward[1]) + 1 : filt > filt[1] ? 0 :
nz(downward[1])

// === /Target Bands ===

hband = filt + smrng


lband = filt - smrng

// === /Colors ===

filtcolor = upward > 0 ? color.green : downward > 0 ? color.red : color.red


barcolor = src > filt and src > src[1] and upward > 0 ? color.green :
src > filt and src < src[1] and upward > 0 ? color.green :
src < filt and src < src[1] and downward > 0 ? color.red :
src < filt and src > src[1] and downward > 0 ? color.red : color.red
filtplot = plot(filt, color=filtcolor, linewidth=0, transp=100, title="Dark Range")

// === /Target ===

hbandplot = plot(hband, color=color.green, linewidth=1, transp=0, title="High


Target")
lbandplot = plot(lband, color=color.red, linewidth=1, transp=0, title="Low Target")

// === /Fills ===

fill(hbandplot, filtplot, color=color.green, transp=100, title="High Target Range")


fill(lbandplot, filtplot, color=color.red, transp=100, title="Low Target Range")

// === /Bar Color ===

barcolor(barcolor)

// === /Break Outs ===

longCond = bool(na)
shortCond = bool(na)
longCond := src > filt and src > src[1] and upward > 0 or
src > filt and src < src[1] and upward > 0
shortCond := src < filt and src < src[1] and downward > 0 or
src < filt and src > src[1] and downward > 0

CondIni = 0
CondIni := longCond ? 1 : shortCond ? -1 : CondIni[1]
longCondition = longCond and CondIni[1] == -1
shortCondition = shortCond and CondIni[1] == 1

// === /Alerts ===

plotshape(longCondition, title="Buy Signal", text="BUY", textcolor=color.green,


style=shape.triangleup, size=size.normal, location=location.belowbar,
color=color.green, transp=0)
plotshape(shortCondition, title="Sell Signal", text="SELL", textcolor=color.red,
style=shape.triangledown, size=size.normal, location=location.abovebar,
color=color.purple, transp=0)

alertcondition(longCondition, title="Dark Buy", message="DARK BUY")


alertcondition(shortCondition, title="Dark Sell", message="DARK SELL")

You might also like