67% found this document useful (3 votes)
727 views2 pages

Jaguar

The document describes a trading strategy that uses a smoothed range to generate buy and sell signals on a financial time series. It smooths the source data using an exponential moving average, then filters the data using upper and lower bands based on the smoothed range. It tracks upward and downward movements to determine long and short signal conditions, and plots buy/sell signals and alerts when the conditions are met.

Uploaded by

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

Jaguar

The document describes a trading strategy that uses a smoothed range to generate buy and sell signals on a financial time series. It smooths the source data using an exponential moving average, then filters the data using upper and lower bands based on the smoothed range. It tracks upward and downward movements to determine long and short signal conditions, and plots buy/sell signals and alerts when the conditions are met.

Uploaded by

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

//@version=3

study(title="Jaguar", overlay=true)

src=close

smoothrng(x, t, m)=>

wper = (t*2) - 1

avrng = ema(abs(x - x[1]), t)

smoothrng = ema(avrng, wper)*m

smoothrng

smrng = smoothrng(src, 100, 2.5)

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)

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])

hband = filt + smrng

lband = filt - smrng

filtcolor = upward > 0 ? lime : downward > 0 ? red : orange

barcolor = (src > filt) and (src > src[1]) and (upward > 0) ? lime : (src > filt) and (src < src[1]) and (upward
> 0) ? gray :

(src < filt) and (src < src[1]) and (downward > 0) ? red : (src < filt) and (src > src[1]) and (downward >
0) ? gray : gray

barcolor(barcolor)
longCond = na

shortCond = 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

plotshape(longCondition, title = "Buy Signal", text ="BUY", textcolor = white, style=shape.labelup, size =
size.normal, location=location.belowbar, color = green, transp = 0)

plotshape(shortCondition, title = "Sell Signal", text ="SELL", textcolor = white, style=shape.labeldown,


size = size.normal, location=location.abovebar, color = red, transp = 0)

alertcondition(longCondition, title="Buy Alert", message = "BUY")

alertcondition(longCondition, title="Buy Alert", message = "BUY")

alertcondition(longCondition, title="Buy Alert", message = "BUY")

alertcondition(shortCondition, title="Sell Alert", message = "SELL")

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy