ironcondor

RP analysis updated 06302015

4
RP analysis updated 06302015
Open-source script

In true TradingView spirit, the author of this script has published it open-source, so traders can understand and verify it. Cheers to the author! You may use it for free, but reuse of this code in a publication is governed by House Rules. You can favorite it to use it on a chart.

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.

Want to use this script on a chart?
study("RP analysis", overlay=true)
bars = input(type=integer, defval=500)

topen = security(tickerid, 'D', open)
thigh = security(tickerid, 'D', high)
tlow = security(tickerid, 'D', low)
tclose = security(tickerid, 'D', close)
yopen = security(tickerid, 'D', open[1])
yhigh = security(tickerid, 'D', high[1])
ylow = security(tickerid, 'D', low[1])
yclose = security(tickerid, 'D', close[1])

avgbody = security(tickerid, 'D', sum(open-close>0?open-close:close-open, bars)/bars)  
avgtopwick = security(tickerid, 'D',  sum(open>close?high-open:high-close, bars)/bars )  
avgbottomwick = security(tickerid, 'D',  sum(open>close?close-low:open-low, bars)/bars )  

avgoverema = security(tickerid, 'D', sum(high>ema(close, 13)?high-ema(close, 13):nz(na), bars)/bars)
avgunderema = security(tickerid, 'D', sum(ema(close, 13)>low?ema(close, 13)-low:nz(na), bars)/bars)
highestema = highest(security(tickerid, 'D', high-ema(close, 13)>0?high-ema(close, 13):nz(na)), bars)
lowestema = highest(security(tickerid, 'D', ema(close, 13)-low>0?ema(close, 13)-low:nz(na)), bars)

todayema = security(tickerid, 'D', ema(close, 13))
vwap1 = plot(vwap, title="vwap",style=line, color=blue, linewidth=4)


////// PLOTS
plotopen = plot(topen, title="Open",style=line, color=green, linewidth=4)
sma100 = plot(sma(close, 100), title="SMA100",style=line, color=red, linewidth=4)
sma500 = plot(sma(close, 500), title="SMA 500",style=line, color=gray, linewidth=4)

plotema = plot(todayema, title="EMA",style=line, color=red, linewidth=4)
topema = plot(todayema+avgoverema, title="EMA Top",style=line, color=aqua, linewidth=4)
bottomema = plot(todayema-avgunderema, title="EMA Bottom",style=line, color=aqua, linewidth=4)
plothighestema = plot(todayema+highestema, title="EMA Highest",style=line, color=aqua, linewidth=4)
plotlowestema = plot(todayema-lowestema, title="EMA Lowest",style=line, color=aqua, linewidth=4)

wickzonetop = plot(topen+avgtopwick, title="Top Wickzone",style=line, color=blue, linewidth=4)
wickzonebottom = plot(topen-avgbottomwick, title="Bottom Wickzone",style=line, color=blue, linewidth=4)
fill(plotopen, wickzonetop, color=silver, transp=75)
fill(plotopen, wickzonebottom, color=silver, transp=75)


plotbodytop = plot(topen+avgbody, title="Top Close",style=line, color=black, linewidth=4)
plottopwick = plot(topen+avgbody+avgtopwick, title="Top Limit",style=line, color=purple, linewidth=4)
fill(wickzonetop, plotbodytop, color=black, transp=75)
fill(plotbodytop, plottopwick, color=red, transp=75)

plotbodybottom = plot(topen-avgbody, title="Bottom Close",style=line, color=black, linewidth=4)
plotbottomwick = plot(topen-avgbody-avgbottomwick, title="Bottom Limit",style=line, color=purple, linewidth=4)
fill(wickzonebottom, plotbodybottom, color=black, transp=75)
fill(plotbodybottom, plotbottomwick, color=red, transp=75)