커뮤니티

예스랭귀지 Q&A

글쓰기
답변완료

[공지] 예스랭귀지 AI 어시스턴트, '예스나 AI' 출시 및 무료 체험 안내

안녕하세요, 예스스탁 입니다.복잡한 수식 공부 없이 여러분의 아이디어를 말하면 시스템 트레이딩 언어 예스랭귀지로 작성해주는 서비스예스나 AI(YesNa AI)가 출시되었습니다.지금 예스나 AI를 직접 경험해 보실 수 있도록 20크레딧(질문권 20회)를 무료로 증정해 드리고 있습니다.바로 여러분의 아이디어를 코드로 변환해보세요.--------------------------------------------------🚀 YesNa AI 핵심 기능- 지표식/전략식/종목검색식 생성: 자연어로 요청하면 예스랭귀지 문법에 맞는 코드를 작성합니다.- 종목검색식 변환 지원: K증권의 종목 검색식을 예스랭귀지로 변환 지원합니다.- 컴파일 검증: 작성된 코드가 실행 가능한지 컴파일러를 통해 문법 검증을 거쳐 결과물을 제공합니다.상세한 서비스 개요 및 활용 방법은 [서비스 소개 페이지]에서 확인하실 수 있습니다.▶ 서비스 소개 페이지: 바로가기서비스 사용 유의사항 및 결제 환불정책은 [이용약관]을 참고 부탁드립니다.▶ 서비스 이용약관: 바로가기💬 이용 문의사용 중 문의사항은 [프로그램 사용법 Q&A] 게시판에서 [예스나 AI] 카테고리를 설정 후 문의해 주시면 상세히 안내해 드리겠습니다.--------------------------------------------------앞으로도 AI를 활용한 다양한 트레이딩 기능들을 지속적으로 선보일 예정입니다.많은 관심과 기대 부탁드립니다.
프로필 이미지
예스스탁
2026-02-27
8277
글번호 230811
지표
답변완료

문의드립니다.

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
1877
글번호 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
522
글번호 193039
지표
답변완료

등가 옵션 기준 지표 부탁드려요.

등가 옵션 기준(총 16쌍) ----> ATM±40포인트 및 2.5포인트 간격 [예시] var1 = call(2.0)-put(0.5) var2 = call(0.7)-put(0.2) var3 = call(0.5)-put(1.2) 1.당일시가 abs(콜-풋) 차이가 가장 작은 값의 양합(콜+풋) ---> var2(0.9) 2.1번값의 ATM-1 양합(콜+풋) (단 당일시가 0이 아닌 콜,풋 가격이여야 유효한 경우) ---> var2-1(양합) = var1(2.5) 3.1번값의 ATM+1 양합(콜+풋) (단 당일시가 0이 아닌 콜,풋 가격이여야 유효한 경우) ---> var2+1(양합) = var3(1.7) 4.2,3번 모두 해당 상황 없으면 n/a 5.2,3번 중 1개만 있으면 2,3 양합(콜+풋) 음수 처리 ---> var1(-2.5) or var3(-1.7) 6.2.3번 양합 중 큰 값을 양수 작은 값을 음수 처리 ---> var1(2.5) var3(-1.7) 무더운 날씨 건강 조심하시고, 항상 도움을 주셔서 감사드립니다~~~
프로필 이미지
천장지구
2025-08-06
628
글번호 193038
지표
답변완료

지표 변환 부탁드립니다.

