커뮤니티

수식변환 요청

프로필 이미지
고저중
2025-09-16 10:36:14.0
95
글번호 194045
답변완료
파인 변환요청 드립니다. // This Pine cript™ code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/ // © AlgoAlpha //@version=5 indicator("Trend Strength Signals [AlgoAlpha]", "AlgoAlpha - 𝑻𝒓𝒆𝒏𝒅 𝑺𝒕𝒓𝒆𝒏𝒈𝒕𝒉", true) c = input.bool(true, "Enable Cloud") lenn = input.int(20, "Period") mult = input.float(2.5, "Standard Deviation Multiplier for TP") tc = input.int(25, "Gauge Size", minval = 3) upColor = input.color(#00ffbb, "Up Color") downColor = input.color(#ff1100, "Down Color") // Guage Function t = table.new(position.middle_right, 3, tc+1), printTable(txt, col, row, color, txt1, col1, row1, color1) => table.cell(t, col, row, txt, bgcolor = color), table.cell(t, col1, row1, txt1, bgcolor = color1, text_color = color.white) len = lenn src = close basis = ta.sma(src, lenn) upper = basis + ta.stdev(src, len, true) lower = basis - ta.stdev(src, len, true) upper1 = basis + ta.stdev(src, len, true) * mult lower1 = basis - ta.stdev(src, len, true) * mult var trend = 0 if src > basis and src > upper trend := 1 if src < basis and src < lower trend := -1 pu=plot(upper, "upper Line", color.new(chart.fg_color, 80), display = c ? display.all : display.none) pl=plot(lower, "lower Line", color.new(chart.fg_color, 80), display = c ? display.all : display.none) barcolor(src > upper ? upColor : src < lower ? downColor : chart.fg_color) grad = math.abs(basis-src)/(ta.highest(basis-src, 200))*100 grad1 = math.min(grad,40) grad1 := 100-grad1 xMax = 100 xMin = 0 range_ = xMax - xMin y = 1 - grad / range_ y := y > 100 ? 100 : y < 0 ? 0 : y fill(pu, pl, color.new(chart.fg_color, ta.sma(grad1, 7)), "Trend Fill", display = c ? display.all : display.none) plotshape(ta.crossover(trend, 0), "Bullish Trend", shape.labelup, location.belowbar, upColor, text = "▲", textcolor = chart.fg_color) plotshape(ta.crossunder(trend, 0), "Bearish Trend", shape.labeldown, location.abovebar, downColor, text = "▼", textcolor = chart.fg_color) plotchar(ta.crossover(src, lower1), "Short TP", "X", location.belowbar, upColor, size = size.tiny) plotchar(ta.crossunder(src, upper1), "Long TP", "X", location.abovebar, downColor, size = size.tiny) // Draw Gauge for i = 1 to tc color_ = chart.fg_color color = color.from_gradient(i, 1, tc, src > basis ? upColor : downColor, color_) printTable("", 1, i, color, ">", 1, math.round(y*tc), #ffffff00) ///////Alerts alertcondition(ta.cross(trend, 0), "Universal Trend Shift (when trend changes direction)") alertcondition(ta.crossover(trend, 0), "Bullish Trend") alertcondition(ta.crossunder(trend, 0), "Bearish Trend") alertcondition(ta.crossover(src, lower1) or ta.crossunder(src, upper1), "Universal TP (when any TP signal triggers)") alertcondition(ta.crossover(src, lower1), "Short TP") alertcondition(ta.crossunder(src, upper1), "Long TP")
지표
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2025-09-16 14:12:00.0

