커뮤니티

문의드립니다.

프로필 이미지
as8282
2020-07-08 23:06:05
1500
글번호 140479
답변완료
아래수식을 예스로 부탁드립니다. 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)
지표
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2020-07-09 13:05:09

안녕하세요 예스스탁입니다. input : len(10),offset(1); var : sma_high(0),sma_low(0),hlv(0),ssld(0),sslu(0); sma_high = ma(high,len); sma_low = ma(low,len); hlv = iff(close > sma_high[1] , 1 , iff(close < sma_low[1] , -1 , hlv[1])); ssld = iff(hlv == -1 , sma_high[offset] , sma_low[offset]); sslu = iff(hlv == -1 , sma_low[offset] , sma_high[offset]); plot1(ssld,"Down",red); plot2(sslu,"Up",green); 즐거운 하루되세요 > as8282 님이 쓴 글입니다. > 제목 : 문의드립니다. > 아래수식을 예스로 부탁드립니다. 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)