0% found this document useful (0 votes)
1K views

Pine Script

This script creates an EMA envelope indicator with upper and lower bands based on an ema of the close price. It plots the upper and lower smoothed extremes, along with signals for when the price touches the upper or lower bands and when the range between the bands contracts.

Uploaded by

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

Pine Script

This script creates an EMA envelope indicator with upper and lower bands based on an ema of the close price. It plots the upper and lower smoothed extremes, along with signals for when the price touches the upper or lower bands and when the range between the bands contracts.

Uploaded by

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

https://in.tradingview.

com/script/azKqKb0x-Spread-Indicator/

//@version=4

study(title="EMA Envelope Max Min Extremes with Range Contraction Signal VII", shorttitle="Env",
overlay=true)

len = input(20, title="Length", minval=1)

a = close - ema(close, len)

b = iff(a < 0, a * -1, a)

d = ema(b, len)

basis = ema(close, len)

upper = basis + d

lower = basis - d

max = max(upper, close)

smooth = ema(max, len)

min = min(close, lower)

smooth2 = ema(min, len)

plot(smooth2)

smaa = ema(smooth2, len)

plot(smooth)

smaa2 = ema(smooth, len)


rising = rising(smooth2, len / 5)

falling0 = falling(smooth, len / 5)

wedge = iff(rising and falling0, smooth, na)

wedge2 = iff(rising and falling0, smooth2, na)

plot(wedge, style=plot.style_linebr, linewidth=3)

plot(wedge2, style=plot.style_linebr, linewidth=3)

range = smooth - smooth2

falling = falling(range, len)

falling2 = iff(falling, close, na)

plot(falling2, style=plot.style_linebr, linewidth=3)

You might also like