cristian.d

Camarilla 5 and 6 only - weekly and monthly pivots

654 0 81
Request from Tarkahn - weeklies and monthlies Camarilla Pivots , 5 and 6 levels only. You can have the built in Camarilla pivots on chart, and use this as an add-on.
Level 5 and 6 are used as a final line of defense from strong trends. Expect reversals here.
Remove from Favorite Scripts Add to Favorite Scripts
//Created by CristianD
study(title="Camarilla 5 and 6", shorttitle="CD Camarilla 5 and 6 - D,W,M", overlay=true) 
sd = input(true, title="Show Daily Pivots?")
sw = input(true, title="Show Weekly Pivots?")
sm = input(true, title="Show Monthly Pivots?")

//Camarilla
pivot = (high + low + close ) / 3.0 
range = high - low
h5 = (high/low) * close 
h4 = close + (high - low) * 1.1 / 2.0
h3 = close + (high - low) * 1.1 / 4.0
h2 = close + (high - low) * 1.1 / 6.0
h1 = close + (high - low) * 1.1 / 12.0
l1 = close - (high - low) * 1.1 / 12.0
l2 = close - (high - low) * 1.1 / 6.0
l3 = close - (high - low) * 1.1 / 4.0
l4 = close - (high - low) * 1.1 / 2.0
h6 = h5 + 1.168 * (h5 - h4) 
l5 = close - (h5 - close)
l6 = close - (h6 - close)
// Daily line breaks
sopen = security(tickerid, "D", open [1])
shigh = security(tickerid, "D", high [1])
slow = security(tickerid, "D", low [1])
sclose = security(tickerid, "D", close [1])
// Weekly line breaks
sopenw = security(tickerid, "W", open [1])
shighw = security(tickerid, "W", high [1])
sloww = security(tickerid, "W", low [1])
sclosew = security(tickerid, "W", close [1])
// Monthly line breaks
sopenm = security(tickerid, "M", open [1])
shighm = security(tickerid, "M", high [1])
slowm = security(tickerid, "M", low [1])
sclosem = security(tickerid, "M", close [1])
// Color
dcolor=sopen != sopen[1] ? na : black
dcolor1=sopen != sopen[1] ? na : red
dcolor2=sopen != sopen[1] ? na : green
wcolor=sopenw != sopenw[1] ? na : orange
wcolor1=sopenw != sopenw[1] ? na : red
wcolor2=sopenw != sopenw[1] ? na : green
mcolor=sopenm != sopenm[1] ? na : fuchsia
mcolor1=sopenm != sopenm[1] ? na : red
mcolor2=sopenm != sopenm[1] ? na : green
//Daily Pivots 
dtime_pivot = security(tickerid, 'D', pivot[1]) 
dtime_h6 = security(tickerid, 'D', h6[1]) 
dtime_h5 = security(tickerid, 'D', h5[1]) 
dtime_h4 = security(tickerid, 'D', h4[1]) 
dtime_h3 = security(tickerid, 'D', h3[1]) 
dtime_h2 = security(tickerid, 'D', h2[1]) 
dtime_h1 = security(tickerid, 'D', h1[1]) 
dtime_l1 = security(tickerid, 'D', l1[1]) 
dtime_l2 = security(tickerid, 'D', l2[1]) 
dtime_l3 = security(tickerid, 'D', l3[1]) 
dtime_l4 = security(tickerid, 'D', l4[1]) 
dtime_l5 = security(tickerid, 'D', l5[1]) 
dtime_l6 = security(tickerid, 'D', l6[1]) 
//Weekly Pivots
wtime_pivot = security(tickerid, 'W', pivot[1]) 
wtime_h6 = security(tickerid, 'W', h6[1]) 
wtime_h5 = security(tickerid, 'W', h5[1]) 
wtime_h4 = security(tickerid, 'W', h4[1]) 
wtime_h3 = security(tickerid, 'W', h3[1]) 
wtime_h2 = security(tickerid, 'W', h2[1]) 
wtime_h1 = security(tickerid, 'W', h1[1]) 
wtime_l1 = security(tickerid, 'W', l1[1]) 
wtime_l2 = security(tickerid, 'W', l2[1]) 
wtime_l3 = security(tickerid, 'W', l3[1]) 
wtime_l4 = security(tickerid, 'W', l4[1]) 
wtime_l5 = security(tickerid, 'W', l5[1]) 
wtime_l6 = security(tickerid, 'W', l6[1]) 
//Monthly Pivots
mtime_pivot = security(tickerid, 'W', pivot[1]) 
mtime_h6 = security(tickerid, 'M', h6[1]) 
mtime_h5 = security(tickerid, 'M', h5[1]) 
mtime_h4 = security(tickerid, 'M', h4[1]) 
mtime_h3 = security(tickerid, 'M', h3[1]) 
mtime_h2 = security(tickerid, 'M', h2[1]) 
mtime_h1 = security(tickerid, 'M', h1[1]) 
mtime_l1 = security(tickerid, 'M', l1[1]) 
mtime_l2 = security(tickerid, 'M', l2[1]) 
mtime_l3 = security(tickerid, 'M', l3[1]) 
mtime_l4 = security(tickerid, 'M', l4[1]) 
mtime_l5 = security(tickerid, 'M', l5[1]) 
mtime_l6 = security(tickerid, 'M', l6[1]) 
offs_daily = 0
plot(sd and dtime_h6 ? dtime_h6 : na, title="Daily H6",color=dcolor, linewidth=2)
plot(sd and dtime_h5 ? dtime_h5 : na, title="Daily H5",color=dcolor, linewidth=2)
plot(sd and dtime_l5 ? dtime_l5 : na, title="Daily L5",color=dcolor, linewidth=2)
plot(sd and dtime_l6 ? dtime_l6 : na, title="Daily L6",color=dcolor, linewidth=2)
offs_weekly = 0
plot(sw and wtime_h6 ? wtime_h6 : na, title="Weekly H6", color=wcolor, linewidth=4)
plot(sw and wtime_h5 ? wtime_h5 : na, title="Weekly H5",color=wcolor, linewidth=4)
plot(sw and wtime_l5 ? wtime_l5 : na, title="Weekly L5",color=wcolor, linewidth=4)
plot(sw and wtime_l6 ? wtime_l6 : na, title="Weekly L6",color=wcolor, linewidth=4)
offs_monthly = 0
plot(sm and mtime_h6 ? mtime_h6 : na, title="Monthly H6", color=mcolor, linewidth=6)
plot(sm and mtime_h5 ? mtime_h5 : na, title="Monthly H5",color=mcolor, linewidth=6)
plot(sm and mtime_l5 ? mtime_l5 : na, title="Monthly L5",color=mcolor, linewidth=6)
plot(sm and mtime_l6 ? mtime_l6 : na, title="Monthly L6",color=mcolor, linewidth=6)



United States
United Kingdom
India
Deutschland
France
España
Italia
Polska
Türkiye
Россия
Brasil
Indonesia
Malaysia
Việt Nam
日本
한국
简体
繁體
Home Stock Screener Forex Signal Finder Cryptocurrency Signal Finder Economic Calendar How It Works Chart Features House Rules Moderators Website & Broker Solutions Widgets Stock Charting Library Feature Request Blog & News FAQ Help & Wiki Twitter
Profile Profile Settings Account and Billing My Support Tickets Priority Support Contact Support Ideas Published Followers Following Private Messages Chat Sign Out