0% found this document useful (0 votes)
163 views10 pages

Pivot-Master by CF-Zak & Team-Taurus

The document is a TradingView Pine Script for a technical analysis indicator called 'Pivot Master by Team Taurus'. It allows users to define time ranges, choose high timeframe methods, and customize various settings for plotting pivot points, Camarilla levels, and central pivot ranges. The script includes options for displaying labels, colors, and styles, as well as conditions for alerts and visual indicators for trading strategies.

Uploaded by

jatinghrera2
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)
163 views10 pages

Pivot-Master by CF-Zak & Team-Taurus

The document is a TradingView Pine Script for a technical analysis indicator called 'Pivot Master by Team Taurus'. It allows users to define time ranges, choose high timeframe methods, and customize various settings for plotting pivot points, Camarilla levels, and central pivot ranges. The script includes options for displaying labels, colors, and styles, as well as conditions for alerts and visual indicators for trading strategies.

Uploaded by

jatinghrera2
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/ 10

//Zak-Fx-TeamTaurus

//@version=5
indicator('Pivot Master by Team Taurus', shorttitle='Pivot Master by Team Taurus',
overlay=true, max_bars_back=5000)

// { Time Range
FromMonth = input.int(defval=1, title='FromMonth', minval=1, maxval=12,
group='Backtest Date')
FromDay = input.int(defval=1, title='FromDay', minval=1, maxval=31, group='Backtest
Date')
FromYear = input.int(defval=2020, title='FromYear', minval=2016, group='Backtest
Date')
ToMonth = input.int(defval=1, title='ToMonth', minval=1, maxval=12, group='Backtest
Date')
ToDay = input.int(defval=1, title='ToDay', minval=1, maxval=31, group='Backtest
Date')
ToYear = input.int(defval=9999, title='ToYear', minval=2017, group='Backtest Date')
start = timestamp(FromYear, FromMonth, FromDay, 00, 00)
finish = timestamp(ToYear, ToMonth, ToDay, 23, 59)
window() =>
time >= start and time <= finish ? true : false

// See if this bar's time happened on/after start date


afterStartDate = time >= start and time <= finish ? true : false

zeroline = 0

// } Time Range

mode = input.string(title='HTF Method', defval='User Defined', options=['Auto',


'User Defined'], tooltip='Choose Of the method to Select the Timeframe')
HTFm = input.timeframe('D', title='Time Frame (if HTF Method=User Defined)',
tooltip='Manual Timeframe Selection')
showlast = input.bool(title='Show Only Last Period', defval=true, group='Settings
ॐ', tooltip='Shows only Today levels bar by bar')
showlabels = input.bool(title='Show Labels', defval=true, group='Settings ॐ',
tooltip='Shows labels on plotted pivots')
lstyle = input.string(title='CAM Style', options=['Solid', 'Circles', 'Cross'],
defval='Solid', group='Style', tooltip='Change Line Style for Camarilla')
lstyle2 = input.string(title='CPR Style', options=['Solid', 'Circles', 'Cross'],
defval='Solid', group='Style', tooltip='Change Line Style for CPR')
flstyle = input.string(title='Fib Style', options=['Solid', 'Circles', 'Cross'],
defval='Solid', group='Style', tooltip='Change Line Style for Fibonacci Pivots')
rescol = input.color(defval=color.new(#ff7700, 0), title='Resistance Color',
group='Style')
supcol = input.color(defval=color.new(#000000, 0), title='Support Color',
group='Style')
Tcol = input.color(defval=color.new(color.red, 0), title='Color When Price in
Channel', group='Colors 🟡🟢🟣')
cturnon = input.bool(title='Turn On Camarilla', defval=true, group='Settings ॐ',
tooltip='Turn Camarilla ON')
cbar = input.bool(title='Cam Colored Bars', defval=false, group='Settings ॐ',
tooltip='Turn CColors ON')
cprturnon = input.bool(title='Turn On CPR', defval=false, group='Settings ॐ',
tooltip='Turn CPR on')
ST = input.bool(title='Show Camarilla Targets', defval=false, group='Settings ॐ')
JP = input.bool(title='Just Pivot', defval=false, group='Settings ॐ', tooltip='Show
Only Pivot of the day')
fibon = input.bool(title='Turn On Fib Pivot', defval=false, group='Settings ॐ',
tooltip='Turn Fib Pivots On')
sal = input.bool(title='Show Additional Levels?', defval=false, group='Settings ॐ',
tooltip='Show additional levels of Fib Pivots')
PDHL = input.bool(title='Show Previous Hi-Lo', defval=false, group='Settings ॐ',
tooltip='Show Previous Days Hi and Low')
rsicol = input.bool(false, title='Show RSI colors?', group='Settings ॐ',
tooltip='Show RSI Levels On Bars')
vwaplot = input.bool(false, title='VWAP Strategy', group='Settings ॐ',
tooltip='Turn on Vwap')
emaplot = input.bool(false, title='Show EMA on chart', group='Settings ॐ',
tooltip='Turns On 3 Ema\'s On Chart, Levels can be Edited')
choice = input.string(title='Choice', defval='EMA', options=['EMA', 'SMA'],
group='Settings ॐ', tooltip='Select Either EMA or SMA from dropdown menu')
MAa = input.int(9, title='Fast', minval=1, maxval=500, group='Settings ॐ')
MAb = input.int(27, title='Medium', minval=1, maxval=500, group='Settings ॐ')
MAc = input.int(111, title='Slow', minval=1, maxval=500, group='Settings ॐ')
MAd = input.int(200, title='Additional Ma', minval=1, maxval=500, group='Settings
ॐ')
lw = input.int(1, title='Ema Width', minval=1, maxval=3, group='Settings ॐ')

vsr = input.bool(false, title='Show Volume Based S&R', group='Settings ॐ',


tooltip='Shows Volume Based Support and Resistance on Stocks and Futures')
prd = input.int(defval=30, title='Pivot Point Period', minval=5, maxval=100,
group='Swing Length')
swing = input.bool(defval=false, title='Swing High Low', group='Settings ॐ',
tooltip='Turn On Swing Hi/Lo')

float ph = na
float pl = na
ph := ta.pivothigh(prd, prd)
pl := ta.pivotlow(prd, prd)

plotshape(ph and swing, text='HIGH', style=shape.labeldown, color=na,


textcolor=color.new(color.red, 0), location=location.abovebar, offset=-prd)
plotshape(pl and swing, text='LOW', style=shape.labeldown, color=na,
textcolor=color.new(color.green, 0), location=location.belowbar, offset=-prd)

//alertcondition(ph and swing, title="SELL", message="SELL")


//alertcondition(pl and swing, title="BUY", message="BUY")

//auto higher time frame


HTFo = timeframe.period == '1' ? '30' : timeframe.period == '3' ? '60' :
timeframe.period == '5' ? '60' : timeframe.period == '15' ? '240' :
timeframe.period == '30' ? 'D' : timeframe.period == '45' ? 'D' : timeframe.period
== '60' ? 'D' : timeframe.period == '120' ? 'D' : timeframe.period == '180' ? 'D' :
timeframe.period == '240' ? 'D' : timeframe.period == 'D' ? 'W' : timeframe.period
== 'W' ? 'M' : '5W'

HTF = mode == 'Auto' ? HTFo : HTFm

hhtf = request.security(syminfo.tickerid, HTF, high[1],


lookahead=barmerge.lookahead_on)
lhtf = request.security(syminfo.tickerid, HTF, low[1],
lookahead=barmerge.lookahead_on)
chtf = request.security(syminfo.tickerid, HTF, close[1],
lookahead=barmerge.lookahead_on)

rng = hhtf - lhtf

// is this last bar for HTF?


islast = showlast ? request.security(syminfo.tickerid, HTF, barstate.islast,
lookahead=barmerge.lookahead_on) : true

// Line Style
linestyle = lstyle == 'Solid' ? plot.style_line : lstyle == 'Circles' ?
plot.style_circles : lstyle == 'Cross' ? plot.style_cross : na
linestyleL = plot.style_circles
///////Calculation Camarilla
H4 = chtf + rng * 1.1 / 2
H3 = chtf + rng * 1.1 / 4
H2 = chtf + rng * 1.1 / 6
H1 = chtf + rng * 1.1 / 12
L1 = chtf - rng * 1.1 / 12
L2 = chtf - rng * 1.1 / 6
L3 = chtf - rng * 1.1 / 4
L4 = chtf - rng * 1.1 / 2
L5 = L4 - 1.168 * (L3 - L4) //L5 = chtf - (H5 - chtf)
H5 = H4 + 1.168 * (H4 - H3) //H5 = (hhtf / lhtf) * chtf
H6 = hhtf / lhtf * chtf //H6 = H5 + 1.168 * (H5 - H4)
L6 = chtf - (H6 - chtf) //L6 = chtf - (H6 - chtf)
SLbull = (H4 + H3) / 2
SLbear = (L4 + L3) / 2
mid = (H3 + L3) / 2
////////Color Settings

plot(islast and cturnon and ST ? H6 : na, title='H6', color=Tcol, linewidth=1,


style=linestyle)
plot(islast and cturnon and ST ? H5 : na, title='H5', color=Tcol, linewidth=1,
style=linestyle)
plot(islast and cturnon ? H4 : na, title='H4', color=rescol, linewidth=1,
style=linestyle)
plot(islast and cturnon ? H3 : na, title='H3', color=supcol, linewidth=1,
style=linestyle)
plot(islast and cturnon ? L3 : na, title='L3', color=supcol, linewidth=1,
style=linestyle)
plot(islast and cturnon ? L4 : na, title='L4', color=rescol, linewidth=1,
style=linestyle)
plot(islast and cturnon and ST ? L5 : na, title='L5', color=Tcol, linewidth=1,
style=linestyle)
plot(islast and cturnon and ST ? L6 : na, title='L6', color=Tcol, linewidth=1,
style=linestyle)

plot(islast and cturnon ? mid : na, 'Mid-H3-L3', color=color.new(#000000, 60),


linewidth=1, style=linestyleL)
plot(islast and cturnon ? SLbull : na, 'SLBull H3-H4', color=color.new(#ff0000,
60), linewidth=1, style=linestyleL)
plot(islast and cturnon ? SLbear : na, 'SLBear L3-L4', color=color.new(#388e3c,
60), linewidth=1, style=linestyleL)

// Label for S/R


mndr = time - time[1]
mndr := ta.change(mndr) > 0 ? mndr[1] : mndr

Round_it(valu) =>
a = 0
num = syminfo.mintick
s = valu
if na(s)
s := syminfo.mintick
s
if num < 1
for i = 1 to 20 by 1
num *= 10
if num > 1
break
a += 1
a

for x = 1 to a by 1
s *= 10
s
s := math.round(s)
for x = 1 to a by 1
s /= 10
s
s := s < syminfo.mintick ? syminfo.mintick : s
s

// Labels
if showlabels and cturnon
var label s3label = na
var label s4label = na
var label s5label = na
var label s6label = na
var label r3label = na
var label r4label = na
var label r5label = na
var label r6label = na

label.delete(s3label)
label.delete(s4label)
label.delete(s5label)
label.delete(s6label)
label.delete(r3label)
label.delete(r4label)
label.delete(r5label)
label.delete(r6label)
s3label := label.new(x=time + mndr * 10, y=L2, text='Buy Reversal ' +
str.tostring(Round_it(L3)), color=color.lime, textcolor=color.green,
style=label.style_none, xloc=xloc.bar_time, yloc=yloc.price)
s4label := label.new(x=time + mndr * 10, y=L4, text='Break Down ' +
str.tostring(Round_it(L4)), color=color.lime, textcolor=color.white,
style=label.style_none, xloc=xloc.bar_time, yloc=yloc.price)
s5label := label.new(x=time + mndr * 10, y=L5, text='Target ' +
str.tostring(Round_it(L5)), color=color.lime, textcolor=color.white,
style=label.style_none, xloc=xloc.bar_time, yloc=yloc.price)
s6label := label.new(x=time + mndr * 10, y=L6, text='Target ' +
str.tostring(Round_it(L6)), color=color.lime, textcolor=color.white,
style=label.style_none, xloc=xloc.bar_time, yloc=yloc.price)
r3label := label.new(x=time + mndr * 10, y=H2, text='Sell reversal ' +
str.tostring(Round_it(H3)), color=color.red, textcolor=color.red,
style=label.style_none, xloc=xloc.bar_time, yloc=yloc.price)
r4label := label.new(x=time + mndr * 10, y=H4, text='Breakout ' +
str.tostring(Round_it(H4)), color=color.red, textcolor=color.white,
style=label.style_none, xloc=xloc.bar_time, yloc=yloc.price)
r5label := label.new(x=time + mndr * 10, y=H5, text='Target ' +
str.tostring(Round_it(H5)), color=color.red, textcolor=color.white,
style=label.style_none, xloc=xloc.bar_time, yloc=yloc.price)
r6label := label.new(x=time + mndr * 10, y=H6, text='Target ' +
str.tostring(Round_it(H6)), color=color.red, textcolor=color.white,
style=label.style_none, xloc=xloc.bar_time, yloc=yloc.price)
r6label

//strategy buy long


//if (s3label := label.new(x = time + mndr * 20, y = L3, text = "Buy Reversal " +
tostring(Round_it(L3)), color = color.lime, textcolor=color.green,
style=label.style_none, xloc = xloc.bar_time, yloc=yloc.price)== true)
// strategy.entry("long", strategy.long)

//strategy buy short


//if (y = H3 == true)
//strategy.entry("short", strategy.short)

//////Central Pivot
Pivot = (hhtf + lhtf + chtf) / 3
BC = (hhtf + lhtf) / 2
TC = Pivot - BC + Pivot
//LineStyle CPR
linestylee = lstyle2 == 'Solid' ? plot.style_line : lstyle2 == 'Circles' ?
plot.style_circles : lstyle2 == 'Cross' ? plot.style_cross : na

plot(islast and cprturnon ? TC : na, title='TC', color=color.new(color.blue, 0),


linewidth=1, style=linestylee)
plot(islast and cprturnon ? Pivot : na, title='Pivot', color=color.new(color.red,
0), linewidth=1, style=linestylee)
plot(islast and cprturnon ? BC : na, title='BC', color=color.new(color.blue, 0),
linewidth=1, style=linestylee)
plot(islast and JP ? Pivot : na, title='JPivot', color=color.new(color.red, 0),
linewidth=2, style=linestylee)
if showlabels and JP
var label jplabel = na

label.delete(jplabel)
jplabel := label.new(x=time + mndr * 20, y=Pivot, text='Pivot ' +
str.tostring(Round_it(Pivot)), textcolor=color.black, style=label.style_none,
xloc=xloc.bar_time, yloc=yloc.price)
chtf
///////Day High Low//////
plot(islast and PDHL ? hhtf : na, title='Day High', color=color.new(color.black,
0), linewidth=2, style=linestylee)
plot(islast and PDHL ? lhtf : na, title='Day Low', color=color.new(color.black, 0),
linewidth=2, style=linestylee)
if showlabels and PDHL
var label pdhlabel = na
var label pdllabel = na

label.delete(pdhlabel)
label.delete(pdllabel)
pdhlabel := label.new(x=time + mndr * 20, y=hhtf, text='PDH ' +
str.tostring(Round_it(hhtf)), textcolor=color.black, style=label.style_none,
xloc=xloc.bar_time, yloc=yloc.price)
pdllabel := label.new(x=time + mndr * 20, y=lhtf, text='PDL ' +
str.tostring(Round_it(lhtf)), textcolor=color.black, style=label.style_none,
xloc=xloc.bar_time, yloc=yloc.price)
pdllabel
//////Fibo Pivot
// fib Line Style
flinestyle = flstyle == 'Solid' ? plot.style_line : flstyle == 'Cross' ?
plot.style_cross : flstyle == 'Circles' ? plot.style_circles : na
frc = #146690
fsc = #00bcd4

pivot = (hhtf + lhtf + chtf) / 3.0


R1 = pivot + 0.382 * rng
S1 = pivot - 0.382 * rng
R2 = pivot + 0.618 * rng
S2 = pivot - 0.618 * rng
R3 = pivot + rng
S3 = pivot - rng
R4 = pivot + 1.272 * rng
S4 = pivot - 1.272 * rng
R5 = pivot + 1.618 * rng
S5 = pivot - 1.618 * rng
R6 = pivot + 2.058 * rng
S6 = pivot - 2.058 * rng
R7 = pivot + 2.618 * rng
S7 = pivot - 2.618 * rng

plot(fibon and sal and islast ? R7 : na, title='R7', color=color.new(frc, 0),


linewidth=1, style=flinestyle)
plot(fibon and sal and islast ? R6 : na, title='R6', color=color.new(frc, 0),
linewidth=1, style=flinestyle)
plot(fibon and sal and islast ? R5 : na, title='R5', color=color.new(frc, 0),
linewidth=1, style=flinestyle)
plot(fibon and islast ? R4 : na, title='R4', color=color.new(frc, 0), linewidth=1,
style=flinestyle)
plot(fibon and islast ? R3 : na, title='R3', color=color.new(frc, 0), linewidth=1,
style=flinestyle)
plot(fibon and islast ? R2 : na, title='R2', color=color.new(frc, 0), linewidth=1,
style=flinestyle)
plot(fibon and islast ? R1 : na, title='R1', color=color.new(frc, 0), linewidth=1,
style=flinestyle)
plot(fibon and islast ? pivot : na, title='pivot', color=color.new(color.silver,
0), linewidth=1, style=flinestyle)
plot(fibon and islast ? S1 : na, title='S1', color=color.new(fsc, 0), linewidth=1,
style=flinestyle)
plot(fibon and islast ? S2 : na, title='S2', color=color.new(fsc, 0), linewidth=1,
style=flinestyle)
plot(fibon and islast ? S3 : na, title='S3', color=color.new(fsc, 0), linewidth=1,
style=flinestyle)
plot(fibon and islast ? S4 : na, title='S4', color=color.new(fsc, 0), linewidth=1,
style=flinestyle)
plot(fibon and sal and islast ? S5 : na, title='S5', color=color.new(fsc, 0),
linewidth=1, style=flinestyle)
plot(fibon and sal and islast ? S6 : na, title='S6', color=color.new(fsc, 0),
linewidth=1, style=flinestyle)
plot(fibon and sal and islast ? S7 : na, title='S7', color=color.new(fsc, 0),
linewidth=1, style=flinestyle)
if showlabels and fibon
var label fs1label = na
var label fs2label = na
var label fs3label = na
var label fs4label = na
var label plabel = na
var label fr1label = na
var label fr2label = na
var label fr3label = na
var label fr4label = na

label.delete(fs1label)
label.delete(fs2label)
label.delete(fs3label)
label.delete(fs4label)
label.delete(plabel)
label.delete(fr1label)
label.delete(fr2label)
label.delete(fr3label)
label.delete(fr4label)
fs1label := label.new(x=time + mndr * 20, y=S1, text='0.382 ' +
str.tostring(Round_it(S1)), color=color.lime, textcolor=color.green,
style=label.style_none, xloc=xloc.bar_time, yloc=yloc.price)
fs2label := label.new(x=time + mndr * 20, y=S2, text='0.618 ' +
str.tostring(Round_it(S2)), color=color.lime, textcolor=color.black,
style=label.style_none, xloc=xloc.bar_time, yloc=yloc.price)
fs3label := label.new(x=time + mndr * 20, y=S3, text='100 ' +
str.tostring(Round_it(S3)), color=color.lime, textcolor=color.black,
style=label.style_none, xloc=xloc.bar_time, yloc=yloc.price)
fs4label := label.new(x=time + mndr * 20, y=S4, text='1.272 ' +
str.tostring(Round_it(S4)), color=color.lime, textcolor=color.black,
style=label.style_none, xloc=xloc.bar_time, yloc=yloc.price)
plabel := label.new(x=time + mndr * 20, y=pivot, text='Pivot ' +
str.tostring(Round_it(pivot)), color=color.silver, textcolor=color.silver,
style=label.style_none, xloc=xloc.bar_time, yloc=yloc.price)
fr1label := label.new(x=time + mndr * 20, y=R1, text='0.382 ' +
str.tostring(Round_it(R1)), color=color.red, textcolor=color.red,
style=label.style_none, xloc=xloc.bar_time, yloc=yloc.price)
fr2label := label.new(x=time + mndr * 20, y=R2, text='0.618 ' +
str.tostring(Round_it(R2)), color=color.red, textcolor=color.black,
style=label.style_none, xloc=xloc.bar_time, yloc=yloc.price)
fr3label := label.new(x=time + mndr * 20, y=R3, text='100 ' +
str.tostring(Round_it(R3)), color=color.red, textcolor=color.black,
style=label.style_none, xloc=xloc.bar_time, yloc=yloc.price)
fr4label := label.new(x=time + mndr * 20, y=R4, text='1.272 ' +
str.tostring(Round_it(R4)), color=color.red, textcolor=color.black,
style=label.style_none, xloc=xloc.bar_time, yloc=yloc.price)
fr4label

if showlabels and fibon and sal


var label fs5label = na
var label fs6label = na
var label fs7label = na
var label fr5label = na
var label fr6label = na
var label fr7label = na

label.delete(fs5label)
label.delete(fs6label)
label.delete(fs7label)
label.delete(fr5label)
label.delete(fr6label)
label.delete(fr7label)
fs5label := label.new(x=time + mndr * 20, y=S5, text='1.618 ' +
str.tostring(Round_it(S5)), color=color.lime, textcolor=color.green,
style=label.style_none, xloc=xloc.bar_time, yloc=yloc.price)
fs6label := label.new(x=time + mndr * 20, y=S6, text='2.058 ' +
str.tostring(Round_it(S6)), color=color.lime, textcolor=color.black,
style=label.style_none, xloc=xloc.bar_time, yloc=yloc.price)
fs7label := label.new(x=time + mndr * 20, y=S7, text='2.618 ' +
str.tostring(Round_it(S7)), color=color.lime, textcolor=color.black,
style=label.style_none, xloc=xloc.bar_time, yloc=yloc.price)
fr5label := label.new(x=time + mndr * 20, y=R5, text='1.618 ' +
str.tostring(Round_it(R5)), color=color.red, textcolor=color.black,
style=label.style_none, xloc=xloc.bar_time, yloc=yloc.price)
fr6label := label.new(x=time + mndr * 20, y=R6, text='2.058 ' +
str.tostring(Round_it(R6)), color=color.red, textcolor=color.black,
style=label.style_none, xloc=xloc.bar_time, yloc=yloc.price)
fr7label := label.new(x=time + mndr * 20, y=R7, text='2.618 ' +
str.tostring(Round_it(R7)), color=color.red, textcolor=color.black,
style=label.style_none, xloc=xloc.bar_time, yloc=yloc.price)
fr7label

PAB = input.bool(true, 'Price Action Bars', group='Settings ॐ')


//Dark Cloud
DRKC = open[1] < close[1] ? open > high[1] ? close < close[1] - (close[1] -
open[1]) / 2 ? close > open[1] ? #dbff01 : na : na : na : na
barcolor(PAB ? DRKC : na, title='Dark Cloud')

//Bearish Engulfing
BrEng = close < open[1] ? low < low[1] ? high > high[1] ? open >= open[1] ? #FF7000
: na : na : na : na
barcolor(PAB ? BrEng : na, title='Bearish Engulf')

//Bullish Engulfing
BuEng = low < low[1] ? high > high[1] ? open <= open[1] ? close > open[1] ? #00FF00
: na : na : na : na
barcolor(PAB ? BuEng : na, title='Bullish Engulf')

//Three White Soldiers


TWS = close > open ? close[1] > open[1] ? close[2] > open[2] ? close > high[1] ?
close[1] > high[2] ? open < close[1] ? open[1] < close[2] ? (high - close) * 3 <
close - open ? (high[1] - close[1]) * 3 < close[1] - open[1] ? (high[2] - close[2])
* 3 < close[2] - open[2] ? #66ff00 : na : na : na : na : na : na : na : na : na :
na
barcolor(PAB ? TWS : na, title='Three white soliders')
TBC = close < open ? close[1] < open[1] ? close[2] < open[2] ? close < low[1] ?
close[1] < low[2] ? open > close[1] ? open[1] > close[2] ? (close - low) * 3 < open
- close ? (close[1] - low[1]) * 3 < open[1] - close[1] ? (close[2] - low[2]) * 3 <
open[2] - close[2] ? #ff6600 : na : na : na : na : na : na : na : na : na : na
barcolor(PAB ? TBC : na, title='Three Black Crows')
/////VWAP////MVWAP

plot(ta.vwap and vwaplot ? ta.vwap : na, linewidth=lw, title='VWAP',


color=color.new(#FF7000, 0))

//////EMA
plot(emaplot and choice == 'EMA' ? ta.ema(close, MAa) : emaplot and choice == 'SMA'
? ta.sma(close, MAa) : na, title='Fast MA', color=color.new(color.green, 0),
linewidth=lw)
plot(emaplot and choice == 'EMA' ? ta.ema(close, MAb) : emaplot and choice == 'SMA'
? ta.sma(close, MAb) : na, title='Mid MA', color=color.new(color.black, 0),
linewidth=lw)
plot(emaplot and choice == 'EMA' ? ta.ema(close, MAc) : emaplot and choice == 'SMA'
? ta.sma(close, MAc) : na, title='Slow MA', color=color.new(color.red, 0),
linewidth=lw)
plot(emaplot and choice == 'EMA' ? ta.ema(close, MAd) : emaplot and choice == 'SMA'
? ta.sma(close, MAd) : na, title='Additonal MA', color=color.new(#ff7700, 0),
linewidth=lw)

////////////////RSI
srcRSI = close
lenRSI = input.int(14, minval=1, title='RSI Length', group='RSI Settings')
up = ta.rma(math.max(ta.change(srcRSI), 0), lenRSI)
down = ta.rma(-math.min(ta.change(srcRSI), 0), lenRSI)
rsi = down == 0 ? 100 : up == 0 ? 0 : 100 - 100 / (1 + up / down)
//coloring method below
srcRSI1 = close
lenRSI1 = input.int(60, minval=1, title='Over Bought', group='RSI Settings')
srcRSI2 = close
lenRSI2 = input.int(40, minval=1, title='Over Sold', group='RSI Settings')
isup() =>
rsi > lenRSI1
isdown() =>
rsi < lenRSI2
barcolor(rsicol and isup() ? color.green : rsicol and isdown() ? color.red : na)

////////////Volume Based Support Resistance


Vlength = input.int(20, minval=1, group='Volume S/R Settings')
Vchange = volume / volume[1] - 1
stdev = ta.stdev(Vchange, Vlength)
difference = Vchange / stdev[1]
Treshold = input(5)
zero = 0
signal = math.abs(difference)
vstylee = plot.style_circles

leveluphi = ta.valuewhen(signal > Treshold, high[1], 0)


leveluplo = ta.valuewhen(signal > Treshold, low[1], 0)

//plot(UpperTreshold, color=black)
p1 = plot(vsr and leveluphi ? leveluphi : na, title='LevelHi', style=vstylee,
color=color.new(color.blue, 0))
p2 = plot(vsr and leveluplo ? leveluplo : na, title='Levello', style=vstylee,
color=color.new(color.blue, 0))
fill(p1, p2, color=color.new(color.black, 50), title='Fill')
////////////////////////
Ecandle = input.bool(false, 'Indecisive-Candle', group='Settings ॐ', tooltip='Shows
Candle')

cand = high - low


bodyr = open - close

candle = bodyr * 100 / cand

barcolor(Ecandle and candle > -50 and candle < 50 ? #0b00ff : na)
/////
plotshape(series=ta.crossover(close, H4), style=shape.circle,
location=location.belowbar, color=color.new(color.green, 0))
plotshape(series=ta.crossunder(close, L4), style=shape.circle,
location=location.abovebar, color=color.new(color.red, 0))

///////// Day Range


On = input.bool(true, 'Day Range', group='Settings TTA-MASTER')

fill(plot1=plot(On and islast ? H4 : na, color=color.new(#ff7700, 80),


editable=false), plot2=plot(On and islast ? R2 : na, color=color.new(#ff7700, 100),
editable=false), color=color.new(#ff7700, 75))
fill(plot1=plot(On and islast ? L4 : na, color=color.new(#000000, 80),
editable=false), plot2=plot(On and islast ? S2 : na, color=color.new(#000000, 100),
editable=false), color=color.new(#000000, 75))

//strategy.entry('LONG', strategy.long, when=ph and swing)


//strategy.entry('SHORT', strategy.short, when=pl and swing)

You might also like