커뮤니티

예스랭귀지 Q&A

글쓰기
답변완료

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

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

종목검색식 부탁합니다

수고하십니다아래식을 수정하여주시기 바랍니다매월 첫봉부터 당월의 5번째 봉까지 선을 돌파하는 경우와매주 첫봉부터 그주 3번째 봉까지 선을 돌파하는 식을 만들어 보았습니다아래 종목검색식에 오류가 있는지 검토 바랍니다If Bdate>Bdate[1]+30 Then {var31=O; var32=var31[1]; var33=var32[1];}If sDate!=sDate[1] and DayOfWeek(sDate)<=DayOfWeek(sDate[1]) Then {var41 = O; var42 = var41[1]; var43 = var42[1];}var : a(0); If Bdate!=Bdate[1] Then a=0; a = a+1;var : b(0); If sdate!=sDate[1] Then b=0; b = b+1;Plot1(var31, "L", Lime);Plot2(var41, "R", Red);If var31<var32 && CrossUp(C,var31) && a<=5 or var41<var42 && CrossUp(C,var41) && b<=3) && C>O Then plot3(L, "C", Cyan);
프로필 이미지
등정
2026-06-08
46
글번호 232317
종목검색

졸던 님에 의해서 삭제되었습니다.

프로필 이미지
졸던
2026-06-08
8
글번호 232309
종목검색
답변완료

수고하십니다

항상 좋은 일만 있으시기 바랍니다미국시간(22시30분)을 기준으로 일간시고저/3 라인을 요청 합니다
프로필 이미지
2wnwn
2026-06-08
42
글번호 232308
지표
답변완료

문의드립니다

input : 익절틱수(40000),손절틱수(520);var : Ema100(0);ema100 = ema(close, 100);input : atrPeriod(10),factor(3);var : src(0), alpha(0),ATRV(0),upperBand(0),lowerBand(0),direction(0),SuperTrend(C);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 + factor * AtrV; lowerBand = src - factor * 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 : R(0),A(0),longCondition(False),shortCondition(False);R = rsi(14);A = adx(14);longCondition = close > ema100 and direction > 0 and R > 50 and A > 25;shortCondition = close < ema100 and direction < 0 and R <50 and A > 25;var : S3(0);if longCondition == true ThenS3 = 1;if shortCondition == true ThenS3 = -1;input : atrMult(4.5);input : atrlen(12);input : rsmlen(3);input : tplen(14);var : i(0),sum(0),source(0);var : 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);}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),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),S2(0);if tp and trendDirection > 0 Then// ==========================================// 2. S2 슈퍼트렌드 & RSI 구간 점수 (수정본)// ==========================================// 기존의 CrossDown(R, 60) 대신 '구간' 점수로 변경하여 // 다른 지표(S1, S3)와 합산 점수를 맞추기 쉽게 만들었습니다.if trendDirection > 0 Then // 슈퍼트렌드 상승 구간{ if R > 50 Then S2 = 1; // RSI가 50 위면 매수 힘 우세 (+1점) Else S2 = 0;}else if trendDirection < 0 Then // 슈퍼트렌드 하락 구간{ if R < 50 Then S2 = -1; // RSI가 50 아래면 매도 힘 우세 (-1점) Else S2 = 0;}else{ S2 = 0;}// 차트 시각화용 (기존 X 표시는 그대로 둡니다)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);}// 1. 매수 진입: S2(RSI) + S3(표준슈트) 합이 2점일 때if MarketPosition <= 0 and (S2 + S3 == 2) Then Buy("매수");// 2. 매수 청산: 합이 0 이하로 떨어지면 (힘 빠지면 탈출)if MarketPosition == 1 and (S2 + S3 <= 0) Then ExitLong("매수청산");// 3. 매도 진입: 합이 -2점일 때 (둘 다 하락 신호)if MarketPosition >= 0 and (S2 + S3 == -2) Then Sell("매도");// 4. 매도 청산: 합이 0 이상으로 올라오면 (반등하면 탈출)if MarketPosition == -1 and (S2 + S3 >= 0) Then ExitShort("매도청산");SetStopProfittarget(PriceScale*익절틱수,PointStop);SetStopLoss(PriceScale*손절틱수,PointStop);수고많으십니다 문의드릴 내용은 위 수식은두신호 합산 2점 매수 -2점 매도 0점 청산이런 의도로 만들었는데 매도가 나오지가 않아 문의드립니다 점수 자체가 -2점이 안 나오는 구조인지뭐가 중복돼거나 진입 로직이 잘못 됀건지알수가 없어 문의드립니다 점수를 바뀌 매도를 억지로 나오게하면 현재 매수 거래가 꼬이고 잘 돼지 않습니다현재 매수 하나도 안 건드리고 매도 신호만 매수의 반대 의미로 진입 청산 가능한가요?부탁드리겠습니다 감사합니다
프로필 이미지
cjfdk
2026-06-08
64
글번호 232300
시스템
답변완료

