Harigami
ログイン
anonymous タイトルなし
No License Python
コピー
//@version=3
study("MTF 8 SMA/EMA", overlay=true)

// SMA or EMA
SEswitch = input(title="on:EMA off:SMA", type=bool, defval=true)

//Get EMA Values
maA = input(title='MA1 期間', type=integer, minval=1, step=1, defval=10)
maB = input(title='MA2 期間', type=integer, minval=1, step=1, defval=75)
maC = input(title='MA3 期間', type=integer, minval=1, step=1, defval=10)
maD = input(title='MA4 期間', type=integer, minval=1, step=1, defval=20)
maE = input(title='MA5 期間', type=integer, minval=1, step=1, defval=75)
maF = input(title='MA6 期間', type=integer, minval=1, step=1, defval=10)
maG = input(title='MA7 期間', type=integer, minval=1, step=1, defval=75)
maH = input(title='MA8 期間', type=integer, minval=1, step=1, defval=10)

//Set resolutions
resA = input(title='MA1 時間足', type=resolution, defval="15")
resB = input(title='MA2 時間足', type=resolution, defval="15")
resC = input(title='MA3 時間足', type=resolution, defval="60")
resD = input(title='MA4 時間足', type=resolution, defval="60")
resE = input(title='MA5 時間足', type=resolution, defval="60")
resF = input(title='MA6 時間足', type=resolution, defval="240")
resG = input(title='MA7 時間足', type=resolution, defval="240")
resH = input(title='MA8 時間足', type=resolution, defval="1440")

//Set switches
emaAswitch = input(title="MA1 On/Off", type=bool, defval=true)
emaBswitch = input(title="MA2 On/Off", type=bool, defval=true)
emaCswitch = input(title="MA3 On/Off", type=bool, defval=true)
emaDswitch = input(title="MA4 On/Off", type=bool, defval=true)
emaEswitch = input(title="MA5 On/Off", type=bool, defval=true)
emaFswitch = input(title="MA6 On/Off", type=bool, defval=true)
emaGswitch = input(title="MA7 On/Off", type=bool, defval=true)
emaHswitch = input(title="MA8 On/Off", type=bool, defval=true)

//get data
dataA = security(tickerid, resA, SEswitch ? ema(close, maA) : sma(close, maA))
dataB = security(tickerid, resB, SEswitch ? ema(close, maB) : sma(close, maB))
dataC = security(tickerid, resC, SEswitch ? ema(close, maC) : sma(close, maC))
dataD = security(tickerid, resD, SEswitch ? ema(close, maD) : sma(close, maD))
dataE = security(tickerid, resE, SEswitch ? ema(close, maE) : sma(close, maE))
dataF = security(tickerid, resF, SEswitch ? ema(close, maF) : sma(close, maF))
dataG = security(tickerid, resG, SEswitch ? ema(close, maG) : sma(close, maG))
dataH = security(tickerid, resH, SEswitch ? ema(close, maH) : sma(close, maH))


//Plotting
plot(emaAswitch ? dataA : na, color=lime, linewidth=3)
plot(emaBswitch ? dataB : na, color=aqua, linewidth=3)
plot(emaCswitch ? dataC : na, color=orange, linewidth=3)
plot(emaDswitch ? dataD : na, color=yellow, linewidth=3)
plot(emaEswitch ? dataE : na, color=olive, linewidth=3)
plot(emaFswitch ? dataF : na, color=fuchsia, linewidth=3)
plot(emaGswitch ? dataG : na, color=maroon, linewidth=3)
plot(emaHswitch ? dataH : na, color=white, linewidth=4)
//@version=3
study("MTF 8 SMA/EMA", overlay=true)

// SMA or EMA
SEswitch = input(title="on:EMA off:SMA", type=bool, defval=true)

//Get EMA Values
maA = input(title='MA1 期間', type=integer, minval=1, step=1, defval=10)
maB = input(title='MA2 期間', type=integer, minval=1, step=1, defval=75)
maC = input(title='MA3 期間', type=integer, minval=1, step=1, defval=10)
maD = input(title='MA4 期間', type=integer, minval=1, step=1, defval=20)
maE = input(title='MA5 期間', type=integer, minval=1, step=1, defval=75)
maF = input(title='MA6 期間', type=integer, minval=1, step=1, defval=10)
maG = input(title='MA7 期間', type=integer, minval=1, step=1, defval=75)
maH = input(title='MA8 期間', type=integer, minval=1, step=1, defval=10)

//Set resolutions
resA = input(title='MA1 時間足', type=resolution, defval="15")
resB = input(title='MA2 時間足', type=resolution, defval="15")
resC = input(title='MA3 時間足', type=resolution, defval="60")
resD = input(title='MA4 時間足', type=resolution, defval="60")
resE = input(title='MA5 時間足', type=resolution, defval="60")
resF = input(title='MA6 時間足', type=resolution, defval="240")
resG = input(title='MA7 時間足', type=resolution, defval="240")
resH = input(title='MA8 時間足', type=resolution, defval="1440")

//Set switches
emaAswitch = input(title="MA1 On/Off", type=bool, defval=true)
emaBswitch = input(title="MA2 On/Off", type=bool, defval=true)
emaCswitch = input(title="MA3 On/Off", type=bool, defval=true)
emaDswitch = input(title="MA4 On/Off", type=bool, defval=true)
emaEswitch = input(title="MA5 On/Off", type=bool, defval=true)
emaFswitch = input(title="MA6 On/Off", type=bool, defval=true)
emaGswitch = input(title="MA7 On/Off", type=bool, defval=true)
emaHswitch = input(title="MA8 On/Off", type=bool, defval=true)

//get data
dataA = security(tickerid, resA, SEswitch ? ema(close, maA) : sma(close, maA))
dataB = security(tickerid, resB, SEswitch ? ema(close, maB) : sma(close, maB))
dataC = security(tickerid, resC, SEswitch ? ema(close, maC) : sma(close, maC))
dataD = security(tickerid, resD, SEswitch ? ema(close, maD) : sma(close, maD))
dataE = security(tickerid, resE, SEswitch ? ema(close, maE) : sma(close, maE))
dataF = security(tickerid, resF, SEswitch ? ema(close, maF) : sma(close, maF))
dataG = security(tickerid, resG, SEswitch ? ema(close, maG) : sma(close, maG))
dataH = security(tickerid, resH, SEswitch ? ema(close, maH) : sma(close, maH))


//Plotting
plot(emaAswitch ? dataA : na, color=lime, linewidth=3)
plot(emaBswitch ? dataB : na, color=aqua, linewidth=3)
plot(emaCswitch ? dataC : na, color=orange, linewidth=3)
plot(emaDswitch ? dataD : na, color=yellow, linewidth=3)
plot(emaEswitch ? dataE : na, color=olive, linewidth=3)
plot(emaFswitch ? dataF : na, color=fuchsia, linewidth=3)
plot(emaGswitch ? dataG : na, color=maroon, linewidth=3)
plot(emaHswitch ? dataH : na, color=white, linewidth=4)
コンソール
現在、コメントはありません。
最初のコメンターになりませんか?