커뮤니티

조건검색 문의

프로필 이미지
사공하늘
2025-10-19 21:20:00
98
글번호 227017
답변완료

// Pine Script Code for Orange Breakout Signal Only // Copy and paste this entire code into TradingView Pine Editor //@version=5 indicator("Orange Breakout Signal Only", overlay=true) // Input parameters period2 = input.int(20, "Period 2", minval=1) multiplier2 = input.float(2.0, "Multiplier 2", minval=0.1) // Calculate source src = (high + low) / 2 // Function to calculate SuperTrend superTrend(period, multiplier) => alpha = 1.0 / period source = math.max(high - low, math.max(math.abs(high - close[1]), math.abs(low - close[1]))) atr = 0.0 atr := alpha * source + (1 - alpha) * nz(atr[1]) upperBand = src + multiplier * atr lowerBand = src - multiplier * atr prevLowerBand = nz(lowerBand[1]) prevUpperBand = nz(upperBand[1]) lowerBand := lowerBand > prevLowerBand or close[1] < prevLowerBand ? lowerBand : prevLowerBand upperBand := upperBand < prevUpperBand or close[1] > prevUpperBand ? upperBand : prevUpperBand direction = 0 direction := close > upperBand ? 1 : close < lowerBand ? -1 : nz(direction[1], 0) superTrendValue = direction == 1 ? lowerBand : upperBand [superTrendValue, direction] // Calculate SuperTrend [supertrend2, direction2] = superTrend(period2, multiplier2) // 오렌지 라인 돌파 신호만 감지 및 표시 if ta.crossover(close, supertrend2) // 돌파 신호만 표시 (라인 없이) label.new(bar_index, low, "▲ ORANGE\nBREAKOUT", color=color.orange, textcolor=color.white, style=label.style_label_up, yloc=yloc.belowbar)

오랜만에 문의 글 올립니다 (__)
일봉상 위 신호가 발생한 종목에 대해서 검출할 수 있도록 검색식 만들어주시면 감사드리겠습니다 :)

supertrend돌파
검색
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2025-10-20 14:22:23

안녕하세요 예스스탁입니다. input : period2(20); input : multiplier2(2.0); var : src(0),source(0),alpha(0),atr(0); var : upperBand(0),lowerBand(0),direction(0),SuperTrend(C); var : prevLowerBand(0),prevUpperBand(0),superTrend2(0); src = (H+L)/2; if CurrentBar > 1 Then { alpha = 1 / period2; source = max(high - low, max(abs(high - close[1]), abs(low - close[1]))); atr = 0.0; atr = alpha * source + (1 - alpha) * iff(IsNan(atr[1])==true,0,atr[1]); upperBand = src + multiplier2 * atr; lowerBand = src - multiplier2 * atr; prevLowerBand = IFf(IsNaN(lowerBand[1])==true,0,lowerBand[1]); prevUpperBand = iff(isnan(upperBand[1])==true,0,upperBand[1]); lowerBand = iff(lowerBand > prevLowerBand or close[1] < prevLowerBand , lowerBand , prevLowerBand); upperBand = iff(upperBand < prevUpperBand or close[1] > prevUpperBand , upperBand , prevUpperBand); direction = 0; direction = IFf(close > upperBand , 1 , iff(close < lowerBand , -1 , IFf(IsNan(direction[1])==true, 0,direction[1]))); superTrend2 = iff(direction == 1 , lowerBand , upperBand); IF CrossUp(close,superTrend2) Then Find(1); } 즐거운 하루되세요