커뮤니티

예스랭귀지 Q&A

글쓰기

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

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

문의 드립니다.

도움에 감사 드립니다.사용자 함수를 만들려고 하지만 되지 않습니다."사용자함수 내에서 Function - End Function 구문을 사용할 수 없습니다" 라고 뜹니다"사용자 함수로 부탁 드립니다.미리 감사 드립니다. input : len(88),mult(2.0);var : src(0),crr(0),k(0),sum(0),i(0),dev(0);var : nmid(0),nupper(0),nlower(0);var : upper(0),lower(0);Array : dizii[500](0);src = (h+l+c)/3;Function cr Numeric input : x(Numeric),y(Numeric); var : z(0),weight(0),i(0); z = 0.0; weight = 0.0; for i = 0 to y - 1 step 1 { z = z + x[i] * ((y - 1) / 2 + 1 -abs(i - (y - 1) / 2)); } cr = z / ((y + 1) / 2 * (y + 1) / 2);EndFunctioncrr = cr(src, 2 * len - 1);for k = 0 to len - 1 step 1{ sum = 0.0; for i = 0 to 2 * len - 2 - k step 1 { sum = sum + (len - abs(len - 1 - k - i)) * src[i] / (len * len - k * (k + 1) / 2); } dizii[k] = sum;}dev = mult * std(src, len);nmid = wma(src, len);nupper = nmid + wma(dev,len);nlower = nmid - wma(dev,len);upper = crr + cr(dev, 2 * len - 1);lower = crr - cr(dev, 2 * len - 1);var1=(upper+lower)/2;
프로필 이미지
yes
2025-11-17
122
글번호 228136
사용자 함수
답변완료

볼밴드

월봉에서 년봉 검색식으로 볼린져 5밴드가 상단 하단 반전 되는 종목 검색 부탁드립니다 상단하단 반전이 계속 유지되면 계속 검색이 될수 있게 해주세요
프로필 이미지
하람푸름마음
2025-11-17
139
글번호 228135
종목검색
답변완료

제조회 안합니다

오전 기다리면 시작전 후 의 사진입니다 오후 8시50분되어도 그대로있어요 가끔 이런 현상 이 있네요 제조회시 없어지지만 자동 하는사람 입니다 수리해주세요 그림이 0부터 올라온 그림으로 보여주고있네요 수리해주십시요 대단히 감사합니다
프로필 이미지
놀이터
2025-11-17
147
글번호 228134
시스템
답변완료

종목 검색식 부탁드립니다.

수고 많으십니다. 첨부 파일에 있는파일 수식어 전환부탁드립니다.
프로필 이미지
치치야
2025-11-17
166
글번호 228132
종목검색
답변완료

문의 드립니다.

안녕하세요?내가 입력하는 시간을 수직선으로 그려주는 선을 만들 수 있을까요?9시를 입력하면, 9시에 수직선, 3시로 입력하면 또 수직선요.답변 감사합니다.
프로필 이미지
alltoone
2025-11-17
131
글번호 228131
지표
답변완료

문의드립니다.