안녕하세요 예스스탁입니다. input : lenn(20); input : mult(2.5); input : tc(25); input : upColor(Lime); input : downColor(Red); // Guage Function #t = table.new(position.middle_right, 3, tc+1), #printTable(txt, col, row, color, txt1, col1, row1, color1) => # table.cell(t, col, row, txt, bgcolor = color), # table.cell(t, col1, row1, txt1, bgcolor = color1, text_color = color.white) var : len(0),src(0),trend(0); var : basis(0),upper(0),lower(0),upper1(0),lower1(0); len = lenn; src = close; basis = ma(src, lenn); upper = basis + std(src, len); lower = basis - std(src, len); upper1 = basis + std(src, len) * mult; lower1 = basis - std(src, len) * mult; if src > basis and src > upper Then trend = 1; if src < basis and src < lower Then trend = -1; plot1(upper, "upper Line",Black); plot2(lower, "lower Line",Black); var : grad(0),grad1(0),xMax(0),xMin(0),Range_(0),y(0),tx(0); grad = abs(basis-src)/(highest(basis-src, 200))*100; grad1 = min(grad,40); grad1 = 100-grad1; xMax = 100; xMin = 0; range_ = xMax - xMin; y = 1 - grad / range_; y = iff(y > 100 , 100 ,IFf(y < 0 , 0 , y)); if CrossUp(trend, 0) Then { tx = Text_New(sDate,sTime,L,"▲"); Text_SetColor(tx,upColor); Text_SetStyle(tx,2,0); } if CrossDown(trend, 0) Then { tx = Text_New(sDate,sTime,H,"▼"); Text_SetColor(tx,downColor); Text_SetStyle(tx,2,1); } if CrossUp(src, lower1)Then { tx = Text_New(sDate,sTime,L,"X"); Text_SetColor(tx,upColor); Text_SetStyle(tx,2,0); } if CrossDown(src, upper1) Then { tx = Text_New(sDate,sTime,H,"X"); Text_SetColor(tx,downColor); Text_SetStyle(tx,2,1); } 즐거운 하루되세요 > 고저중 님이 쓴 글입니다. > 제목 : 수식변환 요청 > 파인 변환요청 드립니다. // This Pine cript™ code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/ // © AlgoAlpha //@version=5 indicator("Trend Strength Signals [AlgoAlpha]", "AlgoAlpha - 𝑻𝒓𝒆𝒏𝒅 𝑺𝒕𝒓𝒆𝒏𝒈𝒕𝒉", true) c = input.bool(true, "Enable Cloud") lenn = input.int(20, "Period") mult = input.float(2.5, "Standard Deviation Multiplier for TP") tc = input.int(25, "Gauge Size", minval = 3) upColor = input.color(#00ffbb, "Up Color") downColor = input.color(#ff1100, "Down Color") // Guage Function t = table.new(position.middle_right, 3, tc+1), printTable(txt, col, row, color, txt1, col1, row1, color1) => table.cell(t, col, row, txt, bgcolor = color), table.cell(t, col1, row1, txt1, bgcolor = color1, text_color = color.white) len = lenn src = close basis = ta.sma(src, lenn) upper = basis + ta.stdev(src, len, true) lower = basis - ta.stdev(src, len, true) upper1 = basis + ta.stdev(src, len, true) * mult lower1 = basis - ta.stdev(src, len, true) * mult var trend = 0 if src > basis and src > upper trend := 1 if src < basis and src < lower trend := -1 pu=plot(upper, "upper Line", color.new(chart.fg_color, 80), display = c ? display.all : display.none) pl=plot(lower, "lower Line", color.new(chart.fg_color, 80), display = c ? display.all : display.none) barcolor(src > upper ? upColor : src < lower ? downColor : chart.fg_color) grad = math.abs(basis-src)/(ta.highest(basis-src, 200))*100 grad1 = math.min(grad,40) grad1 := 100-grad1 xMax = 100 xMin = 0 range_ = xMax - xMin y = 1 - grad / range_ y := y > 100 ? 100 : y < 0 ? 0 : y fill(pu, pl, color.new(chart.fg_color, ta.sma(grad1, 7)), "Trend Fill", display = c ? display.all : display.none) plotshape(ta.crossover(trend, 0), "Bullish Trend", shape.labelup, location.belowbar, upColor, text = "▲", textcolor = chart.fg_color) plotshape(ta.crossunder(trend, 0), "Bearish Trend", shape.labeldown, location.abovebar, downColor, text = "▼", textcolor = chart.fg_color) plotchar(ta.crossover(src, lower1), "Short TP", "X", location.belowbar, upColor, size = size.tiny) plotchar(ta.crossunder(src, upper1), "Long TP", "X", location.abovebar, downColor, size = size.tiny) // Draw Gauge for i = 1 to tc color_ = chart.fg_color color = color.from_gradient(i, 1, tc, src > basis ? upColor : downColor, color_) printTable("", 1, i, color, ">", 1, math.round(y*tc), #ffffff00) ///////Alerts alertcondition(ta.cross(trend, 0), "Universal Trend Shift (when trend changes direction)") alertcondition(ta.crossover(trend, 0), "Bullish Trend") alertcondition(ta.crossunder(trend, 0), "Bearish Trend") alertcondition(ta.crossover(src, lower1) or ta.crossunder(src, upper1), "Universal TP (when any TP signal triggers)") alertcondition(ta.crossover(src, lower1), "Short TP") alertcondition(ta.crossunder(src, upper1), "Long TP")