커뮤니티
예스랭귀지 Q&A
답변완료
[공지] 예스랭귀지 AI 어시스턴트, '예스나 AI' 출시 및 무료 체험 안내
안녕하세요, 예스스탁 입니다.복잡한 수식 공부 없이 여러분의 아이디어를 말하면 시스템 트레이딩 언어 예스랭귀지로 작성해주는 서비스예스나 AI(YesNa AI)가 출시되었습니다.지금 예스나 AI를 직접 경험해 보실 수 있도록 20크레딧(질문권 20회)를 무료로 증정해 드리고 있습니다.바로 여러분의 아이디어를 코드로 변환해보세요.--------------------------------------------------🚀 YesNa AI 핵심 기능- 지표식/전략식/종목검색식 생성: 자연어로 요청하면 예스랭귀지 문법에 맞는 코드를 작성합니다.- 종목검색식 변환 지원: K증권의 종목 검색식을 예스랭귀지로 변환 지원합니다.- 컴파일 검증: 작성된 코드가 실행 가능한지 컴파일러를 통해 문법 검증을 거쳐 결과물을 제공합니다.상세한 서비스 개요 및 활용 방법은 [서비스 소개 페이지]에서 확인하실 수 있습니다.▶ 서비스 소개 페이지: 바로가기서비스 사용 유의사항 및 결제 환불정책은 [이용약관]을 참고 부탁드립니다.▶ 서비스 이용약관: 바로가기💬 이용 문의사용 중 문의사항은 [프로그램 사용법 Q&A] 게시판에서 [예스나 AI] 카테고리를 설정 후 문의해 주시면 상세히 안내해 드리겠습니다.--------------------------------------------------앞으로도 AI를 활용한 다양한 트레이딩 기능들을 지속적으로 선보일 예정입니다.많은 관심과 기대 부탁드립니다.
2026-02-27
8250
글번호 230811
답변완료
문의드립니다
안녕하세요.
진입과 청산에서 미체결상태가 자주발생하다보니 시스템이 엉망이 되었읍니다
그래서 조언을 구하고자합니다.
1.신호발생시 무조건 체결되는 방법.(시장가 제외)
2.미체결시 추격진입 또는 추격청산하는 방법.
3.다른 방법 있으면 좀 알려주셰요.
감사합니다.
항상 기쁜일만 가득 하시길 기원합니다.
2008-12-08
1001
글번호 18605
답변완료
YT , TS 변환....
안녕하세요.
YT 와TS 를 샅이 사용하고 있습니다.
YT로 만든 로직이 TS 로직으로 바꾸는데 좀 어렵습니다.
도와주시면 감사드리겠습니다.
두가지의 문제가 있습니다.
1. IFF 에 대해서 이해가 잘 되지 않네요.
예를 들어 IFF(조건, true, false)에서
IFF는 조건 만족하면 TRUE를 불만족시 False를 반환 하는 것으로 아는데
그럼 ABC = IFF(IFF(조건0, 조건1=TRUE, 조건2=TRUE), 1, 0) 이렇게 도 쓸수 있습니까?
"조건 0" 만족하고 "조건1" 만족하면 1이 반환 되나요?
만약에 위 식이 자체가 틀렸다면 IFF(IFF 이런 조건문은 만들때 어떤식으로 해야 하는지 좀 가르쳐 주십시요.
2. YT에 다음과 같은 구문이 있는데 어떻게 변환 해야 하는지요?
if MarketPosition() != 1 and formula0 then
buy();
2008-12-08
1046
글번호 18604
답변완료
옵션 분할 매수식 문의
안녕하세요?
옵션 분할 매수식 문의 드립니다.
기본 총 매수수량은 100계약으로 합니다.
=============
진입
1.종가가 5일 이동평균선 을 상향 돌파하면 총 매수수량의 25%를 매수합니다.
2.종가가 20일 이동평균선을 상향 돌파하면 25%를 매수합니다.
3.종가가 첫 분할진입가보다 10%이상 높으면 25%를 매수합니다.
4.종가가 첫 분할 진입가보다 15%이상 높으면 25%를 매수합니다.
청산
1.진입가격의 평균값에서 10%하락하면 손절합니다.
2.15시에 당일청산합니다
미리 감사드립니다.
2008-12-08
1087
글번호 18603
답변완료
선물매수호가 잔량과 ADX 이 ADXR 보다 클때 매수식
안녕하세요
1. MACDOsc(12, 26, 9)에서 신호선이 0을 돌파(CrossUp)할때 조건이 "선물매수호가잔량"이 "선물매도호가잔량"보다 10퍼센트 많을때 또는 ADX(14)가 ADXR보다 클때 Buy,
2. stoploss 조건은 Exitlong("Tr매수청산", onclose, Highest(H, BarsSinceEntry() - Atr(20)*3)); 으로 만들어 주시고요.
3. MACDOsc(12, 26, 9)에서 신호선이 0을 하향돌파(CrossUp)할때 조건이 "선물매도호가잔량"이 "선물매수호가잔량"보다 10퍼센트 많을때 또는 ADX(14)가 ADXR보다 클때 Sell
하는 시스템식좀 알려주세요
4. stoploss조건은 Exitlong("Tr매수청산", onclose, Highest(H, BarsSinceEntry() - Atr(20)*3))
또한 앞 거래에서 손실이 발생했을경우, 그 이후로 부터 주가가 5봉 동안(외부변수 input변수로 최적화 할수있게 만들어 주시고요) 최고점을 상향돌파 했을경우 에만 위의 macdosc crossup시 Buy, 5봉동안 최저점을 이탈했을 경우에만 macdosc의 crossdown시 sell신호가 나오게 해주시고요.
모든 조건은 당일청산 조건이며, 5분봉을 사용하고요.
부탁드리겠습니다.
11월말에 교육받은 사람인데, 실제로 수식을 작성하려고 해보니 잘 모르겠네요..
2008-12-08
1501
글번호 18602
답변완료
몇가지 문의 드립니다.
수고하십니다.
예스트레이더 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
1133
글번호 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
1162
글번호 18600
답변완료
시스템식 문의입니다.
선물차트 1*2 분할창에서 위에는 100틱 차트이고 밑에는 5분봉 차트입니다.
매수식은
5분봉 차트에서 10 이평선이 상향하고 100틱 차트에서 10 이평선이 상향하면 매수하라.
매수청산은
100틱 차트에서 10 이평이 20 이평을 하향돌파 시 청산하라.
매도식은
5분봉 차트에서 10 이평선이 하향하고 100틱 차트에서 10 이평선이 하향하면 매도하라.
매도청산은
100틱 차트에서 10 이평이 20 이평을 상향돌파 시 청산하라.
--- 서로 다른 봉으로도 시스템이 되는지...
부탁드립니다. 꾸벅~~~
2008-12-07
1013
글번호 18599
답변완료
체결량에서 특정 체결 검색을 하려는데요....
UpVol, DownVol이 체결량을 말해주는 데이터로 알고 있습니다.
만약 UpVol에서 한번에 100개 이상 체결이 발생한 경우만 카운트 하려고 합니다.
수식을 어떻게 해야하는지요?
그리고 장이 끝나고 다시 차트를 볼때 장중 실시간으로 만들어진 지표를 볼 수 있는지요? UpVol같은 경우 봉이 완성이 되버리면 완성 순간의 값을 기억하는게 맞나요? 그래서 봉이 완성되는 동안의 데이터 변화는 알 수 없는거죠?
처음 질물과 같은 1봉 내에서 100개 이상의 체결이 몇번 일어났는지 횟수를 지표로 만들경우, 봉이 완성되버리면 차트를 닫고 열면 다시 만들어 낼 수는 없는거죠?
질문이 너무 많고, 우왕좌왕인데^^ 부탁드리겠습니다.^^
2008-12-06
1232
글번호 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
1014
글번호 18597