/*스윙 고/저점을 이용한 자동 추세선 생성 + 추세선 돌파 매수·매도 시스템*/input : len(1); var : sh1(0), sh2(0), shBar1(0), shBar2(0);var : sl1(0), sl2(0), slBar1(0), slBar2(0);var : TL_HighVal1(0), TL_HighVal2(0);var : TL_LowVal1(0), TL_LowVal2(0);var : highTrend(0), lowTrend(0);// 최근 두 스윙고점sh1 = SwingHigh(1, H, len, len, 100);sh2 = SwingHigh(2, H, len, len, 100);shBar1 = SwingHighBar(1, H, len, len, 100);shBar2 = SwingHighBar(2, H, len, len, 100);// 최근 두 스윙저점sl1 = SwingLow(1, L, len, len, 100);sl2 = SwingLow(2, L, len, len, 100);slBar1 = SwingLowBar(1, L, len, len, 100);slBar2 = SwingLowBar(2, L, len, len, 100);// ① 하락추세선 공식 : 두 스윙고점을 연결한 직선의 현재봉 y값if shBar2 > shBar1 and sh1 > 0 and sh2 > 0 then{ TL_HighVal1 = H[shBar2]; TL_HighVal2 = H[shBar1]; highTrend = TL_HighVal2 + (TL_HighVal1 - TL_HighVal2) * (shBar1) / (shBar2 - shBar1);}// ② 상승추세선 공식 : 두 스윙저점을 연결한 직선의 현재봉 y값if slBar2 > slBar1 and sl1 > 0 and sl2 > 0 then{ TL_LowVal1 = L[slBar2]; TL_LowVal2 = L[slBar1]; lowTrend = TL_LowVal2 + (TL_LowVal1 - TL_LowVal2) * (slBar1) / (slBar2 - slBar1);}if C > highTrend and C[1]<= highTrend[1] then{ Buy("추세상향돌파");}if marketposition == 1 then{ exitlong("롱청산",AtStop,low[1]);}######################################################################################################// ? 하락추세선(스윙고점 연결)if shBar2 > shBar1 and sh1 > 0 and sh2 > 0 then{ TL_High = TL_New( sdate[shBar2], stime[shBar2], H[shBar2], sdate[shBar1], stime[shBar1], H[shBar1] ); TL_SetColor(TL_High, Red); TL_SetSize(TL_High, 2);}// ? 상승추세선(스윙저점 연결)if slBar2 > slBar1 and sl1 > 0 and sl2 > 0 then{ TL_Low = TL_New( sdate[slBar2], stime[slBar2], L[slBar2], sdate[slBar1], stime[slBar1], L[slBar1] ); TL_SetColor(TL_Low, Green); TL_SetSize(TL_Low, 2);}########################################################################질문1. 추세선이 왜 중간에 끊어지는지 모르겠습니다. swinghigh를 연결하며 이어져야 할것 같은데 말입니다. 질문2. 진입이 왜 저기서 일어나는지 모르겠습니다. 빨간선을 크로스업했을때 진입을 의도한것인데...질문3. 청산이 왜 2봉전 저가에서 일어나는지 모르겠습니다. 코드는 1봉전 저가인데...항상 감사드립니다.
프로필 이미지
시고르시고르
2025-11-17
173
글번호 228129
시스템
답변완료

글번호 228046의 추가문의

답변내용에 더해서 시장가주문을 냈으나 특별한 이벤트 발생해서 주문거부나 주문자체가 없어진 경우 30초 뒤에 2차 시장가 주문 하고 역시 미체결이면 30초뒤 다시 3차 시장가 주문 을 내는 식을 추가해서 부탁드립니다.(3차까지 나가면 거의 체결될듯 합니다.)
프로필 이미지
산수유
2025-11-17
136
글번호 228128
시스템
답변완료

변환 부탁 드립니다.

