Professional Documents
Culture Documents
0 at
https://mozilla.org/MPL/2.0/
// � Stock_Warrior
//@version=4
///////////////////////////////////////////////////////////////////////////////////
///////////////////////////////
//////////////////////////////////////////////// WMA -
9/20/50/100 ///////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////
//////////////////////////////
///////////////////////////////////////////////////////////////////////////////////
///////////////////////////////
///////////////////////////////////////////////////
VWAP /////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////
//////////////////////////////
//vwaplength = input(title="VWAP Length", type=input.integer, defval=1)
//cvwap = ema(vwap,vwaplength)
cvwap1 = vwap(hlc3)
plotvwap = plot(showVWAP ? cvwap1 : na,title="VWAP",color=color.black,
transp=0, linewidth=2)
///////////////////////////////////////////////////////////////////////////////////
///////////////////////////////
///////////////////////////////////////////////////
VWMA /////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////
//////////////////////////////
vwma_length = 20 //input(title="VWMA Length", type=input.integer,
defval=1)
vwma_1 = vwma(close,vwma_length)
plotvwma = plot(showVWMA ? vwma_1 : na, title="VWMA", color=color.blue,
transp=0, linewidth=2)
///////////////////////////////////////////////////////////////////////////////////
///////////////////////////////
///////////////////////////////////////////// PARABOLIC
SAR //////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////
//////////////////////////////
start = 0.02 //input(0.02)
increment = 0.02 //input(0.02)
maximum = 0.2 //input(0.2, "Max Value")
psar_out = sar(start, increment, maximum)
plot(showPSAR ? psar_out : na, "ParabolicSAR", style=plot.style_cross,
color=#2196f3)
///////////////////////////////////////////////////////////////////////////////////
///////////////////////////////
/////////////////////////////////////////// BOLLINGER
BAND////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////
//////////////////////////////
length = 20 //input(20, minval=1)
src = close //input(close, title="BB_Source")
mult = 2 //input(2.0, minval=0.001, maxval=50,
title="BB_StdDev")
basis = sma(src, length)
dev = mult * stdev(src, length)
upper = basis + dev
lower = basis - dev
p1 = plot(showBB ? upper : na, "Upper", color=color.teal,
editable=false)
p2 = plot(showBB ? lower: na, "Lower", color=color.teal,
editable=false)
plot(showBB ? basis : na, "Basis", color=#872323, editable=false)
fill(p1, p2, title = "Background", color=#198787, transp=95)
///////////////////////////////////////////////////////////////////////////////////
///////////////////////////////
///////////////////////////////////// CENTRAL PIVOT RANGE
(CPR) //////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////
//////////////////////////////
res = input(title="Resolution", type=input.resolution, defval="D")
res1 = input(title="Resolution", type=input.resolution, defval="W")
res2 = input(title="Resolution", type=input.resolution, defval="M")
H = security(syminfo.tickerid, res, high[1], barmerge.gaps_off,
barmerge.lookahead_on)
L = security(syminfo.tickerid, res, low[1], barmerge.gaps_off,
barmerge.lookahead_on)
C = security(syminfo.tickerid, res, close[1], barmerge.gaps_off,
barmerge.lookahead_on)
WH = security(syminfo.tickerid, res1, high[1], barmerge.gaps_off,
barmerge.lookahead_on)
WL = security(syminfo.tickerid, res1, low[1], barmerge.gaps_off,
barmerge.lookahead_on)
WC = security(syminfo.tickerid, res1, close[1], barmerge.gaps_off,
barmerge.lookahead_on)
MH = security(syminfo.tickerid, res2, high[1], barmerge.gaps_off,
barmerge.lookahead_on)
ML = security(syminfo.tickerid, res2, low[1], barmerge.gaps_off,
barmerge.lookahead_on)
MC = security(syminfo.tickerid, res2, close[1], barmerge.gaps_off,
barmerge.lookahead_on)
TTH = security(syminfo.tickerid, res, high, barmerge.gaps_off,
barmerge.lookahead_on)
TTL = security(syminfo.tickerid, res, low, barmerge.gaps_off,
barmerge.lookahead_on)
TTC = security(syminfo.tickerid, res, close, barmerge.gaps_off,
barmerge.lookahead_on)
PP = (H + L + C) / 3
TC = (H + L)/2
BC = (PP - TC) + PP
R1 = (PP * 2) - L
R2 = PP + (H - L)
R3 = H + 2*(PP - L)
R4 = PP * 3 + (H - 3 * L)
S1 = (PP * 2) - H
S2 = PP - (H - L)
S3 = L - 2*(H - PP)
S4 = PP*3 - (3*H - L)
WPP = (WH + WL + WC)/3
WTC = (WH + WL)/2
WBC = (WPP - WTC) + WPP
MPP = (MH + ML + MC)/3
MTC = (MH + ML)/2
MBC = (MPP - MTC) + MPP
TOPP = (TTH + TTL + TTC)/3
TOTC = (TTH + TTL)/2
TOBC = (TOPP - TOTC) + TOPP
TR1 = (TOPP * 2) - TTL
TR2 = TOPP + (TTH - TTL)
TS1 = (TOPP * 2) - TTH
TS2 = TOPP - (TTH - TTL)
plot(showpivot ? PP : na, title="PP", style=plot.style_circles, color=color.orange,
linewidth=2)
plot(showpivot ? TC : na, title="TC", style=plot.style_circles, color=color.blue,
linewidth=2)
plot(showpivot ? BC : na, title="BC", style=plot.style_circles, color=color.blue,
linewidth=2)
///////////////////////////////////////////////////////////////////////////////////
///////////////////////////////
/////////////////////////////////////////////////// PREVIOUS
DAY /////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////
///////////////////////////////
prevDayHigh = security(syminfo.tickerid, 'D', high[1], lookahead=true)
prevDayLow = security(syminfo.tickerid, 'D', low[1], lookahead=true)
plot( showpivot and prevDayHigh ? prevDayHigh : na, title="Prev Day High",
style=plot.style_stepline, linewidth=1, color=color.red, transp=0)
plot( showpivot and prevDayLow ? prevDayLow : na, title="Prev Day Low",
style=plot.style_stepline, linewidth=1, color=color.green, transp=0)
///////////////////////////////////////////////////////////////////////////////////
///////////////////////////////
///////////////////////////////////////////////// PREVIOUS
WEEKLY ///////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////
///////////////////////////////
prevWeekHigh = security(syminfo.tickerid, 'W', high[1], lookahead=true)
prevWeekLow = security(syminfo.tickerid, 'W', low[1], lookahead=true)
plot( showpivot and prevWeekHigh ? prevWeekHigh : na, title="Prev Week High",
style=plot.style_stepline, linewidth=2, color=color.red, transp=0)
plot( showpivot and prevWeekLow ? prevWeekLow : na, title="Prev Week Low",
style=plot.style_stepline, linewidth=2, color=color.green, transp=0)
///////////////////////////////////////////////////////////////////////////////////
///////////////////////////////
///////////////////////////////////////////////// PREVIOUS
MONTH /////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////
///////////////////////////////
prevMonthHigh = security(syminfo.tickerid, 'M', high[1], lookahead=true)
prevMonthLow = security(syminfo.tickerid, 'M', low[1], lookahead=true)
plot( showpivot and prevMonthHigh ? prevMonthHigh : na, title="Prev Month High",
style=plot.style_stepline, linewidth=3, color=color.red, transp=0)
plot( showpivot and prevMonthLow ? prevMonthLow : na, title="Prev Month Low",
style=plot.style_stepline, linewidth=3, color=color.green, transp=0)
///////////////////////////////////////////////////////////////////////////////////
///////////////////////////////
///////////////////////////////////////////////// NOT
NECESSARY //////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////
///////////////////////////////