Harigami
ログイン
pk-hangjing タイトルなし
No License Python
コピー
//@version=4

study(title="AWABI改 MTF")

source = hlc3
length = input(26, minval=1)
Rlen = input(title='時間軸', type=input.resolution, defval="15")
R2len = input(title='時間軸', type=input.resolution, defval="60")
R3len = input(title='時間軸', type=input.resolution, defval="240")
res = input(defval=true, title="チェック=MTF表示")
res2 = res ? Rlen : timeframe.period
res5 = res ? R2len : timeframe.period
res6 = res ? R3len : timeframe.period
multi = input(2.0, minval=0.001, title="シグマ", maxval=50)
len = input(14, minval=1, title="BBMAFAST")


//RSI
vrsi = security(syminfo.tickerid, res2, rsi(source, length))
// BB of RSI
res4 = res ? Rlen : timeframe.period
dev = security(syminfo.tickerid, res4, multi * stdev(vrsi, length))
basis = security(syminfo.tickerid, res4, wma(vrsi, length))
upper = basis + dev
lower = basis - dev
br = (vrsi - lower) / (upper - lower)
//RSI2
vrsi2 = security(syminfo.tickerid, res5, rsi(source, length))
// BB of RSI
res7 = res ? R2len : timeframe.period
dev2 = security(syminfo.tickerid, res7, multi * stdev(vrsi2, length))
basis2 = security(syminfo.tickerid, res7, wma(vrsi2, length))
upper2 = basis2 + dev2
lower2 = basis2 - dev2
br2 = (vrsi2 - lower2) / (upper2 - lower2)
//RSI3
vrsi3 = security(syminfo.tickerid, res6, rsi(source, length))
// BB of RSI
res8 = res ? R3len : timeframe.period
dev3 = security(syminfo.tickerid, res8, multi * stdev(vrsi3, length))
basis3 = security(syminfo.tickerid, res8, wma(vrsi3, length))
upper3 = basis3 + dev3
lower3 = basis3 - dev3
br3 = (vrsi3 - lower3) / (upper3 - lower3)


//RSI

//MA OF RSI
er = wma(br, len)
er2 = wma(br2, len)
er3 = wma(br3, len)
//COLOR

sig1 = br > er
sig2 = br2 > er2
sig3 = br3 > er3


p1 = plot(4, color=color.white, editable=false, trackprice=false)
p2 = plot(3, color=color.black, editable=false, trackprice=false)
p3 = plot(2, color=color.black, editable=false, trackprice=false)
p4 = plot(1, color=color.black, editable=false, trackprice=false)

fill(p1, p2, color=sig1 ? color.green : color.red, title="sig1", transp=20)
fill(p2, p3, color=sig2 ? color.green : color.red, title="sig2", transp=20)
fill(p3, p4, color=sig3 ? color.green : color.red, title="sig3", transp=20)
//@version=4

study(title="AWABI改 MTF")

source = hlc3
length = input(26, minval=1)
Rlen = input(title='時間軸', type=input.resolution, defval="15")
R2len = input(title='時間軸', type=input.resolution, defval="60")
R3len = input(title='時間軸', type=input.resolution, defval="240")
res = input(defval=true, title="チェック=MTF表示")
res2 = res ? Rlen : timeframe.period
res5 = res ? R2len : timeframe.period
res6 = res ? R3len : timeframe.period
multi = input(2.0, minval=0.001, title="シグマ", maxval=50)
len = input(14, minval=1, title="BBMAFAST")


//RSI
vrsi = security(syminfo.tickerid, res2, rsi(source, length))
// BB of RSI
res4 = res ? Rlen : timeframe.period
dev = security(syminfo.tickerid, res4, multi * stdev(vrsi, length))
basis = security(syminfo.tickerid, res4, wma(vrsi, length))
upper = basis + dev
lower = basis - dev
br = (vrsi - lower) / (upper - lower)
//RSI2
vrsi2 = security(syminfo.tickerid, res5, rsi(source, length))
// BB of RSI
res7 = res ? R2len : timeframe.period
dev2 = security(syminfo.tickerid, res7, multi * stdev(vrsi2, length))
basis2 = security(syminfo.tickerid, res7, wma(vrsi2, length))
upper2 = basis2 + dev2
lower2 = basis2 - dev2
br2 = (vrsi2 - lower2) / (upper2 - lower2)
//RSI3
vrsi3 = security(syminfo.tickerid, res6, rsi(source, length))
// BB of RSI
res8 = res ? R3len : timeframe.period
dev3 = security(syminfo.tickerid, res8, multi * stdev(vrsi3, length))
basis3 = security(syminfo.tickerid, res8, wma(vrsi3, length))
upper3 = basis3 + dev3
lower3 = basis3 - dev3
br3 = (vrsi3 - lower3) / (upper3 - lower3)


//RSI

//MA OF RSI
er = wma(br, len)
er2 = wma(br2, len)
er3 = wma(br3, len)
//COLOR

sig1 = br > er
sig2 = br2 > er2
sig3 = br3 > er3


p1 = plot(4, color=color.white, editable=false, trackprice=false)
p2 = plot(3, color=color.black, editable=false, trackprice=false)
p3 = plot(2, color=color.black, editable=false, trackprice=false)
p4 = plot(1, color=color.black, editable=false, trackprice=false)

fill(p1, p2, color=sig1 ? color.green : color.red, title="sig1", transp=20)
fill(p2, p3, color=sig2 ? color.green : color.red, title="sig2", transp=20)
fill(p3, p4, color=sig3 ? color.green : color.red, title="sig3", transp=20)
コンソール
現在、コメントはありません。
最初のコメンターになりませんか?