Kod:
//@version=4study(title="CamarillaTred", shorttitle="CTP", overlay=true)
//width = input(2, minval=1)
//choices = input(title="P", defval="12M", options=["D", "W", "M", "3M", "12M"])
res = input(title="PPeriod", type=input.resolution, defval="D")
res1 = input(title="HLPeriod", type=input.resolution, defval="D")
choice = input(title="Pkind", defval="C", options=["T", "C"])
c = choice
PP = security(syminfo.tickerid, res, hlc3[1], lookahead=true)
phigh = security(syminfo.tickerid, res, high[1], lookahead=true)
plow = security(syminfo.tickerid, res, low[1], lookahead=true)
pclose = security(syminfo.tickerid, res, close[1], lookahead=true)
ph = security(syminfo.tickerid, res1, high[1], lookahead=true)
pl = security(syminfo.tickerid, res1, low[1], lookahead=true)
tr1 = PP * 2 - plow
ts1 = PP * 2 - phigh
tr2 = PP + (phigh - plow)
ts2 = PP - (phigh - plow)
tr3 = PP * 2 + (phigh - 2 * plow)
ts3 = PP * 2 - (2 * phigh - plow)
tr4 = PP * 3 + (phigh - 3 * plow)
ts4 = PP * 3 - (3 * phigh - plow)
tr5 = PP * 4 + (phigh - 4 * plow)
ts5 = PP * 4 - (4 * phigh - plow)
cr4 = (0.55*(phigh-plow)) + pclose
cr3 = (0.275*(phigh-plow)) + pclose
cr2 = (0.183*(phigh-plow)) + pclose
cr1 = (0.0916*(phigh-plow)) + pclose
cs1 = pclose -(0.0916*(phigh-plow))
cs2 = pclose -(0.183*(phigh-plow))
cs3 = pclose -(0.275*(phigh-plow))
cs4 = pclose -(0.55*(phigh-plow))
r1 = if c == "T"
tr1
else if c == "C"
cr1
r2 = if c == "T"
tr2
else if c == "C"
cr2
r3 = if c == "T"
tr3
else if c == "C"
cr3
r4 = if c == "T"
tr4
else if c == "C"
cr4
r5 = if c == "T"
tr5
s1 = if c == "T"
ts1
else if c == "C"
cs1
s2 = if c == "T"
ts2
else if c == "C"
cs2
s3 = if c == "T"
ts3
else if c == "C"
cs3
s4 = if c == "T"
ts4
else if c == "C"
cs4
s5 = if c == "T"
ts5
plot(r5, color=#7fff00, title= "R5" , linewidth=1 )
plot(r4, color=#458b00, title= "R4" , linewidth=1 )
plot(r3, color=#caff70, title= "R3" , linewidth=1 )
plot(r2, color=#8b8b00 , title= "R2" , linewidth=1 )
plot(r1, color=#008080, title= "R1" , linewidth=1 )
p1= plot(PP, color=color.yellow, title= "PP" , linewidth=2 )
p2= plot(ph, color=color.white, title= "High" , linewidth=2)
p3= plot(pl, color=#97ffff, title= "Low" , linewidth=2)
plot(s1, color=#dda0dd, title= "S1" , linewidth=1 )
plot(s2, color=#ff6a6a, title= "S2" , linewidth=1 )
plot(s3, color=#ff3030, title= "S3" , linewidth=1 )
plot(s4, color=#c71585, title= "S4" , linewidth=1 )
plot(s5, color=#8b0000, title= "S5" , linewidth=1 )
Yer İmleri