지표식 부탁합니다

수고하십니다아래 식에 오류가 있는지 살펴주시고음봉은 종가, 양봉은 시가를 기준으로 선이 만들어진 식인데음봉이나 양봉 모두 시가를 기준으로 선이 만들어지도록 수정 부탁합니다Input : StartTime(90000),분(90);var : D1(0),TM(0),TF(0),OO(Nan);If (sdate!=sDate[1] and sTime>=StartTime) Then {D1 = sdate;}If D1>0 then {If sdate==D1 Then TM=TimeToMinutes(stime); Else TM=TimeToMinutes(stime)+1440; TF = TM%분; If Bdate!=Bdate[1] or (Bdate == Bdate[1] and 분 > 1 and TF < TF[1]) or (Bdate == Bdate[1] and 분 > 1 and TM >= TM[1]+분) or (Bdate == Bdate[1] and 분 == 1 and TM > TM[1]) Then {OO = iff(C>O,Open,Close);} var1 = OO; var2 = var1[1]; var3 = var2[1];}Plot1(var1, "T", Turquoise);
프로필 이미지
등정
2026-06-08
49
글번호 232299
지표
답변완료

수식문의

아래 수식은TRADING VIEW에서 SESSION VWAP으로 종가가 LOW3선(중심선-3표준편차) 돌파를 구하는 것입니다.이를 중심선돌파를 검색(전일종가대비 5%이상 상승하는 봉으로)하는 것으로 변경요청드립니다.(A)또, 지수이평처럼 그 중심선을 한번 더 평활화(?)하고, 그 "중심선값이 3봉(2봉전, 1봉전, 0봉)간 상승+5%상승종가가 0봉에 그 평활된 중심선돌파"하는 것을 검색하는 게 가능한가요?(현 중심선을 3봉간 상승으로 볼 시 나오는 속임수를 피하고자)(B) - (B)가 된다면 (A)는 생략 Input: SigMode(3), // 1=-1sig, 2=-2sig, 3=-3sig(표준), 4=+1sig, 5=+2sig, 6=+3sig WinLen(20), Mult1(1.0), Mult2(2.0), Mult3(3.0);Vars: src(0), pv(0), ppv(0), sumPV(0), sumVol(0), sumPPV(0), vwapVal(0), vrnc(0), stdv(0), up1(0), lo1(0), up2(0), lo2(0), up3(0), lo3(0), valid(false), hit(false);// ── 한 봉 값 + 롤링 합산 ──src = (H + L + C) / 3;pv = src * V;ppv = src * src * V;sumPV = AccumN(pv, WinLen);sumVol = AccumN(V, WinLen);sumPPV = AccumN(ppv, WinLen);valid = sumVol > 0;if valid then{ vwapVal = sumPV / sumVol; vrnc = sumPPV / sumVol - vwapVal * vwapVal; if vrnc < 0 then { vrnc = 0; } stdv = SqRt(vrnc);}else{ vwapVal = src; stdv = 0;}up1 = vwapVal + stdv * Mult1;lo1 = vwapVal - stdv * Mult1;up2 = vwapVal + stdv * Mult2;lo2 = vwapVal - stdv * Mult2;up3 = vwapVal + stdv * Mult3;lo3 = vwapVal - stdv * Mult3;// ── 신호 조건(지표와 동일 정의) ──// 하단(1~3): 저가<=밴드 이고 종가>밴드 (상승 반전)// 상단(4~6): 고가>=밴드 이고 종가<밴드 (하락 반전)hit = false;if valid then{ if SigMode == 1 then { if L <= lo1 and C > lo1 then { hit = true; } } else if SigMode == 2 then { if L <= lo2 and C > lo2 then { hit = true; } } else if SigMode == 3 then { // 표준: -3sig 하단밴드 반전 if L <= lo3 and C > lo3 then { hit = true; } } else if SigMode == 4 then { if H >= up1 and C < up1 then { hit = true; } } else if SigMode == 5 then { if H >= up2 and C < up2 then { hit = true; } } else { // SigMode == 6 (+3sig) if H >= up3 and C < up3 then { hit = true; } }}if hit then{ Find(1);}
프로필 이미지
ksks
2026-06-07
63
글번호 232297
종목검색
답변완료

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

