커뮤니티

조건검색문의드립니다

프로필 이미지
해피럭키
2025-11-20 08:45:04
55
글번호 228232
답변완료

첨부 이미지

2가지 수정 변환 부탁드리겠습니다 [1]수식을 적용했는데 첨부이미지 에러가 뜨는데  수정좀 부탁드리겠습니다 (수정에러가 자꾸 뜨서 부탁드립니다) Input : Period_BB(20); Input : Dev_BB(2); Input : Band_LLV(100); Input : Band_Expand(1.3); Input : Period_KDJ(9), Period_SigK(3), Period_SigD(3); Input : K_Under(30); var : vBasis(0), vDev(0), vUpper(0), vLower(0); var : vBBWidth(0); var : vMinWidth(0); var : vLL(0), vHH(0), vFastK(0);  var : vK(0), vD(0); var : Cond_Compress(False), Cond_Expand(False); var : Cond_KDJ_Cross(False), Cond_KDJ_Area(False); var : TotalSum(0), i(0), SumOfSquaredDiffs(0), StdDev(0), Mean(0); vLL = Lowest(L, Period_KDJ); vHH = Highest(H, Period_KDJ); if vHH > vLL Then     vFastK = ((C - vLL) / (vHH - vLL)) * 100 Else     vFastK = 50; vK = MA(vFastK, Period_SigK);  vD = MA(vK, Period_SigD); vBasis = ma(C, Period_BB); TotalSum = 0; For i = 0 to Period_BB - 1 begin     TotalSum = TotalSum + C[i]; end; Mean = TotalSum / Period_BB; SumOfSquaredDiffs = 0; For i = 0 to Period_BB - 1 begin     SumOfSquaredDiffs = SumOfSquaredDiffs + (C[i] - Mean) * (C[i] - Mean); end; StdDev = SquareRoot(SumOfSquaredDiffs / Period_BB); vDev = Dev_BB * StdDev; vUpper = vBasis + vDev; vLower = vBasis - vDev; if vBasis > 0 Then     vBBWidth = ((vUpper - vLower) / vBasis) * 100 Else     vBBWidth = 0; vMinWidth = Lowest(vBBWidth, Band_LLV); Cond_Compress = vBBWidth[1] <= vMinWidth[1];  Cond_Expand = vBBWidth > vBBWidth[1] * Band_Expand; Cond_KDJ_Cross = CrossUp(vK, vD); Cond_KDJ_Area = vK < K_Under; If Cond_Compress and Cond_Expand and Cond_KDJ_Cross and Cond_KDJ_Area Then     Find(1); [2] 조건검색식으로 신호떴을때 검색되도록 변환부탁드립니다 //@version=5 indicator("Quantum Trend Scalper , overlay=true, max_boxes_count=500, max_lines_count=500) // ────────────────────────────── 설정 ────────────────────────────── emaFastLen  = input.int(8,  "EMA 빠른") emaSlowLen  = input.int(21, "EMA 느린") atrPeriod   = input.int(7,  "SuperTrend ATR 기간") atrMult     = input.float(1.8, "SuperTrend 멀티", step=0.1) squeezeLen  = input.int(20, "Squeeze 길이") showVWAP    = input.bool(true, "VWAP 필터 켜기") // ────────────────────────────── 1. EMA 8/21 ────────────────────────────── emaFast = ta.ema(close, emaFastLen) emaSlow = ta.ema(close, emaSlowLen) golden  = ta.crossover(emaFast, emaSlow) death   = ta.crossunder(emaFast, emaSlow) plot(emaFast, color=#00ff00, linewidth=2, title="EMA 8") plot(emaSlow, color=#ff0000, linewidth=2, title="EMA 21") // ────────────────────────────── 2. SuperTrend ────────────────────────────── [supertrend, direction] = ta.supertrend(atrMult, atrPeriod) plot(supertrend, "SuperTrend", color=direction < 0 ? color.red : color.lime, linewidth=2, style=plot.style_circles) // ────────────────────────────── 3. TTM Squeeze Momentum ────────────────────────────── basis_sqz = ta.sma(close, squeezeLen) dev_sqz   = ta.stdev(close, squeezeLen) kcUpper   = basis_sqz + 1.5 * dev_sqz kcLower   = basis_sqz - 1.5 * dev_sqz squeezeOn  = (kcLower > supertrend) or (kcUpper < supertrend) squeezeOff = not squeezeOn mom = close - (basis_sqz + kcUpper + kcLower) / 2 momCol = mom > 0 ? (mom > mom[1] ? color.lime : color.green) : (mom < mom[1] ? color.red : color.maroon) // ────────────────────────────── 4. Volume + VWAP 필터 (오류 완전 해결) ────────────────────────────── volSurge = volume > ta.sma(volume, 20) * 2 // VWAP intraday 오류 해결 버전 (모든 타임프레임 완벽 작동) vwapVal = ta.vwap(hlc3)   // ta. 로 명시적 호출 + hlc3 사용 plot(showVWAP ? vwapVal : na, color=color.new(color.yellow, 70), linewidth=2, title="VWAP") aboveVWAP = close > vwapVal //

