Harigami
ログイン
pk-hangjing タイトルなし
No License Python
コピー
//@version=3
study('Moving Average 4Line', overlay=true)
emaOrSma = input(title="EMA or SMA?", defval="EMA", options=["EMA", "SMA"])
maPeriodFast_1 = input(title="MA Period Fast 1", type=integer, defval=25, minval=1, maxval=10000)
maPeriodFast_2 = input(title="MA Period Fast 2", type=integer, defval=75, minval=1, maxval=10000)
maPeriodSlow_1 = input(title="MA Period Slow 1", type=integer, defval=100, minval=1, maxval=10000)
maPeriodSlow_2 = input(title="MA Period Slow 2", type=integer, defval=200, minval=1, maxval=10000)
showPerfectOrder = input(title="Show Perfect Order?", type=bool, defval=true)
fast_1 = emaOrSma == "EMA" ? ema(close, maPeriodFast_1) : sma(close, maPeriodFast_1)
fast_2 = emaOrSma == "EMA" ? ema(close, maPeriodFast_2) : sma(close, maPeriodFast_2)
slow_1 = emaOrSma == "EMA" ? ema(close, maPeriodSlow_1) : sma(close, maPeriodSlow_1)
slow_2 = emaOrSma == "EMA" ? ema(close, maPeriodSlow_2) : sma(close, maPeriodSlow_2)
perfectOrderByUpTrend = fast_1[1] > fast_2[1] and fast_2[1] > slow_1[1] and slow_1[1] > slow_2[1] ? true : false
perfectOrderByDownTrend = fast_1[1] < fast_2[1] and fast_2[1] < slow_1[1] and slow_1[1] < slow_2[1] ? true : false
plot(fast_1, color=orange)
plot(fast_2, color=red)
plot(slow_1, color=blue)
plot(slow_2, color=green)
bgcolor(perfectOrderByUpTrend and showPerfectOrder ? green : white, transp=90, offset=-1)
bgcolor(perfectOrderByDownTrend and showPerfectOrder ? orange : white, transp=90, offset=-1)
//@version=3
study('Moving Average 4Line', overlay=true)
emaOrSma = input(title="EMA or SMA?", defval="EMA", options=["EMA", "SMA"])
maPeriodFast_1 = input(title="MA Period Fast 1", type=integer, defval=25, minval=1, maxval=10000)
maPeriodFast_2 = input(title="MA Period Fast 2", type=integer, defval=75, minval=1, maxval=10000)
maPeriodSlow_1 = input(title="MA Period Slow 1", type=integer, defval=100, minval=1, maxval=10000)
maPeriodSlow_2 = input(title="MA Period Slow 2", type=integer, defval=200, minval=1, maxval=10000)
showPerfectOrder = input(title="Show Perfect Order?", type=bool, defval=true)
fast_1 = emaOrSma == "EMA" ? ema(close, maPeriodFast_1) : sma(close, maPeriodFast_1)
fast_2 = emaOrSma == "EMA" ? ema(close, maPeriodFast_2) : sma(close, maPeriodFast_2)
slow_1 = emaOrSma == "EMA" ? ema(close, maPeriodSlow_1) : sma(close, maPeriodSlow_1)
slow_2 = emaOrSma == "EMA" ? ema(close, maPeriodSlow_2) : sma(close, maPeriodSlow_2)
perfectOrderByUpTrend = fast_1[1] > fast_2[1] and fast_2[1] > slow_1[1] and slow_1[1] > slow_2[1] ? true : false
perfectOrderByDownTrend = fast_1[1] < fast_2[1] and fast_2[1] < slow_1[1] and slow_1[1] < slow_2[1] ? true : false
plot(fast_1, color=orange)
plot(fast_2, color=red)
plot(slow_1, color=blue)
plot(slow_2, color=green)
bgcolor(perfectOrderByUpTrend and showPerfectOrder ? green : white, transp=90, offset=-1)
bgcolor(perfectOrderByDownTrend and showPerfectOrder ? orange : white, transp=90, offset=-1)
コンソール
現在、コメントはありません。
最初のコメンターになりませんか?