커뮤니티

예스랭귀지 Q&A

글쓰기
답변완료

안녕하세요. 코딩 수정 부탁드립니다!

Inputs: factor (3), // SuperTrend ATR 배수 AtrPeriod (14), // SuperTrend ATR 기간 shortLen (12), // EMA 단기 기간 longLen (26); // EMA 장기 기간 Vars: src (0), trv (0), atrv (0), upperBand (0), lowerBand (0), prevUB (0), prevLB (0), dir (0), supertrend (0), emaShort (0), emaLong (0); // === SuperTrend 계산 === if CurrentBar > 1 then { src = (High + Low) / 2; trv = MaxList(High - Low, MaxList(Abs(High - Close[1]), Abs(Low - Close[1]))); atrv = EMA(trv, AtrPeriod); upperBand = src + factor * atrv; lowerBand = src - factor * atrv; prevUB = upperBand[1]; prevLB = lowerBand[1]; if (lowerBand <= prevLB and Close[1] >= prevLB) then lowerBand = prevLB; if (upperBand >= prevUB and Close[1] <= prevUB) then upperBand = prevUB; if Close > upperBand then dir = 1; else if Close < lowerBand then dir = -1; if dir == 1 then supertrend = lowerBand; else supertrend = upperBand; } // === EMA 계산 === emaShort = EMA(Close, shortLen); emaLong = EMA(Close, longLen); // === 상태 기반 진입·청산 === // 롱 진입: 포지션 없고 EMA > & 가격 > SuperTrend if MarketPosition == 0 and emaShort > emaLong and Close > supertrend then { Buy("LongEntry"); } // 롱 청산: 롱 보유 중 EMA < & 가격 < SuperTrend if MarketPosition > 0 and emaShort < emaLong and Close < supertrend then { ExitLong("LongExit"); } // 숏 진입: 포지션 없고 EMA < & 가격 < SuperTrend if MarketPosition == 0 and emaShort < emaLong and Close < supertrend then { Sell("ShortEntry"); } // 숏 청산: 숏 보유 중 EMA > & 가격 > SuperTrend if MarketPosition < 0 and emaShort > emaLong and Close > supertrend then { ExitShort("ShortExit"); } 담당자님 안녕하세요. 항상 고생많으십니다. 현재 스위칭 진입,청산 전략을 사용하고 있습니다. 예를 들어 매수 후 매도 청산 -> 다음봉에서 다시 매도진입 이런식으로 되는데 혹시 청산하면서 그 봉에서 바로 스위칭 진입하는 코딩으로 만들어 주실 수 있으실까요?? 매수 후 매도 청산 -> 그 봉에 종가에서 바로 매도 진입 매도 후 매수 청산 -> 그 봉에 종가에서 바로 매수 진입 이렇게 부탁드리겠습니다! 감사합니다.
프로필 이미지
최태수
2025-08-06
207
글번호 193054
시스템
답변완료

지표문의

1.아래지표 검증이 안됨 수정 좀 해주세요 그리고 밑에 막대말고 왼쪽 수평 막대선으로 표시되게 좀 수정 좀 해주세요 Vars: priceStep(100), // 가격 구간 간격 설정 (예: 100포인트) maxBars(100), // 분석할 봉 수 i(0), j(0), priceMin(0), priceMax(0), priceLevel(0), volumeBins(1000), // 구간 개수 (최대) volArray ; // 거래량 누적 배열 // 초기화 Array: volArray ; // 최소, 최대 가격 계산 priceMin = Close; priceMax = Close; For i = 0 to maxBars - 1 Begin If Low[i] < priceMin Then priceMin = Low[i]; If High[i] > priceMax Then priceMax = High[i]; End; // 가격 구간 개수 계산 Vars: binCount(0); binCount = IntPortion((priceMax - priceMin) / priceStep) + 1; // 배열 초기화 For i = 0 to binCount - 1 Begin volArray[i] = 0; End; // 가격대별 거래량 누적 For i = 0 to maxBars - 1 Begin priceLevel = IntPortion((Close[i] - priceMin) / priceStep); If priceLevel >= 0 and priceLevel < binCount Then volArray[priceLevel] = volArray[priceLevel] + Volume[i]; End; // 결과 출력 (차트에 히스토그램으로 표시) For j = 0 to binCount - 1 Begin Plot1[0](volArray[j], "Vol@Price"); // Plot 위치 조정 필요 시: SetPlotYPosition(Plot1, priceMin + j * priceStep); End; 2.그럼 즐거운 하루 되세요
프로필 이미지
성공예견
2025-08-06
201
글번호 193053
지표
답변완료

이동평균선 기울기(양/음)에 따라 색깔 달리하기

안녕하세요 .. 이동평균선 종류별로 기울기가 변함에 따라 색깔을 달리하는 수식 작성 부탁드립니다. 색깔은 다음과 같이 해 주세요... 5 이평 : 기울기 양(밝은 초록), 기울기 음(어두운 초록) 20 이평 : 기울기 양(밝은 빨강), 기울기 음(어두운 빨강) 60 이평 : 기울기 양(밝은 파랑), 기울기 음(어두운 파랑) 120 이평 : 기울기 양(밝은 노랑), 기울기 음(어두운 노랑) 240 이평 : 기울기 양(밝은 보라), 기울기 음(어두운 보라) 감사합니다....
프로필 이미지
랑랑
2025-08-07
191
글번호 193052
지표
답변완료

