커뮤니티
예스랭귀지 Q&A
답변완료
[공지] 예스랭귀지 AI 어시스턴트, '예스나 AI' 출시 및 무료 체험 안내
안녕하세요, 예스스탁 입니다.복잡한 수식 공부 없이 여러분의 아이디어를 말하면 시스템 트레이딩 언어 예스랭귀지로 작성해주는 서비스예스나 AI(YesNa AI)가 출시되었습니다.지금 예스나 AI를 직접 경험해 보실 수 있도록 20크레딧(질문권 20회)를 무료로 증정해 드리고 있습니다.바로 여러분의 아이디어를 코드로 변환해보세요.--------------------------------------------------🚀 YesNa AI 핵심 기능- 지표식/전략식/종목검색식 생성: 자연어로 요청하면 예스랭귀지 문법에 맞는 코드를 작성합니다.- 종목검색식 변환 지원: K증권의 종목 검색식을 예스랭귀지로 변환 지원합니다.- 컴파일 검증: 작성된 코드가 실행 가능한지 컴파일러를 통해 문법 검증을 거쳐 결과물을 제공합니다.상세한 서비스 개요 및 활용 방법은 [서비스 소개 페이지]에서 확인하실 수 있습니다.▶ 서비스 소개 페이지: 바로가기서비스 사용 유의사항 및 결제 환불정책은 [이용약관]을 참고 부탁드립니다.▶ 서비스 이용약관: 바로가기💬 이용 문의사용 중 문의사항은 [프로그램 사용법 Q&A] 게시판에서 [예스나 AI] 카테고리를 설정 후 문의해 주시면 상세히 안내해 드리겠습니다.--------------------------------------------------앞으로도 AI를 활용한 다양한 트레이딩 기능들을 지속적으로 선보일 예정입니다.많은 관심과 기대 부탁드립니다.
2026-02-27
4318
글번호 230811
답변완료
종목검색식 부탁드립니다. _(_ _)_
항상 도와주심에 감사드립니다. _(_ _)_1봉전 29봉 에서 고가가 20프로 이상인 양봉이 어느 봉에서 나올지는 모르지만 2개 이상이 나오고 0봉전에서 마지막 고가 양봉의 시가, 몸통중심, 종가를 돌파하는 검색식을 각각 부탁드립니다.
2025-12-10
188
글번호 228824
답변완료
종목 검색식 부탁드립니다.
수고 하십니다.일봉상 캔들이 선을 통과시 검색할수 있도록 수식어 부탁 드립니다.
2025-12-10
185
글번호 228823
답변완료
문의드립니다
input : atrMult(4.5);input : atrlen(12);input : rsmlen(3);input : tplen(14);var : i(0),sum(0),source(0);var : alpha(0),atrValue1(0),upperLevel(0),lowerLevel(0);var : previousLowerLevel(0),previousUpperLevel(0);var : trendDirection(Nan),superTrendValue(Nan);var : previousTrend(0);if CurrentBar > 1 Then { sum = 0; for i = 0 to rsmlen-1 { sum = sum + c[i]*c[i]; } source = sqrt(sum/rsmlen); alpha = 1 / atrlen ; atrValue1 = IFf(IsNan(atrValue1[1]) == true, ma(TrueRange,atrlen) , alpha * TrueRange + (1 - alpha) * IFf(isnan(atrValue1[1])==true,0,atrValue1[1])); upperLevel = source + atrMult * atrValue1; lowerLevel = source - atrMult * atrValue1; previousLowerLevel = iff(isnan(lowerLevel[1])==true,0,lowerLevel[1]); previousUpperLevel = iff(isnan(upperLevel[1])==true,0,upperLevel[1]); // Ensure continuity of lower and upper bands lowerLevel = iff(lowerLevel > previousLowerLevel or source[1] < previousLowerLevel , lowerLevel , previousLowerLevel); upperLevel = iff(upperLevel < previousUpperLevel or source[1] > previousUpperLevel , upperLevel , previousUpperLevel); // Determine direction and SuperTrend previousTrend = superTrendValue[1]; // Initialize direction if IsNan(atrValue1[1]) == true Then trendDirection = 1; else if previousTrend == previousUpperLevel Then trendDirection = iff(source > upperLevel , -1 , 1); else trendDirection = iff(source < lowerLevel , 1 , -1); // Set SuperTrend value based on direction superTrendValue = iff(trendDirection == -1 , lowerLevel , upperLevel);}plot1(superTrendValue,"ST", iff(trendDirection > 0 , red,green));Plot2((C+O)/2,"bodyMiddle");var : dist(0),chg(0),lvlCol(0);var : tp1(0),tp2(0),tp3(0),tp4(0),tp5(0),tp6(0),tp7(0);var : printedtp1(0),printedtp2(0),printedtp3(0),printedtp4(0),printedtp5(0),printedtp6(0),printedtp7(0);dist = abs(close-superTrendValue);lvlCol = iff(trendDirection > 0 , red , green);var : key1(0);var : key2(0);var : key3(0);var : key4(0);var : key5(0);var : key6(0);var : key7(0);if CrossUp(trendDirection, 0) or CrossDown(trendDirection, 0) Then{ //TL_Delete(keys); printedtp1 = 0; printedtp2 = 0; printedtp3 = 0; printedtp4 = 0; printedtp5 = 0; printedtp6 = 0; printedtp7 = 0; chg = abs(superTrendValue-superTrendValue[1]); tp1 = superTrendValue[1] + IFF(trendDirection > 0 , -chg , chg); tp2 = superTrendValue[1] + IFF(trendDirection > 0 , -chg * 2 , chg * 2); tp3 = superTrendValue[1] + IFF(trendDirection > 0 , -chg * 3 , chg * 3); tp4 = superTrendValue[1] + IFF(trendDirection > 0 , -chg * 4 , chg * 4); tp5 = superTrendValue[1] + IFF(trendDirection > 0 , -chg * 5 , chg * 5); tp6 = superTrendValue[1] + IFF(trendDirection > 0 , -chg * 6 , chg * 6); tp7 = superTrendValue[1] + IFF(trendDirection > 0 , -chg * 7 , chg * 7); key1 = TL_new(sdate[1],stime[1],tp1, sDate,sTime, tp1); TL_SetColor(Key1,lvlCol); TL_SetSize(Key1,2); printedtp1 = 1;}Else TL_SetEnd(key1,sDate,sTime,TP1); var : u(0),d(0),alp(0),ur(0),dr(0),rs(0),R(0),tp(False);u = max(dist - dist[1], 0);d = max(dist[1] - dist, 0);alp = 1/tplen;ur = IFf(IsNan(ur[1]) == true, ma(u,tplen) , alp * u + (1 - alp) * IFf(isnan(ur[1])==true,0,ur[1]));dr = IFf(IsNan(dr[1]) == true, ma(d,tplen) , alp * d + (1 - alp) * IFf(isnan(dr[1])==true,0,dr[1]));rs = ur / dr;R = 100 - 100 / (1 + rs);tp = CrossDown(R, 60);var : extreme(0);var : extreme_tp1_dist(0);var : extreme_tp2_dist(0);var : extreme_tp3_dist(0);var : extreme_tp4_dist(0);var : extreme_tp5_dist(0);var : extreme_tp6_dist(0);var : extreme_tp7_dist(0);extreme = iff(trendDirection > 0 , low , high);extreme_tp1_dist = abs(extreme - tp1);extreme_tp2_dist = abs(extreme - tp2);extreme_tp3_dist = abs(extreme - tp3);extreme_tp4_dist = abs(extreme - tp4);extreme_tp5_dist = abs(extreme - tp5);extreme_tp6_dist = abs(extreme - tp6);extreme_tp7_dist = abs(extreme - tp7);var : tx(0);if tp and trendDirection > 0 Then{ tx = Text_New(sDate,sTime,L,"X"); Text_SetStyle(tx,2,0); Text_SetColor(tx,Red); Text_SetSize(tx,20); Text_SetBold(tx,1);}if tp and trendDirection < 0 Then{ tx = Text_New(sDate,sTime,H,"X"); Text_SetStyle(tx,2,1); Text_SetColor(tx,Green); Text_SetSize(tx,20); Text_SetBold(tx,1);}if printedtp2 == 0 and extreme_tp2_dist < extreme_tp1_dist Then{ key2 = TL_new(sdate[1],stime[1],tp2, sDate,sTime, tp2); TL_SetColor(Key2,lvlCol); TL_SetSize(Key2,2); printedtp2 = 1;}Else{ if printedtp2 == 1 Then TL_SetEnd(key2,sDate,sTime,TP2);}if printedtp3 == 0 and extreme_tp3_dist < extreme_tp2_dist Then{ key3 = TL_new(sdate[1],stime[1],tp3, sDate,sTime, tp3); TL_SetColor(Key3,lvlCol); TL_SetSize(Key3,2); printedtp3 = 1;}Else{ if printedtp3 == 1 Then TL_SetEnd(key3,sDate,sTime,TP3);}if printedtp4 == 0 and extreme_tp4_dist < extreme_tp3_dist Then{ key4 = TL_new(sdate[1],stime[1],tp4, sDate,sTime, tp4); TL_SetColor(Key4,lvlCol); TL_SetSize(Key4,2); printedtp4 = 1;}Else{ if printedtp4 == 1 Then TL_SetEnd(key4,sDate,sTime,TP4);}if printedtp5 == 0 and extreme_tp5_dist < extreme_tp4_dist Then{ key5 = TL_new(sdate[1],stime[1],tp5, sDate,sTime, tp5); TL_SetColor(Key5,lvlCol); TL_SetSize(Key5,2); printedtp5 = 1;}Else{ if printedtp5 == 1 Then TL_SetEnd(key5,sDate,sTime,TP5);}if printedtp6 == 0 and extreme_tp6_dist < extreme_tp5_dist Then{ key6 = TL_new(sdate[1],stime[1],tp6, sDate,sTime, tp6); TL_SetColor(Key6,lvlCol); TL_SetSize(Key6,2); printedtp6 = 1;}Else{ if printedtp6 == 1 Then TL_SetEnd(key6,sDate,sTime,TP6);}if printedtp7 == 0 and extreme_tp7_dist < extreme_tp6_dist Then{ key7 = TL_new(sdate[1],stime[1],tp7, sDate,sTime, tp7); TL_SetColor(Key7,lvlCol); TL_SetSize(Key7,2); printedtp7 = 1;}Else{ if printedtp7 == 1 Then TL_SetEnd(key7,sDate,sTime,TP7);}수고많으십니다 문의드릴 내용은 위 수식에서 Red색 X표시가 나오면매수진입 매도청산 Red색 X표시가 계속 나오면 최대 10개까지 계속 매수진입 Green색 X표시가 나오면매도진입 매수청산 Green색 X표시가 계속 나오면 최대 10개까지 계속 매도진입이런 수식을 부탁드립니다 감사합니다
2025-12-10
317
글번호 228821
답변완료
수정 부탁드립니다.
if ADX2 > 20 and C < Ema2 and OSC2 < 0 Then R = -1; Else R = 0;만약 여기에 R=+1 이란 조건을 추가하면 아래 와 같이 표현 하는게 맞는건가요? if ADX2 > 20 and C >Ema2 and OSC2 > 0 Then R = +1; if ADX2 > 20 and C < Ema2 and OSC2 < 0 Then R = -1; Else R = 0;1.전일 기준전일 봉이 음봉이면서전일 봉의 몸통 길이가 그 봉 전체 길이의 60% 이상이면서 최근 20일 평균 몸통보다 20% 이상 늘어난 장대음봉이다2.당일 기준3. 당일 저가는 전일 저점을 살짝만 깨고 올라온 상태 (전일 저가 대비 0.2% 이내에서만 아래로 이탈했다가 다시 올라온 상태)4. 당일 봉의 아래꼬리가 봉 전체 길이의 절반 이상이다.5. 당일 종가가 5일선 위로 올라왔다.위 1~5 조건을 모두 만족하면 A1 조건을 충족한 것으로 보고, 1.5점을 부여한다. 를 식으로 표현좀 부탁합니다.
2025-12-10
194
글번호 228820
답변완료
data2
안녕하세요? 5분봉이고 현재 장이 열려서 진행중인 상황에서 1. H2 = Data2(H) 또는 Data2(C) 의 오늘 현시점까지의 최고점, L2 = Data2(L) 또는 Data2(C)의 오늘 현시점까지의 최저점 일때, 이걸 어떻게 표현하고, H2, L2를 선언할 때에는 어떻게 하나요?2. H3 = (-Data3(C)+100)의 오늘 현시점까지의최고점, L3 = (-Data3(C)+100)의 오늘 현시점까지의최 저점 일때, 이걸 어떻게 표현하고, H3, L3를 선언할 때에는 어떻게 하나요? 3. H4 = (2*Data2(C)-3*Data3(C))의 오늘 현시점까지의최고점, L4 = (2*Data2(C)-3*Data3(C))의 오늘 현시점까지의 최저점 일때, 이걸 어떻게 표현하고, H4, L4를 선언할 때에는 어떻게 하나요? 감사합니다.
2025-12-10
160
글번호 228819
답변완료
부탁드립니다
1. 종가가 양봉이면서 20일선 위에 있을 때, 직전 20일선 최고가와 직전전 20일선 최고가와 서로 연결하는 우측 추세선을, 또 직전전 20일선 최고가와 직전전전 20일선 최고가를 서로 연결하는 우측추세선을, 또 직전전전 20일선 최고가와 직전전전전 20일선 최고가와 서로 연결하는 우측추세선(이런 식으로 직전 최고가끼리 서로 연결하는 5개 정도 우측추세선,n))과 동시에 각 직전 최고가를 기준삼아서 수평 우측추세선으로 5개정도(갯수조정가능, n) 나타나도록 구현해 주세요 또한 종가가 음봉이면서 20일선 아래에 있을 때, 직전 20일선 최저가와 직전전 20일선 최저가를 연결하는 우측추세선을, 또 직전전 20일선 최저가와 직전전전 20일선 최저가를 서로 연결하는 우측추세선을, 또 직전전전 20일선 최저가와 직전전전전 20일선 최저가를 서로 연결하는 우측추세선(이런 식으로 직전 최저가끼리 서로 연결하는 5개정도 우측추세선,n)과 동시에 각 직전 최저가를 기준삼아서 수평우측추세선으로 5개정도(갯수조정가능, n) 나타나도록 구현해 주세요고맙습니다.
2025-12-09
153
글번호 228818
답변완료
iM증권 예스랭귀지 입문 5강의 교육자료를 다운로드하면 글자가 깨져서 나오므로 조치요청
예스랭귀지 입문 클랜스 1강에서 4강까지는 명쾌한 강사님의 설명의 이해할 수있었는데요, 5강에서 자료받기가 안되어서 멈춘상태이예요. 부득이 이곳에 질문하여도움요청합니다.iM증권 예스랭귀지 입문의 입문 클래스 5강에서 교육 배포자료 링크로 이동한 후교육 배포자료 링크 : https://help.yesstock.com/im/class12. 코드(수식) 다운로드의 SuperTrend 지표식 다운로드를 하려고 하나 안되요.SuperTrend 지표식 다운로드#교육_SuperTrend_지표_IM.yin지표식 저장경로C:\예스트레이더\YesLang\Indicators강사님은 SuperTrend 지표식(#교육_SuperTrend_지표_IM.yin)을 다운로드 하여이곳(C:\예스트레이더\YesLang\Indicators)에 저장하라고 하는데지표식(#교육_SuperTrend_지표_IM.yin)을 클릭하면 글자가 깨져서 나와요.--------------------- 글자가 깨져서 화면에 표시되는 예 -------------------------------������]�I��� �/zs���_��k��.�_����e�c7ď�l8���ɥn���jy�9�I L�N�e���4X�)��물론 "3. 코드 복사"로 가면 "SuperTrend 지표식 예제"에 "자바스크립트"가 있기는 하나자바스크립트를 복사하여 "#교육_SuperTrend_지표_IM.yin"로 저장하고 싶은데확장자를 ".yin"으로 저장하는 방법을 몰라 저장할 수 없어요.질문요약 1. SuperTrend 지표식이 정상적으로 다운로드 할 수 있도록 조치요청함. 2. 코드복사기능으로 자바스크립트를 "****.yin"파일로 저장할 수 있는 방법 요청함. 이 질문은 SuperTrend 전략식, 자동주문 예스스팟 다운로드에도 동일하게 적용됩니다.
2025-12-09
2348
글번호 228817
답변완료
228766 재문의
안녕하세요? 지난번 문의에 대한 답변 중 앞부분이 잘 이해가 안갑니다. 왜 이렇게 수식이 복잡해져야 하는지도 잘 이해가 안가서요... 이해가 잘 안가는 그 앞부분을 아래에 복사해 놓았습니다.특히 sDate, sDate[1], sTime, sTime[1], Bdate?, Bdate[1]? 이런 것들의 정의를 어디서 볼 수 있나요?뭐 느낌은 있는데, 정확한 정의를 잘 모르겠습니다.참 그리고, 제대로 작동하지 않습니다. 그림을 보시면, 아래의 지표에서 파란색이 매수신호, 빨간색이 매도신도, 회색은 무포로 있어야 하는 신호인데, N = 9 즉, 하루 9번의 매매를 허락했는데도 매매횟수가 턱없이 모자랍니다. 이 부분도 수정 부탁드립니다.input : N(3),st(2),tp(3),tl(1),t2(2); input : starttime(92000),Endtime(144000),Xtime(152000); var : Tcond(False),TT(0),T1(0),entry(0); TT = TotalTrades; IF Xtime > starttime Then SetStopEndofday(Xtime); Else { if sDate != sDate[1] Then SetStopEndofday(Xtime); } if (sdate != sDate[1] and sTime >= Endtime) or (sdate == sDate[1] and sTime >= Endtime and sTime[1] < Endtime) Then { Tcond = False; } if (sdate != sDate[1] and sTime >= starttime) or (sdate == sDate[1] and sTime >= starttime and sTime[1] < starttime) Then { Tcond = true; T1 = TT[1]; IF Xtime <= starttime Then { SetStopEndofday(0); } } entry = TT-T1+IFF(MarketPosition != 0,1,0); 요 부분에 대해서 간단히 주석이나 설명 좀 부탁드리고 싶습니다.감사합니다.
2025-12-09
314
글번호 228816
답변완료
변환 부탁 드립니다.
// © Zeiierman { //@version=6 indicator('Dynamic Swing Anchored VWAP (Zeiierman)', overlay = true, max_bars_back = 5000, max_labels_count = 500, max_polylines_count = 100) //~~}// ~~ Tooltips { var string t1 = "Number of bars used to detect swing highs and lows. Larger values identify bigger, more significant swings but react slower. Smaller values detect more frequent swings but may produce more noise." var string t2 = "Controls how quickly the VWAP adjusts to new price action. Lower values make the VWAP react faster (tighter to price), higher values make it smoother and slower to change." var string t3 = "When enabled, the VWAP reaction speed changes automatically based on market volatility. High volatility shortens the tracking period (more responsive), low volatility lengthens it (smoother)." var string t4 = "Controls how strongly volatility influences the VWAP reaction speed. Values above 1 increase the effect of volatility changes; values below 1 make it less sensitive to volatility." var string t5 = "Color used for swing high/low labels drawn on the chart to indicate pivot points." var string t6 = "Color used for swing low labels when marking pivot points." var string t7 = "Color used for VWAP lines when in an uptrend." var string t8 = "Color used for VWAP lines when in a downtrend." var string t9 = "Width of the VWAP lines drawn on the chart. Larger values make the lines thicker and more visible." //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~}// ~~ Inputs { prd = input.int(50, title='Swing Period', minval=2, group='Swing Points', tooltip=t1) baseAPT = input.float(20, 'Adaptive Price Tracking', minval=1, step=1, group='Swing Points', tooltip=t2) useAdapt = input.bool(false, 'Adapt APT by ATR ratio', group='Swing Points', tooltip=t3) volBias = input.float(10.0, 'Volatility Bias', minval=0.1, step=0.1, group='Swing Points', tooltip=t4)highS = input.color(color.lime, title="Swing Labels", group="Style", inline="Swing", tooltip=t5) lowS = input.color(color.red, title="", group="Style", inline="Swing", tooltip=t6) S = input.color(color.lime, title="VWAP Lines", group="Style", inline="VWAP", tooltip=t7) R = input.color(color.red, title="", group="Style", inline="VWAP", tooltip=t8) xx = input.int(2, minval=1, title="", group="Style", inline="VWAP", tooltip=t9) //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~}// ~~ Global Variable { b = bar_index //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~}// ~~ PIVOTS Variables { var ph = float(na) var pl = float(na) var phL = b var plL = b var lab = label(na) var prev = float(na)ph := ta.highestbars(high, prd) == 0 ? high : ph pl := ta.lowestbars(low, prd) == 0 ? low : pl phL := ta.highestbars(high, prd) == 0 ? b : phL plL := ta.lowestbars(low, prd) == 0 ? b : plL dir = phL > plL ? 1 : -1 //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~}// ~~ Adaptation { atrLen = 50 atr = ta.atr(atrLen) atrAvg = ta.rma(atr, atrLen) ratio = atrAvg > 0 ? atr / atrAvg : 1.0aptRaw = useAdapt ? baseAPT / math.pow(ratio, volBias) : baseAPT aptClamped = math.max(5.0, math.min(300.0, aptRaw)) aptSeries = math.round(aptClamped)// alpha from APT (half-life -> EWMA alpha) alphaFromAPT(apt) => decay = math.exp(-math.log(2.0) / math.max(1.0, apt)) 1.0 - decay //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~}// ~~ VWAP Variables { var p = hlc3 * volume var vol = volume type dataPoints array<chart.point> points polyline poly = navar vwap = dataPoints.new(array.new<chart.point>()) //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~}// ~~ Main { if dir != dir[1] x = dir > 0 ? plL : phL y = dir > 0 ? pl : ph loc = dir > 0 ? label.style_label_up : label.style_label_down col = dir > 0 ? highS : lowS txt = dir > 0 and pl < prev ? 'LL' : dir > 0 and pl > prev ? 'HL' : dir < 0 and ph < prev ? 'LH' : dir < 0 and ph > prev ? 'HH' : '' label.new(x, y, text=txt, style=loc, color=color.new(col, 20), textcolor=color.white) prev := dir > 0 ? ph[1] : pl[1] barsback = b - x p := y * volume[barsback] vol := volume[barsback] vap = p / vol vwap.poly.delete() polyline.new(vwap.points, false, false, line_color = dir < 0 ? R : S, line_width = xx) vwap.points.clear() for i = barsback to 0 by 1 apt_i = aptSeries[i] alpha = alphaFromAPT(apt_i) pxv = hlc3[i] * volume[i] v_i = volume[i] p := (1.0 - alpha) * p + alpha * pxv vol := (1.0 - alpha) * vol + alpha * v_i vappe = vol > 0 ? p / vol : na vwap.points.push(chart.point.from_index(b - i, vappe)) vwap.poly := polyline.new(vwap.points, false, false, line_color = dir < 0 ? R : S, line_width = xx)else apt_0 = aptSeries alpha = alphaFromAPT(apt_0) pxv = hlc3 * volume v0 = volume p := (1.0 - alpha) * p + alpha * pxv vol := (1.0 - alpha) * vol + alpha * v0 vap = vol > 0 ? p / vol : na vwap.poly.delete() vwap.points.push(chart.point.from_index(b, vap)) vwap.poly := polyline.new(vwap.points, false, false, line_color = dir > 0 ? R : S, line_width = xx) //~~ }
2025-12-09
888
글번호 228815