답변완료
문의드립니다.
아래수식을 예스로 부탁드립니다.
len = input(10, "SSL Period") //Period of SMA
sma_high = sma(high,len) //SMA of HIGH with period "len"
sma_low = sma(low,len) //SMA of LOW with period "len"
hlv = 0 //Init the "High-Low Value"
offset = input(1,"SSL Offset") //Option to offset MA values back
//if close is above MA of high, green line on top
//if close is below MA of low, green line on bottom
hlv := close > sma_high[1] ? 1 : close < sma_low[1] ? -1 : hlv[1]
ssld = hlv == -1 ? sma_high[offset] : sma_low[offset]
sslu = hlv == -1 ? sma_low[offset] : sma_high[offset]
//Plotting
plot(ssld,"Down",color.red,2)
plot(sslu,"Up",color.green,2)
2020-07-08
1499
글번호 140479
지표