*아래 수식을 참고하여,1. 수식2 ) 가 기준선 0 위에 있는 모든 종목 검색식 부탁드려요.2. 수식2) 가 기준선 0 위에있는 종목, 0봉전~5봉전 까지의 모든 종목 검색식 부탁드려요.---아래----수식1) A1 = eavg(C, 60); // var1 A2 = eavg(C, 120); // Var2 A3 = eavg(C, 200); // Var3수식2) // RSI 계산: rsi2(A1 - A2, 15) - 50 Diff = A1 - A2; // 상승/하락분 계산 Up = if(Diff > Diff(1), Diff - Diff(1), 0); Down = if(Diff < Diff(1), Diff(1) - Diff, 0); // 평균 (EMA로 근사) AvgUp = eavg(Up, 15); AvgDown = eavg(Down, 15); // RS 및 RSI RS1 = if(AvgDown != 0, AvgUp / AvgDown, 100); RSI1 = 100 - (100 / (1 + RS1)); shortTermXtrender = RSI1 - 50;수식3) // RSI 계산: rsi2(A3, 15) - 50 Up2 = if(A3 > A3(1), A3 - A3(1), 0); Down2 = if(A3 < A3(1), A3(1) - A3, 0); AvgUp2 = eavg(Up2, 15); AvgDown2 = eavg(Down2, 15); RS2 = if(AvgDown2 != 0, AvgUp2 / AvgDown2, 100); RSI2 = 100 - (100 / (1 + RS2)); longTermXtrender = RSI2 - 50;수식4) xe1 = eavg(shortTermXtrender, 5); xe2 = eavg(xe1, 5); xe3 = eavg(xe2, 5); xe4 = eavg(xe3, 5); xe5 = eavg(xe4, 5); xe6 = eavg(xe5, 5); // 가중 계산 maShortTermXtrender = -0.343 * xe6 + 1.029 * xe5 - 6.069 * xe4 + 4.913 * xe3;----------------------기준선 0
프로필 이미지
일지매7
2026-06-07
55
글번호 232296
종목검색
답변완료

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

1. 아래의 수식을 참조하여, " 수식 1) " 이 "수식 2)" 를 돌파할때 종목 검색식 부탁드려요 (첫봉만 검색)2. 아래의 수식을 참조하여, " 수식 1) " 이 "수식 2)" 를 돌파할때 (첫봉) 0봉전~5봉전까지의 모든 종목 검색식 부탁드려요 ---아래---- (수식1) fastMA = eavg(close, fastLength);slowMA = eavg(close, slowLength);macdv = fastMA - slowMA;(수식2) Stdv = stdev(macdv, length);Upper = (Stdv * dev + (ma(macdv, length)));(수식3) Stdv = stdev(macdv, length);Lower = ((ma(macdv, length)) - (Stdv * dev));(수식4) if(macdv < Upper , macdv, 0);(수식5) 지우기0-지표조건설정fastLength : 15SlowLength : 28length : 30dev : 2
프로필 이미지
일지매7
2026-06-07
47
글번호 232295
종목검색
답변완료

EMA 그리는 방식이 궁굼합니다.

안녕하세요.일반적으로 다른 HTS나 트레이딩뷰에서는 EMA를 기간값을 넣은 캔들만큼 생성된 후부터 그려지는데,예스트레이더는 예를들어서 차트로딩바수를 5000개로 하고 EMA의 기간값을 5000을 입력해도 첫 캔들부터 EMA가 그려집니다.재귀적으로 그려지는거 같은데, 내부에서 사용되는 EMA로직을 알고 싶습니다.
프로필 이미지
oni
2026-06-07
40
글번호 232294
지표