//트레이딩 뷰 지표입니다....변환 부탁드립니다.//@version=5indicator('[@btc_charlie] Trader XO Macro Trend Scanner', overlay=true)// Variablesvar ok = 0var countBuy = 0var countSell = 0src = input(close, title='OHLC Type')i_fastEMA = input(12, title='Fast EMA')i_slowEMA = input(25, title='Slow EMA')i_defEMA = input(25, title='Consolidated EMA')// Allow the option to show single or double EMAi_bothEMAs = input(title='Show Both EMAs', defval=true)// Define EMAsv_fastEMA = ta.ema(src, i_fastEMA)v_slowEMA = ta.ema(src, i_slowEMA)v_biasEMA = ta.ema(src, i_defEMA)// Color the EMAsemaColor = v_fastEMA > v_slowEMA ? color.green : v_fastEMA < v_slowEMA ? color.red : #FF530D// Plot EMAsplot(i_bothEMAs ? na : v_biasEMA, color=emaColor, linewidth=3, title='Consolidated EMA')plot(i_bothEMAs ? v_fastEMA : na, title='Fast EMA', color=emaColor)plot(i_bothEMAs ? v_slowEMA : na, title='Slow EMA', color=emaColor)// Colour the barsbuy = v_fastEMA > v_slowEMAsell = v_fastEMA < v_slowEMAif buy countBuy += 1 countBuyif buy countSell := 0 countSellif sell countSell += 1 countSellif sell countBuy := 0 countBuybuysignal = countBuy < 2 and countBuy > 0 and countSell < 1 and buy and not buy[1]sellsignal = countSell > 0 and countSell < 2 and countBuy < 1 and sell and not sell[1]barcolor(buysignal ? color.green : na)barcolor(sellsignal ? color.red : na)// Plot Bull/Bearplotshape(buysignal, title='Bull', text='Bull', style=shape.triangleup, location=location.belowbar, color=color.new(color.green, 0), textcolor=color.new(color.black, 0), size=size.tiny)plotshape(sellsignal, title='Bear', text='Bear', style=shape.triangledown, location=location.abovebar, color=color.new(color.red, 0), textcolor=color.new(color.black, 0), size=size.tiny)bull = countBuy > 1bear = countSell > 1barcolor(bull ? color.green : na)barcolor(bear ? color.red : na)// Set Alertsalertcondition(ta.crossover(v_fastEMA, v_slowEMA), title='Bullish EMA Cross', message='Bullish EMA crossover')alertcondition(ta.crossunder(v_fastEMA, v_slowEMA), title='Bearish EMA Cross', message='Bearish EMA Crossover')// Stoch RSI codesmoothK = input.int(3, 'K', minval=1)smoothD = input.int(3, 'D', minval=1)lengthRSI = input.int(14, 'RSI Length', minval=1)lengthStoch = input.int(14, 'Stochastic Length', minval=1)rsi1 = ta.rsi(src, lengthRSI)k = ta.sma(ta.stoch(rsi1, rsi1, rsi1, lengthStoch), smoothK)d = ta.sma(k, smoothD)bandno0 = input.int(80, minval=1, title='Upper Band', group='Bands (change this instead of length in Style for Stoch RSI colour to work properly)')bandno2 = input.int(50, minval=1, title='Middle Band', group='Bands (change this instead of length in Style for Stoch RSI colour to work properly)')bandno1 = input.int(20, minval=1, title='Lower Band', group='Bands (change this instead of length in Style for Stoch RSI colour to work properly)')// AlertscrossoverAlertBgColourMidOnOff = input.bool(title='Crossover Alert Background Colour (Middle Level) [ON/OFF]', group='Crossover Alerts', defval=false)crossoverAlertBgColourOBOSOnOff = input.bool(title='Crossover Alert Background Colour (OB/OS Level) [ON/OFF]', group='Crossover Alerts', defval=false)crossoverAlertBgColourGreaterThanOnOff = input.bool(title='Crossover Alert >input [ON/OFF]', group='Crossover Alerts', defval=false)crossoverAlertBgColourLessThanOnOff = input.bool(title='Crossover Alert <input [ON/OFF]', group='Crossover Alerts', defval=false)maTypeChoice = input.string('EMA', title='MA Type', group='Moving Average', options=['EMA', 'WMA', 'SMA', 'None'])maSrc = input.source(close, title='MA Source', group='Moving Average')maLen = input.int(200, minval=1, title='MA Length', group='Moving Average')maValue = if maTypeChoice == 'EMA' ta.ema(maSrc, maLen)else if maTypeChoice == 'WMA' ta.wma(maSrc, maLen)else if maTypeChoice == 'SMA' ta.sma(maSrc, maLen)else 0crossupCHECK = maTypeChoice == 'None' or open > maValue and maTypeChoice != 'None'crossdownCHECK = maTypeChoice == 'None' or open < maValue and maTypeChoice != 'None'crossupalert = crossupCHECK and ta.crossover(k, d) and (k < bandno2 or d < bandno2)crossdownalert = crossdownCHECK and ta.crossunder(k, d) and (k > bandno2 or d > bandno2)crossupOSalert = crossupCHECK and ta.crossover(k, d) and (k < bandno1 or d < bandno1)crossdownOBalert = crossdownCHECK and ta.crossunder(k, d) and (k > bandno0 or d > bandno0)aboveBandalert = ta.crossunder(k, bandno0)belowBandalert = ta.crossover(k, bandno1)bgcolor(color=crossupalert and crossoverAlertBgColourMidOnOff ? #4CAF50 : crossdownalert and crossoverAlertBgColourMidOnOff ? #FF0000 : na, title='Crossover Alert Background Colour (Middle Level)', transp=70)bgcolor(color=crossupOSalert and crossoverAlertBgColourOBOSOnOff ? #fbc02d : crossdownOBalert and crossoverAlertBgColourOBOSOnOff ? #000000 : na, title='Crossover Alert Background Colour (OB/OS Level)', transp=70)bgcolor(color=aboveBandalert and crossoverAlertBgColourGreaterThanOnOff ? #ff0014 : crossdownalert and crossoverAlertBgColourMidOnOff ? #FF0000 : na, title='Crossover Alert - K > Upper level', transp=70)bgcolor(color=belowBandalert and crossoverAlertBgColourLessThanOnOff ? #4CAF50 : crossdownalert and crossoverAlertBgColourMidOnOff ? #FF0000 : na, title='Crossover Alert - K < Lower level', transp=70)alertcondition(crossupalert or crossdownalert, title='Stoch RSI Crossover', message='STOCH RSI CROSSOVER')
프로필 이미지
다올
2025-11-17
298
글번호 228127
지표
답변완료

