커뮤니티
예스랭귀지 Q&A
답변완료
[공지] 예스랭귀지 AI 어시스턴트, '예스나 AI' 출시 및 무료 체험 안내
안녕하세요, 예스스탁 입니다.복잡한 수식 공부 없이 여러분의 아이디어를 말하면 시스템 트레이딩 언어 예스랭귀지로 작성해주는 서비스예스나 AI(YesNa AI)가 출시되었습니다.지금 예스나 AI를 직접 경험해 보실 수 있도록 20크레딧(질문권 20회)를 무료로 증정해 드리고 있습니다.바로 여러분의 아이디어를 코드로 변환해보세요.--------------------------------------------------🚀 YesNa AI 핵심 기능- 지표식/전략식/종목검색식 생성: 자연어로 요청하면 예스랭귀지 문법에 맞는 코드를 작성합니다.- 종목검색식 변환 지원: K증권의 종목 검색식을 예스랭귀지로 변환 지원합니다.- 컴파일 검증: 작성된 코드가 실행 가능한지 컴파일러를 통해 문법 검증을 거쳐 결과물을 제공합니다.상세한 서비스 개요 및 활용 방법은 [서비스 소개 페이지]에서 확인하실 수 있습니다.▶ 서비스 소개 페이지: 바로가기서비스 사용 유의사항 및 결제 환불정책은 [이용약관]을 참고 부탁드립니다.▶ 서비스 이용약관: 바로가기💬 이용 문의사용 중 문의사항은 [프로그램 사용법 Q&A] 게시판에서 [예스나 AI] 카테고리를 설정 후 문의해 주시면 상세히 안내해 드리겠습니다.--------------------------------------------------앞으로도 AI를 활용한 다양한 트레이딩 기능들을 지속적으로 선보일 예정입니다.많은 관심과 기대 부탁드립니다.
2026-02-27
7786
글번호 230811
답변완료
몇가지 문의 드립니다.
수고하십니다.
예스트레이더 3.0에서 지표를 작성하여 사용하고 있었는데
3.1로 바뀌면서 지표가 제대로 표시가 안되어 문의드립니다.
분봉에서 봉은 갭보정해서 보고 있고
전일고점과 전일저점은 수식을 작성하여
갭을 보정하지 않은 값을 지표로 봅니다.
이제까지 3.0에서는 맞게 그려졌는데
3.1로 보니 당일만 맞게 적용되고 이전일은 맞지 않더군요.
3.0에서 썼던 식을 올려보냅니다.
INPUT : D1(1);
VAR : GAP(0),DLH1(0), DLL1(0), OP(0);
IF DATE != DATE[1] then GAP = DAYOPEN()-DAYCLOSE()[1];
DLH1=DAYHIGH(D1)-GAP;
DLL1=DAYLOW(D1)-GAP;
IF DAYINDEX()==0 THEN OP=O;
PLOT1(DLH1);
PLOT2(DLL1);
PLOT3(OP);
**한가지 더 문의 드릴께요..
갭을 보정한 분봉에서 일봉,주봉의 이평선을
위의 식처럼 갭을 보정하지 않은 이평선으로 보고 싶은데
어떻게 작성하면 되는지....
부탁드립니다.....
2008-12-07
1089
글번호 18601
답변완료
주문 신호 아리송하네요
안녕하세요 검증되나 신호없어서요 뭐가뭔지 전문가님 수정 부탁해요
<내용> 답변은 yang12133@empal.com 감사해요
#선물의 하루 최대 최소 차이점
# Index : 봉의 번호
# sDate : 봉의 시작 날짜
# date : 봉의 끝 날짜
# time : 봉의 끝 시간(103020) 10시30분20초
# Open : 시가
# High : 고가
# Low : 저가
# Close : 종가
# Volume : 거래량
# Money : 거래 대금
# openinterest : 미결제 약정
# Bids : 매수 총잔량
# asks : 매도 총잔량
# ticks : 체결건수
# upticks : 상승형 체결건수
# downticks : 하락형 체결건수
# upvol : 상승형 체결거래량
# downvol : 하락형 체결거래량
# baseprice : 기준가
variables : v_i(0),state(0),v_close(0),rate(0.95),num(1),next_state(0);
arrays : av_price[20](0);
if(index >2 ) then {
state = next_state[1];
next_state = next_state[1];
}
print("state2.txt","index = %6.0f state %4.0f close:%2.2f",index,state,close);
if(time<90130) then {
state = 0;
next_state = 0;
}
if(state==0) then { /*initialization */
if( time > 90130 && date == 20070718 ) then { /* Transition to trading */
next_state = 1;
print("state.txt","state %4.0f",state);
av_price[0] = Close;
For v_i=1 to 19 {
av_price[v_i] = av_price[v_i-1]*rate;
}
For v_i=0 to 19 { /*소수점 두 째 짜리까지로 라운드 */
av_price[v_i] = round(av_price[v_i],2);
print("price222.txt","price:%2.2f %.0f %",av_price[v_i],state);
}
}
} else if(state == 1) then {
if(close<=av_price[state]) then { /*Transit to next state */
next_state = state+1;
print("state.txt","state %4.0f",next_state);
buy("b1",Onclose,DEF,num);
}
if(close>=av_price[state-1]) then {
next_state = 1001;
print("state.txt","state %4.0f",next_state);
}
} else if(state == 2) then {
if(close<=av_price[state]) then { /*Transit to next state */
next_state = state+1;
print("state.txt","state %4.0f",next_state);
buy("b2",Onclose,DEF,1);
}
if(close>=av_price[state-2]) then {
next_state = state-1;
print("state.txt","state %4.0f",next_state);
Exitlong("s2",Onclose,DEF,"b1",num,1);
}
} else if(state ==3) then {
if(close<=av_price[state]) then { /*Transit to next state */
next_state = state+1;
print("state.txt","state %4.0f",next_state);
buy("b3",Onclose,DEF,num);
}
if(close>=av_price[state-2]) then {
next_state = state-1;
print("state.txt","state %4.0f",next_state);
Exitlong("s3",Onclose,DEF,"b2",num,1);
}
} else if(state ==4) then {
if(close<=av_price[state]) then { /*Transit to next state */
next_state = state+1;
print("state.txt","state %4.0f",next_state);
buy("b4",Onclose,DEF,num);
}
if(close>=av_price[state-2]) then {
next_state = state-1;
print("state.txt","state %4.0f",next_state);
Exitlong("s4",Onclose,DEF,"b3",num,1);
}
} else if(state ==5) then {
if(close<=av_price[state]) then { /*Transit to next state */
next_state =state+1;
print("state.txt","state %4.0f",next_state);
buy("b5",Onclose,DEF,num);
}
if(close>=av_price[state-2]) then {
next_state =state-1;
print("state.txt","state %4.0f",next_state);
Exitlong("s5",Onclose,DEF,"b4",num,1);
}
}else if(state ==6) then {
if(close<=av_price[state]) then { /*Transit to next state */
next_state =state+1;
print("state.txt","state %4.0f",next_state);
buy("b6",Onclose,DEF,num);
}
if(close>=av_price[state-2]) then {
next_state =state-1;
print("state.txt","state %4.0f",next_state);
Exitlong("s6",Onclose,DEF,"b5",num,1);
}
}else if(state ==7) then {
if(close<=av_price[state]) then { /*Transit to next state */
next_state =state+1;
print("state.txt","state %4.0f",next_state);
buy("b7",Onclose,DEF,num);
}
if(close>=av_price[state-2]) then {
next_state =state-1;
print("state.txt","state %4.0f",next_state);
Exitlong("s7",Onclose,DEF,"b6",num,1);
}
}else if(state ==8) then {
if(close<=av_price[state]) then { /*Transit to next state */
next_state =state+1;
print("state.txt","state %4.0f",next_state);
buy("b8",Onclose,DEF,num);
}
if(close>=av_price[state-2]) then {
next_state =state-1;
print("state.txt","state %4.0f",next_state);
Exitlong("s8",Onclose,DEF,"b7",num,1);
}
}else if(state ==9) then {
if(close<=av_price[state]) then { /*Transit to next state */
next_state =state+1;
print("state.txt","state %4.0f",next_state);
buy("b9",Onclose,DEF,num);
}
if(close>=av_price[state-2]) then {
next_state =state-1;
print("state.txt","state %4.0f",next_state);
Exitlong("s9",Onclose,DEF,"b8",num,1);
}
}else if(state ==10) then {
if(close<=av_price[state]) then { /*Transit to next state */
next_state =state+1;
print("state.txt","state %4.0f",next_state);
buy("b10",Onclose,DEF,num);
}
if(close>=av_price[state-2]) then {
next_state =state-1;
print("state.txt","state %4.0f",next_state);
Exitlong("s10",Onclose,DEF,"b9",num,1);
}
} else if(state ==11) then {
if(close<=av_price[state]) then { /*Transit to next state */
next_state =state+1;
print("state.txt","state %4.0f",next_state);
buy("b11",Onclose,DEF,num);
}
if(close>=av_price[state-2]) then {
next_state =state-1;
print("state.txt","state %4.0f",next_state);
Exitlong("s11",Onclose,DEF,"b10",num,1);
}
} else if(state ==12) then {
if(close<=av_price[state]) then { /*Transit to next state */
next_state =state+1;
print("state.txt","state %4.0f",next_state);
buy("b12",Onclose,DEF,num);
}
if(close>=av_price[state-2]) then {
next_state =state-1;
print("state.txt","state %4.0f",next_state);
Exitlong("s12",Onclose,DEF,"b11",num,1);
}
} else if(state ==13) then {
if(close<=av_price[state]) then { /*Transit to next state */
next_state =state+1;
print("state.txt","state %4.0f",next_state);
buy("b13",Onclose,DEF,num);
}
if(close>=av_price[state-2]) then {
next_state =state-1;
print("state.txt","state %4.0f",next_state);
Exitlong("s13",Onclose,DEF,"b12",num,1);
}
} else if(state ==14) then {
if(close<=av_price[state]) then { /*Transit to next state */
next_state =state+1;
print("state.txt","state %4.0f",next_state);
buy("b14",Onclose,DEF,num);
}
if(close>=av_price[state-2]) then {
next_state =state-1;
print("state.txt","state %4.0f",next_state);
Exitlong("s14",Onclose,DEF,"b13",num,1);
}
} else if(state ==15) then {
if(close<=av_price[state]) then { /*Transit to next state */
next_state =state+1;
print("state.txt","state %4.0f",next_state);
buy("b15",Onclose,DEF,num);
}
if(close>=av_price[state-2]) then {
next_state =state-1;
print("state.txt","state %4.0f",next_state);
Exitlong("s15",Onclose,DEF,"b14",num,1);
}
} else if(state ==16) then {
if(close<=av_price[state]) then { /*Transit to next state */
next_state =state+1;
print("state.txt","state %4.0f",next_state);
buy("b16",Onclose,DEF,num);
}
if(close>=av_price[state-2]) then {
next_state =state-1;
print("state.txt","state %4.0f",next_state);
Exitlong("s16",Onclose,DEF,"b15",num,1);
}
} else if(state ==17) then {
if(close<=av_price[state]) then { /*Transit to next state */
next_state =state+1;
print("state.txt","state %4.0f",next_state);
buy("b17",Onclose,DEF,num);
}
if(close>=av_price[state-2]) then {
next_state =state-1;
print("state.txt","state %4.0f",next_state);
Exitlong("s17",Onclose,DEF,"b16",num,1);
}
} else if(state ==18) then {
if(close<=av_price[state]) then { /*Transit to next state */
next_state =state+1;
print("state.txt","state %4.0f",next_state);
buy("b18",Onclose,DEF,num);
}
if(close>=av_price[state-2]) then {
next_state =state-1;
print("state.txt","state %4.0f",next_state);
Exitlong("s18",Onclose,DEF,"b17",num,1);
}
} else if(state ==19) then {
/* if(close<=av_price[state]) then {
next_state = state+1;
print("state.txt","state %4.0f",next_state);
buy(1);
}*/
if(close>=av_price[state-2]) then {
next_state = state-1;
print("state.txt","state %4.0f",next_state);
Exitlong("s19",Onclose,DEF,"b18",num,1);
}
} else if(state == 1001) then {
if(close<=av_price[0]) then { /*Transit to next state */
next_state = 1;
print("state.txt","state %4.0f",next_state);
}
}
2008-12-07
1120
글번호 18600
답변완료
시스템식 문의입니다.
선물차트 1*2 분할창에서 위에는 100틱 차트이고 밑에는 5분봉 차트입니다.
매수식은
5분봉 차트에서 10 이평선이 상향하고 100틱 차트에서 10 이평선이 상향하면 매수하라.
매수청산은
100틱 차트에서 10 이평이 20 이평을 하향돌파 시 청산하라.
매도식은
5분봉 차트에서 10 이평선이 하향하고 100틱 차트에서 10 이평선이 하향하면 매도하라.
매도청산은
100틱 차트에서 10 이평이 20 이평을 상향돌파 시 청산하라.
--- 서로 다른 봉으로도 시스템이 되는지...
부탁드립니다. 꾸벅~~~
2008-12-07
981
글번호 18599
답변완료
체결량에서 특정 체결 검색을 하려는데요....
UpVol, DownVol이 체결량을 말해주는 데이터로 알고 있습니다.
만약 UpVol에서 한번에 100개 이상 체결이 발생한 경우만 카운트 하려고 합니다.
수식을 어떻게 해야하는지요?
그리고 장이 끝나고 다시 차트를 볼때 장중 실시간으로 만들어진 지표를 볼 수 있는지요? UpVol같은 경우 봉이 완성이 되버리면 완성 순간의 값을 기억하는게 맞나요? 그래서 봉이 완성되는 동안의 데이터 변화는 알 수 없는거죠?
처음 질물과 같은 1봉 내에서 100개 이상의 체결이 몇번 일어났는지 횟수를 지표로 만들경우, 봉이 완성되버리면 차트를 닫고 열면 다시 만들어 낼 수는 없는거죠?
질문이 너무 많고, 우왕좌왕인데^^ 부탁드리겠습니다.^^
2008-12-06
1204
글번호 18598
답변완료
재문의
일전에 문의한 내용의 아래 답신에서..
진입은 의도대로 이나..
청산[손절/익절]이..BA,BB 동시에 처리가 되는군요..
지금은 잔고가 BA와 BB가 같이 있는 경우..
BB손절,BB익절로 동시에 동일한 값에 다 청산되네요..
익절이나 손절이나..각각 BA,BB 지정한 값에 별도로 나오게 하려면 어떻게 해야 하는요?
즉,BA,BB 진입후 하락하게 되면 BB 먼저 지정된 값에 도달하면 BB만 손절 나오고..
BA는 BA에 지정한 값에 도달할 만큼 더 하락한 뒤에 별도로 손절 나오게 하고 싶거든요..
익절도 마찬가지 방식으로요..부탁합니다.
#############################################
var: count(0),cnt(0),entryB(0);
count = 0;
for cnt = 0 to 10{
if sdate == EntryDate(cnt) Then
count = count+1;
}
if MarketPosition() == 0 and C> O and count < 3 and stime < 150000 Then{
buy("BA");
entryB = C;
}
if MarketPosition() == 1 and CurrentEntries() == 1 and stime < 150000 Then{
if C > EntryPrice()+1 Then{
buy("BB");
entryB = C;
}
}
## BA매수만 진입했을 경우
if MarketPosition() == 1 and CurrentEntries() == 1 Then{
exitlong("BA손절",AtStop,entryB-1.2);
if highest(C,BarsSinceEntry) >= DayOpen()+1.6 Then
exitlong("BA익절",AtStop,highest(C,BarsSinceEntry)-0.6);
}
## BA와 BB 2개 진입이 피라미딩으로 진입했을 경우
if MarketPosition() == 1 and CurrentEntries() == 2 Then{
exitlong("BB손절",AtStop,entryB-1.3);
if highest(C,BarsSinceEntry) >= entryB+1.5 Then
exitlong("BB익절",AtStop,highest(H,BarsSinceEntry)-0.4);
}
SetStopEndofday(1500);
2008-12-06
982
글번호 18597
답변완료
수식 부탁합니다
프로그램의 기초가 부족하여 초보적인 질문을 올립니다.
5분봉 기준으로
전일 일중 변동폭을 지표로 표현 하고 싶습니다.
어떻게 해야 하나요
미리 감사드립니다.
2008-12-07
926
글번호 18596
답변완료
첨부 지표 확인 부탁..
첨부파일 3의 지표 확인 좀 부탁드립니다.
첨부파일 1에서 처럼..시뮬레이션 차트에서는 지표가 나오는데..
첨부파일 2에서 처럼 일반 차트에서는 지표가 안나옵니다...
어디가 잘못된건지 확인및 수정 부탁합니다.
수고하세요..
2008-12-06
981
글번호 18595
답변완료
분할 옵션매수 수식 문의
안녕하세요,,
수식 요청 부탁드립니다.
*** 진입조건
1. 진입조건은 전일 양봉이면 무조건 매수시작
전일 음봉이면 무조건 매수 하지 않음
2. 1 분봉 기준
3. 투입금액은 INPUT 변수로 조정가능하게 (여기서는 예로 10억원이라고 가정)
4. 오전 9시부터 오후 1시30분까지
인풋금액을 기준으로 분할매수하기 위하여
- 진입 계약수는 해당 옵션가의 시초가 기준으로 산정
- 1분단위로 (10억원어치를) 분할매수하되 9시부터~오후1시30분까지
(상기 예인 10억원어치를) 각각의 1분봉마다 분할로 매수
*** 청산조건
1. 청산조건은 오후 2시30분부터 무조건 분할로 청산 시작
2, 오후 2시30분부터 오후 3시까지의 기준으로 1분봉당 분할로 청산
(이때 각 청산하는 봉당 청산 개수는 총진입계약수/(오후2시30분~오후3시까지의 봉개수)
이게 생각보다 무지 어렵네요 부탁드립니다,감사합니다, 고맙습니다. 수고하세요
2008-12-06
909
글번호 18594
답변완료
비시계열 차트를 활용하여
매수 매도 신호가 나오면
이를 분봉에 적용시킬수 있는지 궁금합니다
==
제공되는 비시계열 차트는 어떤것들이 있는지 ??
2008-12-05
969
글번호 18593