// This work is licensed under Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International // https://creativecommons.org/licenses/by-nc-sa/4.0/ // &#169; BigBeluga //@version=6 indicator("Two Poles Trend Finder MTF [BigBeluga]", overlay = true) // INPUTS ――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――{ alpha = input.float(0.10, minval=0.01, maxval=1.0, step = 0.01, title="Alpha") source = input.source(close, "Source") offset = 3 tf1 = input.timeframe("60", "Timeframe1") tf2 = input.timeframe("120", "Timeframe2") tf3 = input.timeframe("240", "Timeframe3") tf4 = input.timeframe("720", "Timeframe4") tf5 = input.timeframe("D", "Timeframe5") c_up = input.color(#00b8a5, "") c_dn = input.color(#b80090, "") var float f = na var float f_prev1 = na var float f_prev2 = na // } // CALCULATIONS――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――{ // Apply two-pole Gaussian filter if bar_index >= 2 f := math.pow(alpha, 2) * source + 2 * (1 - alpha) * f_prev1 - math.pow(1 - alpha, 2) * f_prev2 else f := source // Warm-up for first bars // Shift state f_prev2 := f_prev1 f_prev1 := f tp1 = request.security("", tf1, f_prev1 > f_prev1[offset]) tp2 = request.security("", tf2, f_prev1 > f_prev1[offset]) tp3 = request.security("", tf3, f_prev1 > f_prev1[offset]) tp4 = request.security("", tf4, f_prev1 > f_prev1[offset]) tp5 = request.security("", tf5, f_prev1 > f_prev1[offset]) avg = math.avg(tp1 ? 1 : 0, tp2 ? 1 : 0, tp3 ? 1 : 0, tp4 ? 1 : 0, tp5 ? 1 : 0) dash = table.new(position.bottom_right, 100, 100) if barstate.islast dash.merge_cells(0, 0, 8, 0) dash.cell(0, 0, str.tostring(syminfo.basecurrency) + (avg > 0.5 ? " &#129153;" : " &#129155;"), text_color = avg > 0.5 ? c_up : c_dn, tooltip = "Average Trend") draw_gauge(col, tf, trend)=> if barstate.islast s = timeframe.in_seconds(tf) m = timeframe.in_seconds(tf) / 60 h = timeframe.in_seconds(tf) / 60 / 60 d = timeframe.in_seconds(tf) / 60 / 60 / 24 tff = h < 24 and h >= 1 ? str.tostring(h) + "H" : m >= 1440 ? str.tostring(d) + "D" : m < 60 and m > 1 ? str.tostring(m) + "M" : m < 1 ? str.tostring(s) + "S" : tf color = trend ? c_up : c_dn dash.cell(col, 1, "", bgcolor = color) dash.cell(col, 2, tff, text_color = chart.fg_color, text_size = size.normal) dash.cell(col+1, 1, "", bgcolor = color(na), width = 1) // } // PLOT ――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――{ draw_gauge(0, tf1, tp1) draw_gauge(2, tf2, tp2) draw_gauge(4, tf3, tp3) draw_gauge(6, tf4, tp4) draw_gauge(8, tf5, tp5) plot(f_prev1, "1", color = f_prev1 > f_prev1[offset] ? c_up : c_dn, linewidth = 3) plot(f_prev1, "2", color = color.new(f_prev1 > f_prev1[offset] ? c_up : c_dn, 80), linewidth = 25) // }
프로필 이미지
삼손감자
2025-08-06
1829
글번호 193032
지표
답변완료

함수

안녕하세요 아래식을 최대한 쉽게 설명부탁드려요 중이평 = ma(c,min(DayIndex+1,중이평봉수)); 감사합니다
프로필 이미지
달마7
2025-08-06
434
글번호 193023
사용자 함수
답변완료

종목검색식 부탁드립니다

1. 주봉 20 이평 (단순) 을 캔들이 양봉으로 돌파하거나, 주봉 20이평선에(단순) 캔들이 상하(위, 아래) 각각 1% 이내로 근접하고 양봉일때 , 종목검색식 부탁드립니다. 2. 다음 수식을 참조하여 종목 검색식 부탁드려요 아래수식을 1) ~ 5) 까지 OR (또는) 해서, 1개의 종목검색식으로 부탁드립니다. ---------- 1) M= Macd(12,26); Ms=eavg(M,9); 골든크로스 첫봉 때 2) S=StochasticsSlow(12,5); Ss=eavg(S,3); 골든크로스 첫봉때 3) CC=CCi(9); Cs=eavg(CC,12); 골든크로스 첫봉때 4) R=Rsi(14); Rs=eavg(R,9); 골든크로스 첫봉때 5) Dp =DiPlus(14); Dm=DiMinus(14); 골든크로스 첫봉때
프로필 이미지
일지매7
2025-08-06
514
글번호 193022
종목검색
답변완료

문의드립니다.

1.var1이 0이 아닌 경우만 배열변수로 저장해서 외부변수의 기간(5)갯수의 배열변수의 합을 구하는 식 input : 기간(5); vars : cnt(0),cnt2(0); Array : array1[100](0),array2[100](0); If var1 != 0 Then {array1[0] = Var1; for cnt = 1 to 99{ array1[cnt] = array1[cnt-1][1];}} for cnt = 0 to 기간 - 1 { cnt2 = cnt2 + array1[cnt][0];} 2.var1이 0이 아닌 경우의 과거 봉은 제외하고 input : 기간(5); vars : cnt(0),cnt2(0); if var1 != 0 Then for cnt = 0 to 기간 - 1 { cnt2 = cnt2 + var1[cnt];} var1이 0이 아닐 때의 값 기간의 합을 구하고 싶은데요 수치가 제대로 안나와요. 과거전봉의 갯수 상관없이 var1 != 0 이 아닌 5개봉(input값)ㅠ.ㅠ 어떻게 수정해야 하죠? 답변부탁드립니다..수고하세요^^
프로필 이미지
아싸가오리
2025-08-05
425
글번호 193021
지표
답변완료

