커뮤니티

변환 부탁드립니다.

프로필 이미지
다올
2025-08-04 18:48:57
205
글번호 192965
답변완료
트레이딩 뷰 지표입니다. 변환 부탁 드립니다. //@version=6 indicator("Zone Shift [ChartPrime]", max_lines_count = 500, overlay = true, max_labels_count = 500) // --------------------------------------------------------------------------------------------------------------------} // ?? ???????? ???????????? // --------------------------------------------------------------------------------------------------------------------{ int length = input.int(100, "Length 60-200", minval = 60, maxval = 200) color upColor = input.color(color.lime, "", inline = "colors") color dnColor = input.color(color.blue, "", inline = "colors") // --------------------------------------------------------------------------------------------------------------------} // ?? ?????????????????? ???????????????????????? // --------------------------------------------------------------------------------------------------------------------{ var trend = false var trendStart = float(na) var lastRetest = bar_index float ema = ta.ema(close, length) float hma = ta.hma(close, length-40) float dist = ta.sma(high-low, 200) float mid = math.avg(ema, hma) float top = mid + dist float bot = mid - dist if barstate.isconfirmed if low > top and low[1] < top[1] and not trend trend := true trendStart := low if high < bot and high[1] > bot[1] and trend trend := false trendStart := high trend_col = trend ? upColor : dnColor // Retest TrendStart Level if barstate.isconfirmed if (close > trendStart and close[1] < trendStart[1] or low > trendStart and low[1] < trendStart[1] ) and trend and bar_index - lastRetest > 5 lastRetest := bar_index label.new(bar_index, low, "?", color = color.new(color.black, 100), style = label.style_label_up, textcolor = trend_col) if (close[1] > trendStart and close < trendStart[1] or high[1] > trendStart and high < trendStart[1]) and not trend and bar_index - lastRetest > 5 lastRetest := bar_index label.new(bar_index, high, "?", color = color.new(color.black, 100), style = label.style_label_down, textcolor = trend_col) // --------------------------------------------------------------------------------------------------------------------} // ?? ?????????????????????????? // --------------------------------------------------------------------------------------------------------------------{ plot(mid, "Middle", color = bar_index % 2 == 0 ? chart.fg_color : na) plot(top, "Top", color = chart.fg_color ) plot(bot, "Bottom", color = chart.fg_color ) barcolor(trend_col) plotcandle(open, high, low, close, title='CandleColor', color = trend_col, wickcolor=trend_col, bordercolor = trend_col, force_overlay = true) plot(trendStart != trendStart[1] ? na : trendStart, "Trend Initiation Level", style = plot.style_linebr, color = bar_index % 2 == 0 ? chart.fg_color : na) // --------------------------------------------------------------------------------------------------------------------}
지표
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2025-08-05 13:27:24

안녕하세요 예스스탁입니다. input : length(100); input : upColor(lime); input : dnColor(blue); var : trend(false),trendStart(Nan),lastRetest(0); Var : wma1(0), wma2(0), diff(0), sqrtLen(0), result(0); var : Emav(0),Hmav(0),dist(0),mid(0),top(0),bot(0),trend_col(0); emav = ema(close, length); wma1 = WMA(close, (length-40) / 2); wma2 = WMA(close, length-40); diff = 2 * wma1 - wma2; sqrtLen = MaxList(1, SquareRoot(length-49)); hmav = WMA(diff, sqrtLen); dist = ma(high-low, 200); mid = avg(emav, hmav); top = mid + dist; bot = mid - dist; if low > top and low[1] < top[1] and trend == False Then { trend = true; trendStart = low; } if high < bot and high[1] > bot[1] and trend == true Then { trend = false; trendStart = high; } trend_col = iff(trend , upColor , dnColor); var : tx(0); if (close > trendStart and close[1] < trendStart[1] or low > trendStart and low[1] < trendStart[1] ) and trend and index - lastRetest > 5 Then { lastRetest = index; tx = text_new(sdate,stime,low, "▲"); Text_SetStyle(tx,2,0); Text_SetColor(tx,trend_col); } if (close[1] > trendStart and close < trendStart[1] or high[1] > trendStart and high < trendStart[1]) and trend == False and index - lastRetest > 5 Then { lastRetest = index; tx = text_new(sdate,stime,High, "▼"); Text_SetStyle(tx,2,0); Text_SetColor(tx,trend_col); } plot1(mid, "Middle"); plot2(top, "Top"); plot3(bot, "Bottom"); if trendStart == trendStart[1] Then plot4(trendStart, "Trend Initiation Level"); Else NoPlot(4); 즐거운 하루되세요 > 다올 님이 쓴 글입니다. > 제목 : 변환 부탁드립니다. > 트레이딩 뷰 지표입니다. 변환 부탁 드립니다. //@version=6 indicator("Zone Shift [ChartPrime]", max_lines_count = 500, overlay = true, max_labels_count = 500) // --------------------------------------------------------------------------------------------------------------------} // ?? ???????? ???????????? // --------------------------------------------------------------------------------------------------------------------{ int length = input.int(100, "Length 60-200", minval = 60, maxval = 200) color upColor = input.color(color.lime, "", inline = "colors") color dnColor = input.color(color.blue, "", inline = "colors") // --------------------------------------------------------------------------------------------------------------------} // ?? ?????????????????? ???????????????????????? // --------------------------------------------------------------------------------------------------------------------{ var trend = false var trendStart = float(na) var lastRetest = bar_index float ema = ta.ema(close, length) float hma = ta.hma(close, length-40) float dist = ta.sma(high-low, 200) float mid = math.avg(ema, hma) float top = mid + dist float bot = mid - dist if barstate.isconfirmed if low > top and low[1] < top[1] and not trend trend := true trendStart := low if high < bot and high[1] > bot[1] and trend trend := false trendStart := high trend_col = trend ? upColor : dnColor // Retest TrendStart Level if barstate.isconfirmed if (close > trendStart and close[1] < trendStart[1] or low > trendStart and low[1] < trendStart[1] ) and trend and bar_index - lastRetest > 5 lastRetest := bar_index label.new(bar_index, low, "?", color = color.new(color.black, 100), style = label.style_label_up, textcolor = trend_col) if (close[1] > trendStart and close < trendStart[1] or high[1] > trendStart and high < trendStart[1]) and not trend and bar_index - lastRetest > 5 lastRetest := bar_index label.new(bar_index, high, "?", color = color.new(color.black, 100), style = label.style_label_down, textcolor = trend_col) // --------------------------------------------------------------------------------------------------------------------} // ?? ?????????????????????????? // --------------------------------------------------------------------------------------------------------------------{ plot(mid, "Middle", color = bar_index % 2 == 0 ? chart.fg_color : na) plot(top, "Top", color = chart.fg_color ) plot(bot, "Bottom", color = chart.fg_color ) barcolor(trend_col) plotcandle(open, high, low, close, title='CandleColor', color = trend_col, wickcolor=trend_col, bordercolor = trend_col, force_overlay = true) plot(trendStart != trendStart[1] ? na : trendStart, "Trend Initiation Level", style = plot.style_linebr, color = bar_index % 2 == 0 ? chart.fg_color : na) // --------------------------------------------------------------------------------------------------------------------}