글번호 228073 번 추가 문의

앞서 글번호 228073 번에 아래 식을 주셨는데, 그럼 atr 을 500이 아니라 300으로 해서 30일치를 검색하는 식으로 부탁드립니다.1번과 2번으로 나눠 주셨는데, 어떻게 사용하는 것일까요?사용자 함수까지 조건식에 넣어서, 종목검색 창에 붙여 넣으면 되게 부탁드립니다.1 . 사용자함수함수명 : RngCheck반환값형 : 숫자형input : 기준(Numeric),범위(Numeric);var : C0(0),C1(0),C2(0),C3(0),C4(0);var : C5(0),C6(0),C7(0),C8(0),C9(0);var : C10(0),C11(0),C12(0),C13(0),C14(0);var : C15(0),C16(0),C17(0),C18(0),C19(0);C0=IFF(abs(C-기준)>범위,1,0); C1=IFF(abs(C[1]-기준)>범위,1,0); C2=IFF(abs(C[2]-기준)>범위,1,0); C3=IFF(abs(C[3]-기준)>범위,1,0); C4=IFF(abs(C[4]-기준)>범위,1,0); C5=IFF(abs(C[5]-기준)>범위,1,0); C6=IFF(abs(C[6]-기준)>범위,1,0); C7=IFF(abs(C[7]-기준)>범위,1,0); C8=IFF(abs(C[8]-기준)>범위,1,0); C9=IFF(abs(C[9]-기준)>범위,1,0); C10=IFF(abs(C[10]-기준)>범위,1,0); C11=IFF(abs(C[11]-기준)>범위,1,0); C12=IFF(abs(C[12]-기준)>범위,1,0); C13=IFF(abs(C[13]-기준)>범위,1,0); C14=IFF(abs(C[14]-기준)>범위,1,0); C15=IFF(abs(C[15]-기준)>범위,1,0); C16=IFF(abs(C[16]-기준)>범위,1,0); C17=IFF(abs(C[17]-기준)>범위,1,0); C18=IFF(abs(C[18]-기준)>범위,1,0); C19=IFF(abs(C[19]-기준)>범위,1,0); RngCheck = C0+C1+C2+C3+C4+C5+C6+C7+C8+ C9+C10+C11+C12+C13+C14+C15+C16+C17+C18+C19;2input : 기간(1),Rt(1),배수(1);var : at(0),mm(0),rg(0),chk(0),Range중(False),Range거래량(0);var : 전체합(0),Range봉수(0),평균거래량(0);var : 상단(0),양봉(False),돌파(False),거래량급증(False);var : A(0),b1(0),d(0),e(0),f(0),g(0),k(0),j(0),t(0),y(0),r(0),q(0);var : 볼밴라인(0),볼밴돌파(False),볼밴위(False);At = ATR(500);Mm = avg(C, 기간);Rg = At * Rt / 10;Chk = RngChk(Mm, Rg);Range중 = Chk == 0;Range거래량 = iff(Range중, V, 0);전체합 = Accum(Range거래량);Range봉수 = Accum(iff(Range중,1,0));평균거래량 = 전체합 / Range봉수;상단 = Mm + Rg;양봉 = C > O;돌파 = C > 상단;거래량급증 = V > 평균거래량 * 배수;A = BollBandUp(20, 2);B1 = Ema(A, 56);D = BollBandUp(40, 2);E = Ema(D, 56);F = BollBandUp(60, 2);G = Ema(F, 56);K = BollBandUp(90, 2);J = Ema(K, 56);T = BollBandUp(100, 2);Y = Ema(T, 56);R = (B1 + E + G + J + Y) / 5;Q = (C - O) / 3;볼밴라인 = iff(C > O, R - Q, R);볼밴돌파 = H > 볼밴라인;볼밴위 = C > 볼밴라인;if Range중[1] == true && 돌파 && 양봉 && 거래량급증 && (볼밴돌파 or 볼밴위) then var1 = sDate;Else var1 = 0;if CountIf(var1>0,30) >= 1 then Find(var1);
프로필 이미지
마을
2025-11-17
186
글번호 228125
사용자 함수