지표 질문입니다

1. var1=highest(H,20); var2=lowest(L,20); plot1(var1); plot2(var2); 이 수식을 실행하면 선 두 개가 실행되는데 var1 선 우측 위에 var2 바닥 포함 var1 천정까지 캔들수(양봉,음봉,도지) 표시하는 수식 var2 선 우측 아래 var1 천정 포함 var2 바닥까지 캔들수(양봉,음봉,도지) 표시하는 수식 2. '봉세기 갯수' 버튼을 클릭해서 2025/04/09 바닥에서 2025/07/31 천정까지 드래깅하면 77봉(45,31,1) 이라고 표출됩니다 여기에 한 개 추가하여 양봉 덩어리 갯수 22개를 추가하여 77봉(45,31,1,22) 로 표출 3. '봉세기 갯수' 버튼을 클릭해서 2025/03/26 천정에서 2025/04/09 바닥까지 드래깅하면 11봉(4.7,0)이 출력됩니다 여기에 1개 추가하여 음봉 덩어리 갯수 3개를 포함하여 11봉(4.7,0,3)) 로 표출 4. 검색식에서 음봉+연속 2양 익일 시가 상승 출발 종목을 검색하는 수식 부탁드립니다 그리고 수식을 이용하여 아이엠증권 예스트레이더 차트에서 그 종목을 검색하는 프로세스를 설명해주시면 감사하겠습니다 감사합니다
프로필 이미지
para
2025-08-06
182
글번호 193051
지표
답변완료

안녕하세요, 수식을 문의드립니다

안녕하세요, 수식을 문의드립니다 1, 연속된 3개의 음봉(Candle)이 -0.75P 하락하면 매도 2, 5개의 봉(Candle)이 +0.75P 상승하면 매수 감사합니다 향상 건강하시고 행복하세요
프로필 이미지
금보
2025-08-06
164
글번호 193050
시스템
답변완료

다시 문의드립니다.

이전 글 93804번을 봉갯수 800바로 하고 적용했는데 밴드가 차트에 표시되지 않습니다. 다시한번 살펴주시기 바랍니다. 감사합니다. 수고하세요!!!
프로필 이미지
해암
2025-08-06
169
글번호 193048
지표
답변완료

어떻게 고쳐야 할까요?

차트상 매수(빨간삼각형), 매도(파란삼각형) 신호와 무관하게 신호가 나타납니다. 수정 부탁 드림니다. input : length(15); input : show_levl(true); var : up(0),dn(0),A(0),emaValue(0),correction(0),zlma(0); var : signalUp(False),signalDn(False),zlma_color(0),ema_col(0); var : TOP(0),BTM(0),box(0),tx(0),tx1(0),check_signals(False); up = Black; dn = Blue; #var box1 = box(na) // Variable to store the box a = atr(200); emaValue = ema(close, length); correction = close + (close - emaValue); zlma = ema(correction, length); signalUp = CrossUp(zlma, emaValue); signalDn = CrossDown(zlma, emaValue); zlma_color = iff(zlma > zlma[3] , up , iff(zlma < zlma[3] , dn , Nan)); ema_col = iff(emaValue < zlma , up , dn); if signalUp Then { Top = zlma; BTM = zlma-A; var3 = (Top+BTM)/2; } else if signalDn Then { Top = zlma+A; BTM = zlma; var3 = (Top+BTM)/2; } check_signals = signalUp or signalDn; if CrossDown(high, BTM) and emaValue > zlma Then { Buy("b"); } if CrossUp(low, Top) and emaValue < zlma Then { ExitLong("bx"); }
프로필 이미지
제너리
2025-08-06
217
글번호 193042
시스템
답변완료

문의드립니다,

Input : shortPeriod(12), longPeriod(26), Period(9); Inputs: RSILength(10), OverSold(30); Var : MACD1(0,Data1),MACD2(0,Data2),R(0,Data1); MACD1 = data1(MACD(shortPeriod, longPeriod)); MACD2 = data2(MACD(shortPeriod, longPeriod)); R = Data1(RSI(RSILength)); If MACD2 > 0 and Crossup(R, OverSold) Then Buy ("RSI"); if MarketPosition == 1 Then { if CrossDown(MACD1,0) or CrossDown(MACD2,0) Then ExitLong(); } 위 수식을 다음과같이 변경 문의드립니다. 1.data2 macd oscillator 골든시 data1매수 2.data2 macd oscillator 골든이후 data1 rsi bull oscillator 매수신호시 data1매수식 3.data1 rsi bull oscillator (70)매도시 or data2 macd oscillator 매도시 매도식 늘감사드립니다
프로필 이미지
2685up
2025-08-06
187
글번호 193041
시스템
답변완료

문의드립니다.