도움 부탁드립니다

안녕하세요 무더운 여름 잘 보내시길 바랍니다. 아래 지표는 커뮤니티에서 다운받은 지표인데 궁금한것이 챠트캔들위에 나타나는 삼각형의 표시가 캔들이 몇개이상 지나고 난 후에 캔들위에 표시가 되는데 궁금한것은 1. 보통 캔들이 완성된후에 생기는데 이처럼 여러개의 캔들이 지나서 나타나는 이유. 2. 후행성이 아닌 실시간 켄들에 나타나게 할 수는 없는지요. 3. 2번째 질문에 답이 안된다면 캔들 표식이 아닌 다른 방법으로도 실시간 알수는 없는지요 감사합니다. input : len(3); input : mult(0.6); input : color_t_up(Lime); var : color_t(orange); input : color_t_dn(Red); var : p_h(nan); var : p_l(nan); var : trend(False); var : market_state(""),ph(0),pl(0),tx(0); market_state = "Range"; if SwingHigh(1,h,len,len,len+len+1) != -1 Then { p_h = h[len]; tx = Text_New(sDate[len],sTime[len],p_h,"▼"); Text_SetStyle(tx,2,1); Text_SetColor(tx,Blue); Text_SetSize(tx,12); } if SwingLow(1,l,len,len,len+len+1) != -1 Then { p_l = l[len]; tx = Text_New(sDate[len],sTime[len],p_l,"▲"); Text_SetStyle(tx,2,0); Text_SetColor(tx,Red); Text_SetSize(tx,12); } var : avgv(0),ATrv(0),hl2(0),upper(0),lower(0),tx1(0); avgv = (p_h+p_l)/2; atrv = atr(200)*mult; upper = avgv + atrv; lower = avgv - atrv; hl2 = (h+l)/2; if hl2 > upper Then { color_t = color_t_up; trend = true; market_state = "Momentum Up"; } if hl2 < lower Then { color_t = color_t_dn; trend = false; market_state = "Momentum Down"; } // -----------------------------------} // VISUALIZATIONS // -----------------------------------{ plot1(avgv, "MidLine",color_t); plot2(upper, "Upper"); plot3(lower, "Lower");
프로필 이미지
라몬
2025-08-05
832
글번호 193020
지표
답변완료

트레이닝 궁굼합니다. 가능할까요?

아래 지표설정대로 제가 지정하는 종목에(1개~다수) 대해서 일봉기준으로 매매하고 싶습니 다. 1. 매수후 중복으로 나오는 매수신호는 무시 2. 지정하는 종목(1~다수) 3. 매도신호시 청산(통합주문2101에서 해도 무방한가요?) 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); plot1(zlma, "ZLMA",zlma_color); // Plot ZLMA plot2(emaValue,"EMA",ema_col); if signalUp Then { Top = zlma; BTM = zlma-A; box = box_new(sDate,sTime,Top,NextBarSdate,NextBarStime,BTM); Box_SetColor(box,up); Box_SetFill(box,true); var3 = (Top+BTM)/2; tx = Text_New(NextBarSdate,NextBarStime,var3,NumToStr(C,2)); Text_SetStyle(tx,1,2); } else if signalDn Then { Top = zlma+A; BTM = zlma; box = box_new(sDate,sTime,Top,NextBarSdate,NextBarStime,BTM); Box_SetColor(box,dn); Box_SetFill(box,true); var3 = (Top+BTM)/2; tx = Text_New(NextBarSdate,NextBarStime,var3,NumToStr(C,2)); Text_SetStyle(tx,1,2); } Else { Box_SetEnd(box,sDate,sTime,BTM); Text_SetLocation(tx,sDate,sTime,var3); } check_signals = signalUp or signalDn; if CrossDown(high, BTM) and emaValue > zlma Then { tx1 = Text_New(sDate[1],sTime[1],H[1],"▼"); Text_SetStyle(tx1,2,1); Text_SetColor(tx1,dn); } if CrossUp(low, Top) and emaValue < zlma Then { tx1 = Text_New(sDate[1],sTime[1],L[1],"▲"); Text_SetStyle(tx1,2,0); Text_SetColor(tx1,up); }
프로필 이미지
제너리
2025-08-05
642
글번호 193019
시스템