Cam Day
Cam Day
Cam Day
//Get previous day/week bar and avoiding realtime calculation by taking the
previous to current bar
[sopen,shigh,slow,sclose] = request.security(syminfo.tickerid, t,
[open[1],high[1],low[1],close[1]], barmerge.gaps_off, barmerge.lookahead_on)
//shigh = request.security(syminfo.tickerid, t, high[1], barmerge.gaps_off,
barmerge.lookahead_on)
//slow = request.security(syminfo.tickerid, t, low[1], barmerge.gaps_off,
barmerge.lookahead_on)
//sclose = request.security(syminfo.tickerid, t, close[1], barmerge.gaps_off,
barmerge.lookahead_on)
r = shigh - slow
//Calculate pivots
center = sclose
h1c = sclose + r * (1.1 / 12)
h2 = sclose + r * (1.1 / 6)
h3 = sclose + r * (1.1 / 4)
h4 = sclose + r * (1.1 / 2)
h5 = shigh / slow * sclose
l1c = sclose - r * (1.1 / 12)
l2 = sclose - r * (1.1 / 6)
l3 = sclose - r * (1.1 / 4)
l4 = sclose - r * (1.1 / 2)
l5 = sclose - (h5 - sclose)
//Plotting
//plot(center, title='Central', color=cc, linewidth=3, transp=0)
//plot(h5, title='H5', color=c5c, linewidth=1, style=plot.style_line, transp=0)
//plot(h4, title='H4', color=c4c, linewidth=1,style=plot.style_line, transp=0)
//plot(h3, title='H3', color=c3c, linewidth=1,style=plot.style_line, transp=0)
//plot(h2, title='H2', color=c2c, linewidth=1,style=plot.style_line, transp=0)
//plot(h1c, title='H1', color=c1c, linewidth=1,style=plot.style_line, transp=0)
//plot(l1c, title='L1', color=c1c, linewidth=1,style=plot.style_line, transp=0)
//plot(l2, title='L2', color=c2c, linewidth=1,style=plot.style_line, transp=0)
//plot(l3, title='L3', color=c3c, linewidth=1,style=plot.style_line, transp=0)
//plot(l4, title='L4', color=c4c, linewidth=1,style=plot.style_line, transp=0)
//plot(l5, title='L5', color=c5c, linewidth=1,style=plot.style_line, transp=0)
ll_offset = bar_index
l_size = size.small