Alıntı Originally Posted by ofa Yazıyı Oku
Hocam merhaba,

Bu sefer de "You cannot use strategy functions (strategy.entry) in study script. Please replace 'study' with 'strategy'." hatası veriyor.
 Alıntı Originally Posted by obblomovv Yazıyı Oku
Şöyle deneyin:




Kod:
//@version=4



study(title="POMTF", shorttitle="POM", overlay = true)
res = input(title="Pivot Periyot", type=input.resolution, defval="W")
reso = input(title="Ortalama Periyot", type=input.resolution, defval="D")


PPC = security(syminfo.tickerid, res, close)[1]
PPH = security(syminfo.tickerid, res, high)[1]
PPL = security(syminfo.tickerid, res, low)[1]




g20 = security(syminfo.tickerid,reso, ema(PPC, 20))
g50 = security(syminfo.tickerid,reso, ema(PPC, 50))
g100 = security(syminfo.tickerid,reso, ema(PPC, 100))
g200 = security(syminfo.tickerid,reso, ema(PPC, 200))
g500 = security(syminfo.tickerid,reso, ema(PPC, 500))




pivot = security(syminfo.tickerid, res, hlc3)[1]




r1 = (pivot * 2) - PPL
s1 = (pivot * 2) - PPH
r2 = (pivot + (PPH - PPL))
s2 = (pivot - (PPH - PPL))
r3 = (pivot * 2) + (PPH - (2 * PPL))
s3 = (pivot * 2) - ((2 * PPH) - PPL)
r4 = (pivot * 3) + (PPH - (3 * PPL))
s4 = (pivot * 3) - ((3 * PPH) - PPL)
r5 = (pivot * 4) + (PPH - (4 * PPL))
s5 = (pivot * 4) - ((4 * PPH) - PPL)






plot(g20, color=#8470ff, title="g20",  linewidth = 1)
plot(g50, color=color.white, title="g50",  linewidth = 1)
plot(g100, color=color.yellow, title="g100",  linewidth = 1)
plot(g200, color=color.blue, title="g200",  linewidth = 1)
plot(g500, color=#98f5ff, title="g500",  linewidth = 1)
plot(pivot, color=color.orange, title="PP",  linewidth = 3)
plot(r5, color=#008080, title="R5",  linewidth = 2)
plot(r4, color=#9acd32, title="R4",  linewidth = 2)
plot(r3, color=#6b8e23, title="R3",  linewidth = 2)
plot(r2, color=#006400, title="R2",  linewidth = 2)
plot(r1, color=#00ff00, title="R1",  linewidth = 2)
plot(s1, color=#ff3030, title="S1",  linewidth = 2)
plot(s2, color=#b22222, title="S2",  linewidth = 1)
plot(s3, color=#8b2323, title="S3",  linewidth = 1)
plot(s4, color=#8b0000, title="S4",  linewidth = 1)
plot(s5, color=#8b0a50, title="S5",  linewidth = 1)


Daha önce de söylediğim gibi, orijinalde bir strateji koduydu bu.
Norrmal kullanım için bug sayılabilecek bir ayrıntıyı unutmuşum.
Aşağıdaki satıları şu şekilde değiştirmenizi öneririm.
Değilse 1 bar geriden geliyor ortalamalar:

Kod:
g20 = security(syminfo.tickerid,reso, ema(close, 20))g50 = security(syminfo.tickerid,reso, ema(close, 50))
g100 = security(syminfo.tickerid,reso, ema(close, 100))
g200 = security(syminfo.tickerid,reso, ema(close, 200))
g500 = security(syminfo.tickerid,reso, ema(close, 500))