Dubble BB + Parabolic + SMA 200 + Pivot Level

60
////////////////////////////////////////////////////////////
// Copyright by HPotter v1.0 10/07/2014
// Pivot points simply took the high, low, and closing price from the previous period and
// divided by 3 to find the pivot. From this pivot, traders would then base their
// calculations for three support, and three resistance levels. The calculation for the most
// basic flavor of pivot points, known as ‘floor-trader pivots’, along with their support and
// resistance levels.
////////////////////////////////////////////////////////////
study(title="Pivot Point", shorttitle="Pivot Point", overlay = true)
width = input(2, minval=1)
xHigh = security(tickerid,"D", high[1])
xLow = security(tickerid,"D", low[1])
xClose = security(tickerid,"D", close[1])
vPP = (xHigh+xLow+xClose) / 3
vR1 = vPP+(vPP-xLow)
vS1 = vPP-(xHigh - vPP)
vR2 = vPP + (xHigh - xLow)
vS2 = vPP - (xHigh - xLow)
vR3 = xHigh + 2 * (vPP - xLow)
vS3 = xLow - 2 * (xHigh - vPP)
plot(vS1, color=#ff0000, title="S1", style = circles, linewidth = width)
plot(vS2, color=#ff002a, title="S2", style = circles, linewidth = width)
plot(vS3, color=#ff014a, title="S3", style = circles, linewidth = width)
plot(vR1, color=#009600, title="R1", style = circles, linewidth = width)
plot(vR2, color=#006F00, title="R2", style = circles, linewidth = width)
plot(vR3, color=#004900, title="R3", style = circles, linewidth = width)
length = input(20, minval=1)
src = input(close, title="Source")

Band1 = input(2.0, minval=0.001, maxval=10, step=0.1)
basis = sma(src, length)
dev = Band1 * stdev(src, length)
upper = basis + dev
lower = basis - dev

Band2 = input(3.0, minval=0.001, maxval=10, step=0.1)
dev2 = Band2 * stdev(src, length)
upper2 = basis + dev2
lower2 = basis - dev2


p1a = plot(upper, title="BB2 upper", color=green)
p1b = plot(lower, title="BB2 lower", color=green)

p2a = plot(upper2, title="BB3 upper", color=blue)
p2b = plot(lower2, title="BB3 lower", color=blue)

//SMA Cross 10/21/100

long = ema(close, 200)

BB = sma(close, 20)

plot(long, title="SMA200", color = aqua)

plot(BB, title="SMA20", color = maroon)

//SAR
start = input(2, minval=0, maxval=10, title="Start - Default = 2 - Multiplied by .01")
increment = input(2, minval=0, maxval=10, title="Step Setting (Sensitivity) - Default = 2 - Multiplied by .01" )
maximum = input(2, minval=1, maxval=10, title="Maximum Step (Sensitivity) - Default = 2 - Multiplied by .10")
sus = input(true, "Show Up Trending Parabolic Sar")
sds = input(true, "Show Down Trending Parabolic Sar")
disc = input(false, title="Start and Step settings are *.01 so 2 = .02 etc, Maximum Step is *.10 so 2 = .2")
//"------Step Setting Definition------"
//"A higher step moves SAR closer to the price action, which makes a reversal more likely."
//"The indicator will reverse too often if the step is set too high."

//"------Maximum Step Definition-----")
//"The sensitivity of the indicator can also be adjusted using the Maximum Step."
//"While the Maximum Step can influence sensitivity, the Step carries more weight"
//"because it sets the incremental rate-of-increase as the trend develops"

startCalc = start * .01
incrementCalc = increment * .01
maximumCalc = maximum * .10

sarUp = sar(startCalc, incrementCalc, maximumCalc)
sarDown = sar(startCalc, incrementCalc, maximumCalc)

colUp = close >= sarDown ? lime : na
colDown = close <= sarUp ? red : na

plot(sus and sarUp ? sarUp : na, title="Up Trending SAR", style=circles, linewidth=2,color=colUp)
plot(sds and sarDown ? sarDown : na, title="Up Trending SAR", style=circles, linewidth=2,color=colDown)///////////////////////////////

Disclaimer

The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.