커뮤니티

안녕하세요

프로필 이미지
카탈레나
2020-05-15 10:00:23
1476
글번호 138895
답변완료
prd = input(defval = 2, title="Pivot Point Period", minval = 1, maxval = 50) Factor=input(defval = 3, title = "ATR Factor", minval = 1, step = 0.1) Pd=input(defval = 10, title = "ATR Period", minval=1) showpivot = input(defval = true, title="Show Pivot Points") showcl = input(defval = true, title="Show PP Center Line") showsr = input(defval = true, title="Show Support/Resistance") float ph = na float pl = na ph := pivothigh(prd, prd) pl := pivotlow(prd, prd) plotshape(ph and showpivot, text="H", style=shape.labeldown, color=na, textcolor=color.red, location=location.abovebar, transp=0, offset = -prd) plotshape(pl and showpivot, text="L", style=shape.labeldown, color=na, textcolor=color.lime, location=location.belowbar, transp=0, offset = -prd) float center = na center := center[1] float lastpp = ph ? ph : pl ? pl : na if lastpp if na(center) center := lastpp else center := (center * 2 + lastpp) / 3 Up = center - (Factor * atr(Pd)) Dn = center + (Factor * atr(Pd)) float TUp = na float TDown = na Trend = 0 TUp := close[1] > TUp[1] ? max(Up, TUp[1]) : Up TDown := close[1] < TDown[1] ? min(Dn, TDown[1]) : Dn Trend := close > TDown[1] ? 1: close < TUp[1]? -1: nz(Trend[1], 1) Trailingsl = Trend == 1 ? TUp : TDown linecolor = Trend == 1 and nz(Trend[1]) == 1 ? color.lime : Trend == -1 and nz(Trend[1]) == -1 ? color.red : na plot(Trailingsl, color = linecolor , linewidth = 2, title = "PP SuperTrend") plot(showcl ? center : na, color = showcl ? center < hl2 ? color.blue : color.red : na, transp = 0) float resistance = na float support = na support := pl ? pl : support[1] resistance := ph ? ph : resistance[1] plot(showsr and support ? support : na, color = showsr and support ? color.lime : na, style = plot.style_circles, offset = -prd) plot(showsr and resistance ? resistance : na, color = showsr and resistance ? color.red : na, style = plot.style_circles, offset = -prd) 변환 문의드려도 될까요 감사합니다.
지표
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2020-05-15 13:13:34

안녕하세요 예스스탁입니다. 올려주신 수식은 내용을 정획히 파악할 수 없는 부분들이 있어 변환을 해드리기 어렵습니다. 도움을 드리지 못해 죄송합니다. 즐거운 하루되세요 > 카탈레나 님이 쓴 글입니다. > 제목 : 안녕하세요 > prd = input(defval = 2, title="Pivot Point Period", minval = 1, maxval = 50) Factor=input(defval = 3, title = "ATR Factor", minval = 1, step = 0.1) Pd=input(defval = 10, title = "ATR Period", minval=1) showpivot = input(defval = true, title="Show Pivot Points") showcl = input(defval = true, title="Show PP Center Line") showsr = input(defval = true, title="Show Support/Resistance") float ph = na float pl = na ph := pivothigh(prd, prd) pl := pivotlow(prd, prd) plotshape(ph and showpivot, text="H", style=shape.labeldown, color=na, textcolor=color.red, location=location.abovebar, transp=0, offset = -prd) plotshape(pl and showpivot, text="L", style=shape.labeldown, color=na, textcolor=color.lime, location=location.belowbar, transp=0, offset = -prd) float center = na center := center[1] float lastpp = ph ? ph : pl ? pl : na if lastpp if na(center) center := lastpp else center := (center * 2 + lastpp) / 3 Up = center - (Factor * atr(Pd)) Dn = center + (Factor * atr(Pd)) float TUp = na float TDown = na Trend = 0 TUp := close[1] > TUp[1] ? max(Up, TUp[1]) : Up TDown := close[1] < TDown[1] ? min(Dn, TDown[1]) : Dn Trend := close > TDown[1] ? 1: close < TUp[1]? -1: nz(Trend[1], 1) Trailingsl = Trend == 1 ? TUp : TDown linecolor = Trend == 1 and nz(Trend[1]) == 1 ? color.lime : Trend == -1 and nz(Trend[1]) == -1 ? color.red : na plot(Trailingsl, color = linecolor , linewidth = 2, title = "PP SuperTrend") plot(showcl ? center : na, color = showcl ? center < hl2 ? color.blue : color.red : na, transp = 0) float resistance = na float support = na support := pl ? pl : support[1] resistance := ph ? ph : resistance[1] plot(showsr and support ? support : na, color = showsr and support ? color.lime : na, style = plot.style_circles, offset = -prd) plot(showsr and resistance ? resistance : na, color = showsr and resistance ? color.red : na, style = plot.style_circles, offset = -prd) 변환 문의드려도 될까요 감사합니다.