1.아래의 트레이딩뷰수식을 변환부탁드립니다. 2 위1번에서 차트는 과거봉 500개까지 밴드가 그려지는 것으로 보이는데, 과거봉 5000개까지 확장적용하려면 어떻게 해야 하는지요? ===================== indicator("Nadaraya-Watson Envelope [LuxAlgo]", "LuxAlgo - Nadaraya-Watson Envelope", overlay = true, max_lines_count = 500, max_labels_count = 500, max_bars_back=500) //------------------------------------------------------------------------------ //Settings //-----------------------------------------------------------------------------{ h = input.float(8.,'Bandwidth', minval = 0) mult = input.float(1.6., minval = 0) src = input(close, 'Source') repaint = input(true, 'Repainting Smoothing', tooltip = 'Repainting is an effect where the indicators historical output is subject to change over time. Disabling repainting will cause the indicator to output the endpoints of the calculations') //Style upCss = input.color(color.teal, 'Colors', inline = 'inline1', group = 'Style') dnCss = input.color(color.red, '', inline = 'inline1', group = 'Style') //-----------------------------------------------------------------------------} //Functions //-----------------------------------------------------------------------------{ //Gaussian window gauss(x, h) => math.exp(-(math.pow(x, 2)/(h * h * 2))) //-----------------------------------------------------------------------------} //Append lines //-----------------------------------------------------------------------------{ n = bar_index var ln = array.new_line(0) if barstate.isfirst and repaint for i = 0 to 499 array.push(ln,line.new(na,na,na,na)) //-----------------------------------------------------------------------------} //End point method //-----------------------------------------------------------------------------{ var coefs = array.new_float(0) var den = 0. if barstate.isfirst and not repaint for i = 0 to 499 w = gauss(i, h) coefs.push(w) den := coefs.sum() out = 0. if not repaint for i = 0 to 499 out += src[i] * coefs.get(i) out /= den mae = ta.sma(math.abs(src - out), 499) * mult upper = out + mae lower = out - mae //-----------------------------------------------------------------------------} //Compute and display NWE //-----------------------------------------------------------------------------{ float y2 = na float y1 = na nwe = array.new<float>(0) if barstate.islast and repaint sae = 0. //Compute and set NWE point for i = 0 to math.min(499,n - 1) sum = 0. sumw = 0. //Compute weighted mean for j = 0 to math.min(499,n - 1) w = gauss(i - j, h) sum += src[j] * w sumw += w y2 := sum / sumw sae += math.abs(src[i] - y2) nwe.push(y2) sae := sae / math.min(499,n - 1) * mult for i = 0 to math.min(499,n - 1) if i%2 line.new(n-i+1, y1 + sae, n-i, nwe.get(i) + sae, color = upCss) line.new(n-i+1, y1 - sae, n-i, nwe.get(i) - sae, color = dnCss) if src[i] > nwe.get(i) + sae and src[i+1] < nwe.get(i) + sae label.new(n-i, src[i], '▼', color = color(na), style = label.style_label_down, textcolor = dnCss, textalign = text.align_center) if src[i] < nwe.get(i) - sae and src[i+1] > nwe.get(i) - sae label.new(n-i, src[i], '▲', color = color(na), style = label.style_label_up, textcolor = upCss, textalign = text.align_center) y1 := nwe.get(i) //-----------------------------------------------------------------------------} //Dashboard //-----------------------------------------------------------------------------{ var tb = table.new(position.top_right, 1, 1 , bgcolor = #1e222d , border_color = #373a46 , border_width = 1 , frame_color = #373a46 , frame_width = 1) if repaint tb.cell(0, 0, 'Repainting Mode Enabled', text_color = color.white, text_size = size.small) //-----------------------------------------------------------------------------} //Plot //-----------------------------------------------------------------------------} plot(repaint ? na : out + mae, 'Upper', upCss) plot(repaint ? na : out - mae, 'Lower', dnCss) //Crossing Arrows plotshape(ta.crossunder(close, out - mae) ? low : na, "Crossunder", shape.labelup, location.absolute, color(na), 0 , text = '▲', textcolor = upCss, size = size.tiny) plotshape(ta.crossover(close, out + mae) ? high : na, "Crossover", shape.labeldown, location.absolute, color(na), 0 , text = '▼', textcolor = dnCss, size = size.tiny) //-----------------------------------------------------------------------------} ================== 매번 감사드립니다. 수고하세요!!!
프로필 이미지
해암
2025-08-06
204
글번호 193040
지표
답변완료

수식수정바랍니다

안녕하세요 아래 vwap지표를 이용 표준편차밴드(볼린져밴드처럼) 지표를 만들수 있나요? 작성가능하면 부탁드립니다. var : sum(0),VWAP(0),PreVWAP(0); if date != date[1] Then{ sum = 0; PreVWAP = VWAP; } sum = sum+((H+L+C)/3*v); VWAP = sum/DayVolume; plot1(VWAP,"Volume-Weighted Average Price"); 수고하세요
프로필 이미지
바닥차기
2025-08-06
198
글번호 193039
지표