Harigami
ログイン
ガンマ@駆け出しエンジニア MTF-RSI-MACROSS
No License Python
コピー
//@version=4
study("MTF-RSI-MACROSS", overlay=false)
src = close
RMA = input(20, minval=1, title="MA期間")
RMA2 = input(20, minval=1, title="MA期間2")
RMA3 = input(20, minval=1, title="MA期間3")
len = input(title='時間軸', type=input.resolution, defval="5")
len2 = input(title='時間軸2', type=input.resolution, defval="15")
len3 = input(title='時間軸3', type=input.resolution, defval="60")
res = input(defval=true, title="チェック=MTF表示")
res3 = input(defval=true, title="チェック=MTF表示2")
res5 = input(defval=true, title="チェック=MTF表示3")
res2 = res ? len : timeframe.period
res4 = res3 ? len2 : timeframe.period
res6 = res5 ? len3 : timeframe.period
length = input(14, minval=1, title="RSI期間")
length2 = input(14, minval=1, title="RSI期間2")
length3 = input(14, minval=1, title="RSI期間3")
price = close
rsi=rsi(price, length)
vrsi = security(syminfo.tickerid, res2, rsi)
smaRSI = sma(vrsi, RMA)
emaRSI = ema(vrsi, RMA)
vrsi2 = security(syminfo.tickerid, res4, rsi(price, length2))
smaRSI2 = sma(vrsi2, RMA2)
emaRSI2 = ema(vrsi2, RMA2)
vrsi3 = security(syminfo.tickerid, res6, rsi(price, length3))
smaRSI3 = sma(vrsi3, RMA3)
emaRSI3 = ema(vrsi3, RMA3)
sig1 = crossover(emaRSI , smaRSI)
sig2 = crossover(emaRSI2 , smaRSI2)
sig3 = crossover(emaRSI3 , smaRSI3)
sig4 = crossunder(emaRSI , smaRSI)
sig5 = crossunder(emaRSI2 , smaRSI2)
sig6 = crossunder(emaRSI3 , smaRSI3)
sig7 = emaRSI > smaRSI
sig8 = emaRSI2 > smaRSI2
sig9 = emaRSI3  > smaRSI3
p1 = plot(4, color=color.black, 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.lime : na , title="短期GC", transp=20)
fill(p2, p3, color=sig2 ? color.lime : na, title="中期GC", transp=20)
fill(p3, p4, color=sig3 ? color.lime : na, title="長期GC", transp=20)
fill(p1, p2, color=sig4 ? color.red : na , title="短期DC", transp=20)
fill(p2, p3, color=sig5 ? color.red : na, title="中期DC", transp=20)
fill(p3, p4, color=sig6 ? color.red : na, title="長期DC", transp=20)
fill(p1, p2, color=sig7 ? color.lime : color.red , title="短期BG", transp=80)
fill(p2, p3, color=sig8 ? color.lime : color.red, title="中期BG", transp=80)
fill(p3, p4, color=sig9 ? color.lime : color.red, title="si長期BG", transp=80)
alertcondition(sig1, title="短LONG", message="短期L")
alertcondition(sig4, title="短SHORT", message="短期S")
alertcondition(sig2, title="中LONG", message="中期L")
alertcondition(sig5, title="中SHORT", message="中期S")
alertcondition(sig3, title="長LONG", message="長期L")
alertcondition(sig6, title="長SHORT", message="長期S")
//@version=4
study("MTF-RSI-MACROSS", overlay=false)
src = close
RMA = input(20, minval=1, title="MA期間")
RMA2 = input(20, minval=1, title="MA期間2")
RMA3 = input(20, minval=1, title="MA期間3")
len = input(title='時間軸', type=input.resolution, defval="5")
len2 = input(title='時間軸2', type=input.resolution, defval="15")
len3 = input(title='時間軸3', type=input.resolution, defval="60")
res = input(defval=true, title="チェック=MTF表示")
res3 = input(defval=true, title="チェック=MTF表示2")
res5 = input(defval=true, title="チェック=MTF表示3")
res2 = res ? len : timeframe.period
res4 = res3 ? len2 : timeframe.period
res6 = res5 ? len3 : timeframe.period
length = input(14, minval=1, title="RSI期間")
length2 = input(14, minval=1, title="RSI期間2")
length3 = input(14, minval=1, title="RSI期間3")
price = close
rsi=rsi(price, length)
vrsi = security(syminfo.tickerid, res2, rsi)
smaRSI = sma(vrsi, RMA)
emaRSI = ema(vrsi, RMA)
vrsi2 = security(syminfo.tickerid, res4, rsi(price, length2))
smaRSI2 = sma(vrsi2, RMA2)
emaRSI2 = ema(vrsi2, RMA2)
vrsi3 = security(syminfo.tickerid, res6, rsi(price, length3))
smaRSI3 = sma(vrsi3, RMA3)
emaRSI3 = ema(vrsi3, RMA3)
sig1 = crossover(emaRSI , smaRSI)
sig2 = crossover(emaRSI2 , smaRSI2)
sig3 = crossover(emaRSI3 , smaRSI3)
sig4 = crossunder(emaRSI , smaRSI)
sig5 = crossunder(emaRSI2 , smaRSI2)
sig6 = crossunder(emaRSI3 , smaRSI3)
sig7 = emaRSI > smaRSI
sig8 = emaRSI2 > smaRSI2
sig9 = emaRSI3  > smaRSI3
p1 = plot(4, color=color.black, 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.lime : na , title="短期GC", transp=20)
fill(p2, p3, color=sig2 ? color.lime : na, title="中期GC", transp=20)
fill(p3, p4, color=sig3 ? color.lime : na, title="長期GC", transp=20)
fill(p1, p2, color=sig4 ? color.red : na , title="短期DC", transp=20)
fill(p2, p3, color=sig5 ? color.red : na, title="中期DC", transp=20)
fill(p3, p4, color=sig6 ? color.red : na, title="長期DC", transp=20)
fill(p1, p2, color=sig7 ? color.lime : color.red , title="短期BG", transp=80)
fill(p2, p3, color=sig8 ? color.lime : color.red, title="中期BG", transp=80)
fill(p3, p4, color=sig9 ? color.lime : color.red, title="si長期BG", transp=80)
alertcondition(sig1, title="短LONG", message="短期L")
alertcondition(sig4, title="短SHORT", message="短期S")
alertcondition(sig2, title="中LONG", message="中期L")
alertcondition(sig5, title="中SHORT", message="中期S")
alertcondition(sig3, title="長LONG", message="長期L")
alertcondition(sig6, title="長SHORT", message="長期S")
コンソール
現在、コメントはありません。
最初のコメンターになりませんか?