커뮤니티
예스랭귀지 Q&A
답변완료
[공지] 예스랭귀지 AI 어시스턴트, '예스나 AI' 출시 및 무료 체험 안내
안녕하세요, 예스스탁 입니다.복잡한 수식 공부 없이 여러분의 아이디어를 말하면 시스템 트레이딩 언어 예스랭귀지로 작성해주는 서비스예스나 AI(YesNa AI)가 출시되었습니다.지금 예스나 AI를 직접 경험해 보실 수 있도록 20크레딧(질문권 20회)를 무료로 증정해 드리고 있습니다.바로 여러분의 아이디어를 코드로 변환해보세요.--------------------------------------------------🚀 YesNa AI 핵심 기능- 지표식/전략식/종목검색식 생성: 자연어로 요청하면 예스랭귀지 문법에 맞는 코드를 작성합니다.- 종목검색식 변환 지원: K증권의 종목 검색식을 예스랭귀지로 변환 지원합니다.- 컴파일 검증: 작성된 코드가 실행 가능한지 컴파일러를 통해 문법 검증을 거쳐 결과물을 제공합니다.상세한 서비스 개요 및 활용 방법은 [서비스 소개 페이지]에서 확인하실 수 있습니다.▶ 서비스 소개 페이지: 바로가기서비스 사용 유의사항 및 결제 환불정책은 [이용약관]을 참고 부탁드립니다.▶ 서비스 이용약관: 바로가기💬 이용 문의사용 중 문의사항은 [프로그램 사용법 Q&A] 게시판에서 [예스나 AI] 카테고리를 설정 후 문의해 주시면 상세히 안내해 드리겠습니다.--------------------------------------------------앞으로도 AI를 활용한 다양한 트레이딩 기능들을 지속적으로 선보일 예정입니다.많은 관심과 기대 부탁드립니다.
2026-02-27
7528
글번호 230811
답변완료
이것좀 부탁드립니다
if stime == 151500 Then{
buy("b",AtLimit,NextBarOpen-2.5);
sell("s",AtLimit,NextBarOpen+2.5);
}
if stime < 144500 Then{
buy("b1",AtLimit,DayOpen-2.5);
sell("s1",AtLimit,DayOpen+2.5);
}
이게 무슨 뜻인지 해석좀 부탁드립니다 구체적으로^^;
날추운데 고생하십니다~~
2013-11-28
182
글번호 69904
회원 님에 의해서 삭제되었습니다.
2013-11-28
7
글번호 69903
답변완료
초짜라서 수식 문의드립니다
이제 시스템 공부를 시작한지 얼마 안되서 모르는 것 투성이네요
혼자서 해보다 막혀서 이런 방식의 수식이 가능한지 문의 드립니다.
분봉 차트 기준으로
[ 전일 종가 -1% <= 오늘 시가 <= 전일 종가 +1% ] 일때
오늘 시가에 시장가 매수
(또는 1분봉 기준으로 0901분, 즉 오늘 2번째 분봉 시가에서 매수)
매수 후 30분간 저가 대비 +1% 구간에서 추가 매수
1차 매수 후 60분간 최고가 대비 -1% 에서 전량 매도
1차 매수 후 60분간 1차 매수가 대비 -3% 에서 전량 손절
(또는 1차 매수 후 60분간 전체 매수 평단가 대비 -2%에서 전량 손절)
하루동안 진입 횟수 2회(1차, 2차 매수/매도 + 다시 1차,2차 매수/매도 -> 추가 매매 없음)
새로운걸 배우려니 어렵네요. 가능하다면 수식 부탁드립니다. 감사합니다.
2013-11-28
140
글번호 69902
답변완료
수식좀 부탁합니다
수고하십니다
이번주 교대에서 에스 랭귀지 수업을 들은 학생인데요
주식매매의 경우 아래와 같이 단순이평이 13일 15일 20일선이 상승추세이고 cci 7가 cci시그널 17을 상상향돌파일때 매입
하락일때 매수청산으로 수식을 작성했는데요
문의1(조건 1개추가) : 외부 참조를 통해서 data2 외국인 순매수세가 전 5개봉에서 순매수가 연속으로 0보다 클때 매입하고 전 5개봉에서 순매도 연속으로 0보다 작을때 청산조건을 넣고싶습니다
문의2(조건 1개추가) : 그리고 위조건에 청산조건의 경우에만 목표수익이 1% 이상인경우에만 매수청산이 되도록 하고싶습니다
그래서 매수인경우는 조건4개에 문의1조건으로 총 5개 조건이 만족해야 매수가 이루어지게 하고싶고요
매수청산의 경우에는 조건4개에 문의1조건, 문의2조건 그래서 총 6개의 조건이 만족해야 매수청상이 이루어지게 했으면 합니다
한수 가르쳐주시기 바랍니다
Input : B_A_Period1(13);
Input : B_B_Period1(15);
Input : B_C_Period1(20);
Input : B_D_Period1(7), B_D_Period2(17);
Input : EL_A_Period1(7), EL_A_Period2(17);
Input : EL_B_Period1(13);
Input : EL_C_Period1(15);
Input : EL_D_Period1(20);
Var : B_A_value1(0);
Var : B_A_CondResult(FALSE), B_A_TempResult(FALSE), B_A_Condition1(FALSE);
Var : B_B_value1(0);
Var : B_B_CondResult(FALSE), B_B_TempResult(FALSE), B_B_Condition1(FALSE);
Var : B_C_value1(0);
Var : B_C_CondResult(FALSE), B_C_TempResult(FALSE), B_C_Condition1(FALSE);
Var : B_D_value1(0), B_D_value2(0);
Var : B_D_CondResult(FALSE), B_D_TempResult(FALSE), B_D_Condition2(FALSE);
Var : EL_A_value1(0), EL_A_value2(0);
Var : EL_A_CondResult(FALSE), EL_A_TempResult(FALSE), EL_A_Condition2(FALSE);
Var : EL_B_value1(0);
Var : EL_B_CondResult(FALSE), EL_B_TempResult(FALSE), EL_B_Condition1(FALSE);
Var : EL_C_value1(0);
Var : EL_C_CondResult(FALSE), EL_C_TempResult(FALSE), EL_C_Condition1(FALSE);
Var : EL_D_value1(0);
Var : EL_D_CondResult(FALSE), EL_D_TempResult(FALSE), EL_D_Condition1(FALSE);
B_A_value1 = MA(Close,B_A_Period1);
B_B_value1 = MA(Close,B_B_Period1);
B_C_value1 = MA(Close,B_C_Period1);
B_D_value1 = CCI(B_D_Period1);
B_D_value2 = ema(B_D_value1,B_D_Period2);
B_A_Condition1 = B_A_value1 > B_A_value1[1];
B_A_TempResult = B_A_Condition1;
B_A_CondResult = B_A_TempResult;
B_B_Condition1 = B_B_value1 > B_B_value1[1];
B_B_TempResult = B_B_Condition1;
B_B_CondResult = B_B_TempResult;
B_C_Condition1 = B_C_value1 > B_C_value1[1];
B_C_TempResult = B_C_Condition1;
B_C_CondResult = B_C_TempResult;
B_D_Condition2 = CrossUp(B_D_value1, B_D_value2);
B_D_TempResult = B_D_Condition2;
B_D_CondResult = B_D_TempResult;
If B_A_CondResult and B_B_CondResult and B_C_CondResult and B_D_CondResult Then
{
Buy();
}
EL_A_value1 = CCI(EL_A_Period1);
EL_A_value2 = ema(EL_A_value1,EL_A_Period2);
EL_B_value1 = MA(Close,EL_B_Period1);
EL_C_value1 = MA(Close,EL_C_Period1);
EL_D_value1 = MA(Close,EL_D_Period1);
EL_A_Condition2 = CrossDown(EL_A_value1, EL_A_value2);
EL_A_TempResult = EL_A_Condition2;
EL_A_CondResult = EL_A_TempResult;
EL_B_Condition1 = EL_B_value1 < EL_B_value1[1];
EL_B_TempResult = EL_B_Condition1;
EL_B_CondResult = EL_B_TempResult;
EL_C_Condition1 = EL_C_value1 < EL_C_value1[1];
EL_C_TempResult = EL_C_Condition1;
EL_C_CondResult = EL_C_TempResult;
EL_D_Condition1 = EL_D_value1 < EL_D_value1[1];
EL_D_TempResult = EL_D_Condition1;
EL_D_CondResult = EL_D_TempResult;
If EL_A_CondResult and EL_B_CondResult and EL_C_CondResult and EL_D_CondResult Then
{
ExitLong();
}
2013-11-28
147
글번호 69900
답변완료
시스템식 부탁합니다.
항상 수고하시는 점에 감사드립니다.
분봉에서 참조데이타 외국인 순매수 계약수를 사용하여
1. 외국인 선물 매매 계약수를 매일 누적한 후 이평 값을 구하고
2. 장기(60봉), 단기(5봉) 이평이 크로스하면서 돌파 강도가 높을 때 매수, 매도를 하고
3. 돌파 강도는 낮게 크로스하였으나 장단기 이격이 크질 때에도 매수, 매도진입하고
4. 청산은 매수 매도가 최근 몇봉 기간내에 100계약수 미만일 때 청산하는
시스템식을 부탁합니다.
가급적 외부변수를 사용해주시면 고맙겠습니다.
2013-11-28
179
글번호 69899
답변완료
수정부탁합니다
안녕하세요
이식에서 1번째매수 2번째매수는 그대로 매수하게 수정하시지 말구요 3번째매수들어갈때는 주가가 60일선 위에 있을때에만 매수 가능하게 해주세요
1번째물타기,2번째물타기는 이식대로 3번째물타기부터는 변형해서 주가가60일선위에 있을경우 매수하게해주세요 3번째물타기도 -5프로이상 빠져있을에만 매수도록 고치시면 안됐니다 수고하세요~
input : 투자금액(200000);
Var : Body(0),HighBody(0),LowBody(0),Height(0),UpTail(0),DnTail(0),Long(False);
var : Vol(0),entrycond(false),mav(0);
if date != date[1] Then
entrycond = false;
if CodeCategoryEx == 11 and BasePrice < 50000 Then
vol = int(int((투자금액)/C)/10)*10;
Else
vol = int((투자금액)/C);
Body = Abs(C-O);
HighBody = Max(C,O);
LowBody = Min(C,O);
Height = H-L;
UpTail = H-Max(C,O);
DnTail = Min(C,O)-L;
DnTail = Min(O,C) - L;
Uptail = H - Max(O,C);
Height = H - L;
body= Abs(O-C);
highbody = Max(O,C);
LowBody = Min(O,C);
If Abs(Open-Close) > ma(Abs(Open-Close),10)*2 Then
Long = True;
Else
Long = False;
If UpTail == 0 and DnTail == 0 Then
Condition1 = True;
Else
Condition1 = False;
If C > mav and entrycond == false and C < Ma(C,10) and DnTail < Height*0.1 and C == O and Height > Ma(Height,10)
And (MarketPosition == 0 or (MarketPosition == 1 and C <= AvgEntryPrice*0.95)) then{
buy("a1",OnClose,def,vol);
entrycond = true;
}
If C > mav and entrycond == false and C < Ma(C,10) and (Uptail < Height * 0.1) and C == O and (Height > Ma(Height,10))
And (MarketPosition == 0 or (MarketPosition == 1 and C <= AvgEntryPrice*0.95)) then{
buy("a2",OnClose,def,vol);
entrycond = true;
}
If C > mav and entrycond == false and C[1] < Ma(C,10)[1] and C[1] < O[1] and Long[1] == True
and C > O and Long and O < L[1] and C >= (O[1]+C[1])/2 and C < O[1]
And (MarketPosition == 0 or (MarketPosition == 1 and C <= AvgEntryPrice*0.95)) then{
buy("a3",OnClose,def,vol);
entrycond = true;
}
If C > mav and entrycond == false and (C[2] >= Ma(C,10)[2] and C[2] < O[2] and C[1] < O[1] and C < O) and
(O[1] > Min(O,C)[2] and O[1] < Max(O,C)[2]) and
(O > Min(O,C)[1] and O < Max(O,C)[1]) and
(C[2] > C[1] and C[1] > C[0]) and
(L[2] < L[1] and L[1]< L[0])
And (MarketPosition == 0 or (MarketPosition == 1 and C <= AvgEntryPrice*0.95)) then{
buy("a4",OnClose,def,vol);
entrycond = true;
}
If C > mav and entrycond == false and C[2] < Ma(C,10)[2] and C[2] < O[2] and C[1] > O[1] and C < O and
O[1] > C[2] and O[1] == L[1] and
O > Max(H[1],H[2]) and C[2] == C[0]
And (MarketPosition == 0 or (MarketPosition == 1 and C <= AvgEntryPrice*0.95)) then{
buy("a6",OnClose,def,vol);
entrycond = true;
}
If C > mav and entrycond == false and (C[4] < Ma(C,10)[4] and C[4] < O[4] and C[3] < O[3] and C[2] < O[2]) and
(O[4] > O[3] and O[3] > O[2]) and
(C[4] > C[3] and C[3] > C[2]) and
(C[1] < O[1] and H[1] - MaxList(O,C)[1] > 0) and
(H[1] < O[3] and C[2] > C[1]) and
Close > Open and (O > O[1] and C > MaxList(H[1],H[2]))
And (MarketPosition == 0 or (MarketPosition == 1 and C <= AvgEntryPrice*0.95)) then{
buy("a7",OnClose,def,vol);
entrycond = true;
}
If C > mav and entrycond == false and (C[2] < Ma(C,10)[2] and Long[2] == True and C[2] < O[2]) and
(C[1] == O[1] and Max(O,C)[1] < Min(O,C)[2])and
(C > O and Min(O,C) > Max(O,C)[1])and (C > C[2])
And (MarketPosition == 0 or (MarketPosition == 1 and C <= AvgEntryPrice*0.95)) then{
buy("a8",OnClose,def,vol);
entrycond = true;
}
If C > mav and entrycond == false and (C[1] < O[1] and Long[1] == True and Condition1[1] == True ) and
(Long == True and C > O and Condition1 == True ) and (L > H[1])
And (MarketPosition == 0 or (MarketPosition == 1 and C <= AvgEntryPrice*0.95)) then{
buy("a9",OnClose,def,vol);
entrycond = true;
}
If C > mav and entrycond == false and C[1] < Ma(C,10)[1] and C[1] < O[1] and body[1] > Ma(body[1],10)*2 and
C > O and
Abs(C-C[1]) < Ma(Height,10)*0.1
And (MarketPosition == 0 or (MarketPosition == 1 and C <= AvgEntryPrice*0.95)) then{
buy("a10",OnClose,def,vol);
entrycond = true;
}
If C > mav and entrycond == false and C < Ma(C,10) and body > Ma(body,10)*2 and C > O and
O == L and Uptail > 0 and Uptail < Height*0.1
And (MarketPosition == 0 or (MarketPosition == 1 and C <= AvgEntryPrice*0.95)) then{
buy("a11",OnClose,def,vol);
entrycond = true;
}
If C > mav and entrycond == false and C[2] < Ma(C,10)[2] and C[2] == O[2] and C[1] == O[1] and C == O and
HighBody[1]< LowBody[2] and HighBody[1] < LowBody[0]
And (MarketPosition == 0 or (MarketPosition == 1 and C <= AvgEntryPrice*0.95)) then{
buy("a12",OnClose,def,vol);
entrycond = true;
}
If C > mav and entrycond == false and C[1] < Ma(C,10)[1] and C[1] < O[1] and body[1] > Ma(body[1],10)*2 and
C == O and Highbody < Highbody[1] and Lowbody > Lowbody[1]
And (MarketPosition == 0 or (MarketPosition == 1 and C <= AvgEntryPrice*0.95)) then{
buy("a13",OnClose,def,vol);
entrycond = true;
}
If C > mav and entrycond == false and C[1] < Ma(C,10)[1] and C[1] < O[1] and body[1] > Ma(body[1],10)*2
and C > O and Highbody < Highbody[1] and Lowbody > Lowbody[1]
And (MarketPosition == 0 or (MarketPosition == 1 and C <= AvgEntryPrice*0.95)) then{
buy("a14",OnClose,def,vol);
entrycond = true;
}
If C > mav and entrycond == false and C[2] < Ma(C,10)[2] and C[2] < O[2] and body[2] > Ma(body[2],10)*2 and
C[1] > O[1] and Highbody[1] < Highbody[2] and Lowbody[1] > Lowbody[2] and
C > O and C > C[1]
And (MarketPosition == 0 or (MarketPosition == 1 and C <= AvgEntryPrice*0.95)) then{
buy("a15",OnClose,def,vol);
entrycond = true;
}
If C > mav and entrycond == false and C[1] < Ma(c,10)[1] and C[1] < O[1] and
C > O and Body > Ma(Body,10)*2 and
Highbody > Highbody[1] and Lowbody < Lowbody[1]
And (MarketPosition == 0 or (MarketPosition == 1 and C <= AvgEntryPrice*0.95)) then{
buy("a16",OnClose,def,vol);
entrycond = true;
}
If C > mav and entrycond == false and C[2] < Ma(C,10)[2] and C[2] < O[2] and
C[1] > O[1] and Body[1] > Ma(Body[1],10)*2 and
Highbody[1] > Highbody[2] and Lowbody[1] < Lowbody[2] and
C > O and C > C[1]
And (MarketPosition == 0 or (MarketPosition == 1 and C <= AvgEntryPrice*0.95)) then{
buy("a17",OnClose,def,vol);
entrycond = true;
}
If C > mav and entrycond == false and (C[4] < Ma(c,10)[4] and Body[4] > Ma(Body,10)[4]*2 and C[4] < O[4]) and
(C[3] < O[3] and C[1] < O[1]) and
(Body > Ma(Body,10)*2 and C > O) and
(O[3] > HighBody[2] and HighBody[2] > O[1]) and
(C[3] > LowBody[2] and LowBody[2] > C[1]) and
(C >= O[1] and C > O[3] and C < C[4])
And (MarketPosition == 0 or (MarketPosition == 1 and C <= AvgEntryPrice*0.95)) then{
buy("a18",OnClose,def,vol);
entrycond = true;
}
If C > mav and entrycond == false and C[2] < Ma(C,10)[2] and Body[2] > Ma(Body,10)[2]*2 and C[2] < O[2] and
C[1] == O[1] and HighBody[1]<LowBody[2] and
C > O and C > C[2]
And (MarketPosition == 0 or (MarketPosition == 1 and C <= AvgEntryPrice*0.95)) then{
buy("a19",OnClose,def,vol);
entrycond = true;
}
If C > mav and entrycond == false and C[2] < Ma(C,10)[2] and Body[2] > Ma(Body,10)[2]*2 and C[2] < O[2] and
Body[1] < Ma(Body,10)[1]*0.5 and HighBody[1] < LowBody[2] and
C > O and C > C[2]
And (MarketPosition == 0 or (MarketPosition == 1 and C <= AvgEntryPrice*0.95)) then{
buy("a20",OnClose,def,vol);
entrycond = true;
}
If C > mav and entrycond == false and C[3] < Ma(C,10)[3] and
Body[3] > Ma(Body,10)[3]*2 and C[3] < O[3] and
Body[2] > Ma(Body,10)[2]*2 and C[2] < O[2] and
O[3] == H[3] and C[3] == L[3] and
O[2] == H[2] and C[2] == L[2] and
O[1] < Min(O,C)[2] and H[1] > C[2] and UpTail[1] > Height*0.5 and
O > H[1] and C < L[1]
And (MarketPosition == 0 or (MarketPosition == 1 and C <= AvgEntryPrice*0.95)) then{
buy("a21",OnClose,def,vol);
entrycond = true;
}
If C > mav and entrycond == false and C < Ma(C,10) and DnTail < Height*0.1 and
UpTail > Body*2 and
Height > Ma(Height,10) and
C != O
And (MarketPosition == 0 or (MarketPosition == 1 and C <= AvgEntryPrice*0.95)) then{
buy("a22",OnClose,def,vol);
entrycond = true;
}
If C > mav and entrycond == false and C[2] < Ma(C,10)[2] and C[2] > O[2] and C[1] > O[1] and C > O and
O[1] >= LowBody[2] and O[1]<= HighBody[2] and O <= HighBody[1] and
C[2] <= C[1] and C[1] <= C
And (MarketPosition == 0 or (MarketPosition == 1 and C <= AvgEntryPrice*0.95)) then{
buy("a23",OnClose,def,vol);
entrycond = true;
}
If C > mav and entrycond == false and C[1] < Ma(C,10)[1] and C[1] < O[1] and Body[1] > Ma(Body,10)[1]*2 and
C < O and Highbody < Highbody[1] and Lowbody > Lowbody[1]
And (MarketPosition == 0 or (MarketPosition == 1 and C <= AvgEntryPrice*0.95)) then{
buy("a24",OnClose,def,vol);
entrycond = true;
}
If C > mav and entrycond == false and C < Ma(C,10) and UpTail < Height*0.1 and DnTail > Body*2 and
Height > Ma(Height,10) and C != O
And (MarketPosition == 0 or (MarketPosition == 1 and C <= AvgEntryPrice*0.95)) then{
buy("a26",OnClose,def,vol);
entrycond = true;
}
If C > mav and entrycond == false and (C[2] < Ma(C,10)[2] and Body[2] > Ma(Body,10)[2]*2 and C[2] < O[2]) and
(C[1] < O[1] and C > O and Highbody[1] < Highbody[2] and Lowbody[1] > Lowbody[2]) and
(L[1] < L[2] or L[1] < Min(L[2],L[3],L[4])) and
(L[1] < O and C[1] > C)
And (MarketPosition == 0 or (MarketPosition == 1 and C <= AvgEntryPrice*0.95)) then{
buy("a27",OnClose,def,vol);
entrycond = true;
}
if MarketPosition == 1 Then{
if CurrentEntries >= 2 Then
exitlong("매도2",atlimit,AvgEntryPrice*1.02);
Else
exitlong("매도1",atlimit,EntryPrice*1.05);
}
2013-11-27
175
글번호 69898
답변완료
문의드립니다.
답변에 질문을 하니 재답을 안달아 주셔서 다시 새로 문의드립니다.
랭귀지에서는 매수호가와 매도호가 관련 ticks는 없는건가요? 빨간색 파란색을 나타내는 ticks 관련 함수말입니다. 이미 색으로 구분해서 제공하여 주시고 있다면 굳이 함수를 제공안하시는 이유도 없을 것 같은데요.
> 예스스탁 님이 쓴 글입니다.
> 제목 : Re : 문의드립니다
> 안녕하세요
예스스탁입니다.
체결추이의 빨간색과 파란색은 Upticks과 downTicks이 아닙니다.
현재가창의 빨간색과 파란색은 해당 체결가격이 매수호가인지 매도호가인지 나타냅니다.
매수호가이면 빨간색, 매도호가이면 파란색입니다.
랭귀지에 제공되는 Upticks와 downTicks는
현재 ticks(체결건수)가 직전체결가격대비 상승인지 하락인지로 구별해서
분리해서 제공되는 데이터입니다.
직전 체결가격보다 크면 Upticks, 작으면 downTicks으로 분류되며
가격이 같은 경우에는 최근 발생한쪽으로 합산됩니다.
즐거운 하루되세요
2013-11-27
138
글번호 69897
회원 님에 의해서 삭제되었습니다.
2013-11-28
10
글번호 69896
회원 님에 의해서 삭제되었습니다.
2013-11-27
2
글번호 69895