커뮤니티
예스랭귀지 Q&A
답변완료
[공지] 예스랭귀지 AI 어시스턴트, '예스나 AI' 출시 및 무료 체험 안내
안녕하세요, 예스스탁 입니다.복잡한 수식 공부 없이 여러분의 아이디어를 말하면 시스템 트레이딩 언어 예스랭귀지로 작성해주는 서비스예스나 AI(YesNa AI)가 출시되었습니다.지금 예스나 AI를 직접 경험해 보실 수 있도록 20크레딧(질문권 20회)를 무료로 증정해 드리고 있습니다.바로 여러분의 아이디어를 코드로 변환해보세요.--------------------------------------------------🚀 YesNa AI 핵심 기능- 지표식/전략식/종목검색식 생성: 자연어로 요청하면 예스랭귀지 문법에 맞는 코드를 작성합니다.- 종목검색식 변환 지원: K증권의 종목 검색식을 예스랭귀지로 변환 지원합니다.- 컴파일 검증: 작성된 코드가 실행 가능한지 컴파일러를 통해 문법 검증을 거쳐 결과물을 제공합니다.상세한 서비스 개요 및 활용 방법은 [서비스 소개 페이지]에서 확인하실 수 있습니다.▶ 서비스 소개 페이지: 바로가기서비스 사용 유의사항 및 결제 환불정책은 [이용약관]을 참고 부탁드립니다.▶ 서비스 이용약관: 바로가기💬 이용 문의사용 중 문의사항은 [프로그램 사용법 Q&A] 게시판에서 [예스나 AI] 카테고리를 설정 후 문의해 주시면 상세히 안내해 드리겠습니다.--------------------------------------------------앞으로도 AI를 활용한 다양한 트레이딩 기능들을 지속적으로 선보일 예정입니다.많은 관심과 기대 부탁드립니다.
2026-02-27
3183
글번호 230811
답변완료
만든 지표에 대한 종목 검색 문의드립니다.
안녕하세요
일봉상 상한가 전날 일봉 종가에 가로선 표기 수식 질문을 드렸었는데요
알려주신 수식은 아래와 같습니다.
input : 금액(10000000);
var : 상한가(0), UpLimit(0);
var : up1(0), up2(0), up3(0), up4(0), up5(0),up6(0),Up7(0);
if date >= 19981207 then {
if date < 20050328 && CodeCategory() == 2 then
UpLimit = (BP[0] * 1.12);
Else if date >= 20050328 and date < 20150615 Then
UpLimit = (BP[0] * 1.15);
Else
UpLimit = (BP[0] * 1.30);
if CodeCategory() == 2 then
{
if date >= 20030721 then
{
up1 = int(UpLimit/100+0.00001)*100;
up2 = int(UpLimit/100+0.00001)*100;
up3 = int(UpLimit/100+0.00001)*100;
up4 = int(UpLimit/50+0.00001)*50;
up5 = int(UpLimit/10+0.00001)*10;
up6 = int(UpLimit/5+0.00001)*5;
up7 = int(UpLimit/1+0.00001)*1;
}
else
{
up1 = int(UpLimit/1000+0.00001)*1000;
up2 = int(UpLimit/500+0.00001)*500;
up3 = int(UpLimit/100+0.00001)*100;
up4 = int(UpLimit/50+0.00001)*50;
up5 = int(UpLimit/10+0.00001)*10;
up6 = int(UpLimit/10+0.00001)*10;
up7 = int(UpLimit/1+0.00001)*1;
}
}
Else
{
up1 = int(UpLimit/1000+0.00001)*1000;
up2 = int(UpLimit/500+0.00001)*500;
up3 = int(UpLimit/100+0.00001)*100;
up4 = int(UpLimit/50+0.00001)*50;
up5 = int(UpLimit/10+0.00001)*10;
up6 = int(UpLimit/5+0.00001)*5;
up7 = int(UpLimit/1+0.00001)*1;
}
if CodeCategory() == 1 || CodeCategory() == 2 then
{
if sdate < 20101004 Then
{
If BP >= 500000 Then
상한가 = up1;
Else If BP >= 100000 Then
상한가 = iff(up2>=500000, up1, up2);
Else If BP >= 50000 Then
상한가 = iff(up3>=100000, up2, up3);
Else If BP >= 10000 Then
상한가 = iff(up4>=50000, up3, up4);
Else If BP >= 5000 Then
상한가 = iff(up5>=10000, up4, up5);
Else If BP >= 1000 Then
상한가 = iff(up5>=5000, up5, up6);
Else
상한가 = iff(up6>=1000, up6, up6);
}
Else
{
If BP >= 500000 Then
상한가 = up1;
Else If BP >= 100000 Then
상한가 = iff(up2>=500000, up1, up2);
Else If BP >= 50000 Then
상한가 = iff(up3>=100000, up2, up3);
Else If BP >= 10000 Then
상한가 = iff(up4>=50000, up3, up4);
Else If BP >= 5000 Then
상한가 = iff(up5>=10000, up4, up5);
Else If BP >= 1000 Then
상한가 = iff(up5>=5000, up5, up6);
Else
상한가 = iff(up6>=1000, up6, up7);
}
}
else if CodeCategory() == 8 || CodeCategory() == 9 then { // ETF
상한가 = up6;
}
}
var : TL(0);
if C >= 상한가 Then
{
var1 = Index;
TL_Delete(TL);
TL = TL_New(sDate[1],sTime[1],C[1],sDate,sTime,C[1]);
TL_SetExtRight(TL,true);
TL_SetExtLeft(TL,true);
TL_SetColor(TL,GREEN);
}
Else
{
if var1 > 0 and Index > var1+60 Then
TL_Delete(TL);
}
현재의 일봉이 선(이미지 파일 초록색 선)의 가격 범위 +5% ~ -10% 에 위치하고 있는
종목을 검색하고 싶습니다.
2021-10-20
1410
글번호 153010
답변완료
부탁드립니다
cci(-100),rsi(30) 이하로 내려간 종목을 검색할 수 있는 수식을 만들어 주실 수 있나요?
cci Period 는 9
rsi Period 는 14 입니다
2021-10-20
881
글번호 153009
답변완료
부탁 드립니다.
항상 도움 주셔서 감사 드립니다.
터주기(분봉)용으로 가능한지요?
inputs:Length( 20 ),sig(5) ;
variables:
XMean( 0 ), SumSqr( 0 ), Counter( 0 ), XVariance( 0 ) ;
if Length > 0 then
begin
XMean = ma(c, Length ) ;
SumSqr = 0 ;
for Counter = 0 to Length - 1
begin
SumSqr = SumSqr + Square( Price[Counter] - XMean ) ;
end ;
XVariance = SumSqr / Length ;
EStd = SquareRoot( XVariance ) ;
end
else
EStd = -1 ;
var1=ma(estd,sig);
참고용)
input : Ntime1(numeric),P(numeric),sig(numeric);
var : TF(0),S1(0),D1(0),TM(0),cnt(0),X(0),Y(0),sum(0);
Array : CC[101](0),OO[101](0),VV[101](0),V33[101](0);
if Bdate != Bdate[1] Then
{
S1 = TimeToMinutes(stime);
D1 = sdate;
}
if D1 > 0 then
{
if sdate == D1 Then
TM = TimeToMinutes(stime)-S1;
Else
TM = TimeToMinutes(stime)+1440-S1;
TF = TM%ntime1;
if Bdate != Bdate[1] or
(Bdate == Bdate[1] and Ntime1 > 1 and TF < TF[1]) or
(Bdate == Bdate[1] and Ntime1> 1 and TM >= TM[1]+Ntime1) or
(Bdate == Bdate[1] and Ntime1 == 1 and TM > TM[1]) Then
{
2021-10-20
702
글번호 153008
답변완료
시간함수 조정 문의드려요.
안녕하세요. 다음 수식으로 오일선물에 적용하려면 시간을 어떻게
바꿔야 하는지 부탁드립니다.
T=floor(time/10000);
조건=Crossup(time,065959) or (crossup(time,101459) && t>9 && t<=24);
2021-10-19
738
글번호 153007
답변완료
이격도 문의 드립니다
항상 너무 너무 감사 드립니다
다름이
아니라
이격도 문의 합니다
오늘 일봉상
이격도가 기준선 100 위에 있으면서
이격도 60 이 이격도 20 골든 크로스 한 종목을 검색해 줬으면 합니다
그리고 기준선 100 위든 아래든 20 60이 한몸이 되는 검색식은 없는지요?
이격이 없이 거의 붙어있는 한몸처럼~~ 있으면 이것 또한
부탁 합니다
사진 첨부
2021-10-19
850
글번호 153006
마지막행운 님에 의해서 삭제되었습니다.
2021-10-19
0
글번호 153005
답변완료
문의 드립니다.~
문의 드립니다~~`
1, 진입조건
예를 들어
- 10시정각(변수처리) 시가에서
10틱이상 하락하지않고 10틱이상 상승시에는
저가(10시 정각 시가부터 형성된)+10틱(변수처리)에
역추세 매도진입
- 10시정각(변수처리) 틱봉 시가에서
10틱 상승하지않고 10틱이상 하락시에는
고가(10시 정각 시가부터 형성된)+10틱에(변수처리)
역추세 매수진입
2, 청산조건
-매수시
익절청산은 10틱(변수처리)
손절청산은 10틱(변수처리)이상 손실(최소손실틱)후
10틱(변수처리) 손실감소(손실감소틱)되는 지점에서
청산되는 트레일링스탑
-매도시
익절청산은 10틱(변수처리)
손절청산은 10틱(변수처리)이상 손실(최소손실틱)후
10틱(변수처리) 손실감소(손실감소틱)되는 지점에서
청산되는 트레일링스탑
3, 재진입 조건
익절 또는 손절청산되는 지점에서 역추세(스위칭) 재진입
4, 강제청산
정해진 시간(변수처리)에 보유포지션 강제청산
도와 주시면 감사 하겠습니다.
건강하세요~~~~
2021-10-19
1094
글번호 153004
답변완료
문의 드립니다.
처음 수식에서 추가 하다보니 차트상 달라진 것이 있습니다.
이전 수식차트와 현재 수식 차트를 올려드리니 확인 부탁드립니다.
감사합니다.
아래는
현재 시스템 차트 수식입니다.
input : StartTime(101500),EndTime(114000);
input : Length(20), D1(2);
input : 익절1(30),손절1(30),청산구분시간(103000),익절2(50),손절2(30),익절연속횟수(3),손절연속횟수(2);
var : Tcond(false),profit(0),loss(0);
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;
profit = 0;
loss = 0;
}
if TotalTrades > TotalTrades[1] Then
{
if IsExitName("bp1.",1) or IsExitName("bp2.",21) or IsExitName("bp1",1) or IsExitName("bp2",21) or
IsExitName("sp1.",1) or IsExitName("sp2.",1) or IsExitName("sp1",1) or IsExitName("sp2",1) Then
profit = profit+1;
Else
profit = 0;
if IsExitName("bl1.",1) or IsExitName("bl2.",1) or IsExitName("bl1",1) or IsExitName("bl2",1) or
IsExitName("sl1.",1) or IsExitName("sl2.",1) or IsExitName("sl1",1) or IsExitName("sl2",1) Then
loss = loss+1;
Else
loss = 0;
}
var1 = BollBandUp(Length,D1);
var2 = BollBandDown(Length,D1);
if Tcond == true Then
{
If CrossUP(H,var1) and c > o and profit < 익절연속횟수 and loss < 손절연속횟수 then
{
Buy("b",OnClose,DEF,1);
if sTime >= StartTime and sTime < 청산구분시간 Then
{
ExitLong("bp1.",AtLimit,C+PriceScale*익절1,"",1,1);
ExitLong("bl1.",AtStop,C-PriceScale*손절1,"",1,1);
}
if sTime >= 청산구분시간 and sTime < Endtime Then
{
ExitLong("bp2.",AtLimit,C+PriceScale*익절2,"",1,1);
ExitLong("bl2.",AtStop,C-PriceScale*손절2,"",1,1);
}
}
If CrossDown(L,Var2) and C < O and profit < 익절연속횟수 and loss < 손절연속횟수 then
{
Sell("s",OnClose,DEF,1);
if sTime >= StartTime and sTime < 103000 Then
{
ExitShort("sp1.",AtLimit,C-PriceScale*익절1,"",1,1);
ExitShort("sl1.",AtStop,C+PriceScale*손절1,"",1,1);
}
if sTime >= 103000 and sTime < Endtime Then
{
ExitShort("sp2.",AtLimit,C-PriceScale*익절2,"",1,1);
ExitShort("sl2.",AtStop,C+PriceScale*손절2,"",1,1);
}
}
}
if MarketPosition == 1 Then
{
if sTime >= StartTime and sTime < 청산구분시간 Then
{
ExitLong("bp1",AtLimit,EntryPrice+PriceScale*익절1,"",1,1);
ExitLong("bl1",AtStop,EntryPrice-PriceScale*손절1,"",1,1);
}
if sTime >= 청산구분시간 and sTime < Endtime Then
{
ExitLong("bp2",AtLimit,EntryPrice+PriceScale*익절2,"",1,1);
ExitLong("bl2",AtStop,EntryPrice-PriceScale*손절2,"",1,1);
}
}
if MarketPosition == -1 Then
{
if sTime >= StartTime and sTime < 103000 Then
{
ExitShort("sp1",AtLimit,EntryPrice-PriceScale*익절1,"",1,1);
ExitShort("sl1",AtStop,EntryPrice+PriceScale*손절1,"",1,1);
}
if sTime >= 103000 and sTime < Endtime Then
{
ExitShort("sp2",AtLimit,EntryPrice-PriceScale*익절2,"",1,1);
ExitShort("sl2",AtStop,EntryPrice+PriceScale*손절2,"",1,1);
}
}
IF Endtime > starttime Then
SetStopEndofday(Endtime);
Else
{
if sDate != sDate[1] Then
SetStopEndofday(Endtime);
}
if (sdate != sdate[1] and stime >= StartTime) or
(sdate == sdate[1] and stime >= StartTime and stime[1] < StartTime) Then
{
IF Endtime <= starttime Then
{
SetStopEndofday(0);
}
}
2021-10-19
872
글번호 153003
답변완료
매주 월요일(만기주 월요일 제외)2
수요일 ,목요일은 아래처럼 하면 되는지요?
1)수요일
Var : ndate(0),cnt(0),count(0),XJD(0);
ndate = Floor(bDate/100)*100;
count = 0;
For cnt = 1 to 15
{
if DayOfWeek(ndate+cnt) == 4 Then
{
count = count+1;
if count == 2 Then
XJD = ndate+cnt;
}
}
if DayOfWeek(Bdate) == 3 and Bdate != XJD-1 Then
{
진입수식
}
2)목요일
Var : ndate(0),cnt(0),count(0),XJD(0);
ndate = Floor(bDate/100)*100;
count = 0;
For cnt = 1 to 15
{
if DayOfWeek(ndate+cnt) == 4 Then
{
count = count+1;
if count == 2 Then
XJD = ndate+cnt;
}
}
if DayOfWeek(Bdate) == 4 and Bdate != XJD-0 Then
{
진입수식
}
***********************************************************************
안녕하세요
예스스탁입니다.
1
Var : ndate(0),cnt(0),count(0),XJD(0);
ndate = Floor(bDate/100)*100;
count = 0;
For cnt = 1 to 15
{
if DayOfWeek(ndate+cnt) == 4 Then
{
count = count+1;
if count == 2 Then
XJD = ndate+cnt;
}
}
if DayOfWeek(Bdate) == 1 and Bdate != XJD-3 Then
{
진입수식
}
2
Var : ndate(0),cnt(0),count(0),XJD(0);
ndate = Floor(bDate/100)*100;
count = 0;
For cnt = 1 to 15
{
if DayOfWeek(ndate+cnt) == 4 Then
{
count = count+1;
if count == 2 Then
XJD = ndate+cnt;
}
}
if DayOfWeek(Bdate) == 1 and Bdate != XJD-2 Then
{
진입수식
}
즐거운 하루되세요
> 목마와숙녀 님이 쓴 글입니다.
> 제목 : 문의
> 아래 수식 1)은 매주 월요일만 거래하는 수식입니다.
옵션 만기주 월요일은 제외하는 수식으로 완성바랍니다.
아래 수식 2)은 매주 화요일만 거래하는 수식입니다.
옵션 만기주 화요일은 제외하는 수식으로 완성바랍니다.
2021-12-16
1068
글번호 152996