종목검색
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2025-11-20 14:14:07

안녕하세요 예스스탁입니다. 1 Input : Period_BB(20); Input : Dev_BB(2); Input : Band_LLV(100); Input : Band_Expand(1.3); Input : Period_KDJ(9), Period_SigK(3), Period_SigD(3); Input : K_Under(30); var : vBasis(0), vDev(0), vUpper(0), vLower(0); var : vBBWidth(0); var : vMinWidth(0); var : vLL(0), vHH(0), vFastK(0); var : vK(0), vD(0); var : Cond_Compress(False), Cond_Expand(False); var : Cond_KDJ_Cross(False), Cond_KDJ_Area(False); var : TotalSum(0), i(0), SumOfSquaredDiffs(0), StdDev(0), Mean(0); vLL = Lowest(L, Period_KDJ); vHH = Highest(H, Period_KDJ); if vHH > vLL Then vFastK = ((C - vLL) / (vHH - vLL)) * 100; Else vFastK = 50; vK = MA(vFastK, Period_SigK); vD = MA(vK, Period_SigD); vBasis = ma(C, Period_BB); TotalSum = 0; For i = 0 to Period_BB - 1 begin TotalSum = TotalSum + C[i]; end; Mean = TotalSum / Period_BB; SumOfSquaredDiffs = 0; For i = 0 to Period_BB - 1 begin SumOfSquaredDiffs = SumOfSquaredDiffs + (C[i] - Mean) * (C[i] - Mean); end; StdDev = SquareRoot(SumOfSquaredDiffs / Period_BB); vDev = Dev_BB * StdDev; vUpper = vBasis + vDev; vLower = vBasis - vDev; if vBasis > 0 Then vBBWidth = ((vUpper - vLower) / vBasis) * 100; Else vBBWidth = 0; vMinWidth = Lowest(vBBWidth, Band_LLV); Cond_Compress = vBBWidth[1] <= vMinWidth[1]; Cond_Expand = vBBWidth > vBBWidth[1] * Band_Expand; Cond_KDJ_Cross = CrossUp(vK, vD); Cond_KDJ_Area = vK < K_Under; If Cond_Compress and Cond_Expand and Cond_KDJ_Cross and Cond_KDJ_Area Then Find(1); 2 input : emaFastLen(8); input : emaSlowLen(21); input : atrPeriod(7); input : atrMult(1.8); input : squeezeLen(20); input : showVWAP(true); var : Emafast(0),Emaslow(0),Golden(False),death(False); var : src(0), alpha(0),ATRV(0),upperBand(0),lowerBand(0),direction(0),SuperTrend(C); emaFast = ema(close, emaFastLen); emaSlow = ema(close, emaSlowLen); golden = CrossUp(emaFast, emaSlow); death = CrossDown(emaFast, emaSlow); if CurrentBar > 1 Then { src = (H+L)/2; alpha = 1 / atrperiod ; ATRV = IFf(IsNan(ATRV[1]) == true, ma(TrueRange,atrperiod) , alpha * TrueRange + (1 - alpha) * IFf(isnan(ATRV[1])==true,0,ATRV[1])); upperBand = src + atrMult * AtrV; lowerBand = src - atrMult * AtrV; if lowerBand > lowerBand[1] or close[1] < lowerBand[1] Then lowerBand = lowerBand; Else lowerBand = lowerBand[1]; if upperBand < upperBand[1] or close[1] > upperBand[1] Then upperBand = upperBand; Else upperBand = upperBand[1]; if C > UpperBand Then direction = 1; if C < LowerBand Then direction = -1; if direction == 1 Then SuperTrend = lowerband; Else SuperTrend = upperband; } var : basis_sqz(0),dev_sqz(0),kcUpper(0),kcLower(0); var : squeezeOn(False),squeezeOff(False),mom(0),momCol(0),volSurge(False); basis_sqz = ma(close, squeezeLen); dev_sqz = std(close, squeezeLen); kcUpper = basis_sqz + 1.5 * dev_sqz; kcLower = basis_sqz - 1.5 * dev_sqz; squeezeOn = (kcLower > supertrend) or (kcUpper < supertrend); squeezeOff = squeezeOn == False; mom = close - (basis_sqz + kcUpper + kcLower) / 2; momCol = iff(mom > 0 , IFF(mom > mom[1], lime , green) , IFf(mom < mom[1], red , maroon)); volSurge = volume > ma(volume, 20) * 2; var : hlc3(0),sum1(0),sum2(0),aboveVWAP(False),vwapVal(0),longSignal(False); hlc3 = (h+l+c)/3; if Bdate != Bdate[1] Then { sum1 = 0; sum2 = 0; } sum1 = sum1 + (hlc3*v); sum2 = sum2 + v; vwapVal = sum1/sum2; aboveVWAP = close > vwapVal; longSignal = golden and direction < 0 and squeezeOff and volSurge and aboveVWAP; if longSignal == true Then Find(1); 즐거운 하루되세요