RicardoSantos

[RS]TEST PredictiveMA

simple yet efficient predictive algorithm applied to moving averages
오픈 소스 스크립트

이 스크립트의 오써는 참된 트레이딩뷰의 스피릿으로 이 스크립트를 오픈소스로 퍼블리쉬하여 트레이더들로 하여금 이해 및 검증할 수 있도록 하였습니다. 오써를 응원합니다! 스크립트를 무료로 쓸 수 있지만, 다른 퍼블리케이션에서 이 코드를 재사용하는 것은 하우스룰을 따릅니다. 님은 즐겨찾기로 이 스크립트를 차트에서 쓸 수 있습니다.

면책사항

이 정보와 게시물은 TradingView에서 제공하거나 보증하는 금융, 투자, 거래 또는 기타 유형의 조언이나 권고 사항을 의미하거나 구성하지 않습니다. 자세한 내용은 이용 약관을 참고하세요.

차트에 이 스크립트를 사용하시겠습니까?
study("[RS]PMA", overlay=true)
useDEMA = input(true)

src = input("close")
source = src == "close" ? close : 
        src == "open" ? open :
        src == "high" ? high : 
        src == "low" ? low : 
        src == "ohlc4" ? ohlc4 : 
        src == "hlc3" ? hlc3 : 
        src == "hl2" ? hl2 : close

length1 = input(4)
length2 = input(12)
length3 = input(24)
length4 = input(48)
length5 = input(72)
length6 = input(120)
length7 = input(240)
length8 = input(360)
length9 = input(576)

term1 = ema(ema((sum(source, length1)/length1) + change(source, length1), length1), useDEMA ? length1 : 1)
term2 = ema(ema((sum(source, length2)/length2) + change(source, length2), length2), useDEMA ? length2 : 1)
term3 = ema(ema((sum(source, length3)/length3) + change(source, length3), length3), useDEMA ? length3 : 1)
term4 = ema(ema((sum(source, length4)/length4) + change(source, length4), length4), useDEMA ? length4 : 1)
term5 = ema(ema((sum(source, length5)/length5) + change(source, length5), length5), useDEMA ? length5 : 1)
term6 = ema(ema((sum(source, length6)/length6) + change(source, length6), length6), useDEMA ? length6 : 1)
term7 = ema(ema((sum(source, length7)/length7) + change(source, length7), length7), useDEMA ? length7 : 1)
term8 = ema(ema((sum(source, length8)/length8) + change(source, length8), length8), useDEMA ? length8 : 1)
term9 = ema(ema((sum(source, length9)/length9) + change(source, length9), length9), useDEMA ? length9 : 1)

colorf(pt0, pt1) => pt0 >= pt1 ? teal : navy
offsetf(v) => 1+round(v/2)

p1 = plot(term1, color=colorf(term1, term2), offset=offsetf(length1), linewidth=1)
p2 = plot(term2, color=colorf(term2, term3), offset=offsetf(length2), linewidth=2)
p3 = plot(term3, color=colorf(term3, term4), offset=offsetf(length3), linewidth=3)
p4 = plot(term4, color=colorf(term4, term5), offset=offsetf(length4), linewidth=4)
p5 = plot(term5, color=colorf(term5, term6), offset=offsetf(length5), linewidth=5)
p6 = plot(term6, color=colorf(term6, term7), offset=offsetf(length6), linewidth=6)
p7 = plot(term7, color=colorf(term7, term8), offset=offsetf(length7), linewidth=7)
p8 = plot(term8, color=colorf(term8, term9), offset=offsetf(length8), linewidth=8)
p9 = plot(term9, color=colorf(term9, term1), offset=offsetf(length9), linewidth=9)