커뮤니티
예스랭귀지 Q&A
답변완료
[공지] 예스랭귀지 AI 어시스턴트, '예스나 AI' 출시 및 무료 체험 안내
안녕하세요, 예스스탁 입니다.복잡한 수식 공부 없이 여러분의 아이디어를 말하면 시스템 트레이딩 언어 예스랭귀지로 작성해주는 서비스예스나 AI(YesNa AI)가 출시되었습니다.지금 예스나 AI를 직접 경험해 보실 수 있도록 20크레딧(질문권 20회)를 무료로 증정해 드리고 있습니다.바로 여러분의 아이디어를 코드로 변환해보세요.--------------------------------------------------🚀 YesNa AI 핵심 기능- 지표식/전략식/종목검색식 생성: 자연어로 요청하면 예스랭귀지 문법에 맞는 코드를 작성합니다.- 종목검색식 변환 지원: K증권의 종목 검색식을 예스랭귀지로 변환 지원합니다.- 컴파일 검증: 작성된 코드가 실행 가능한지 컴파일러를 통해 문법 검증을 거쳐 결과물을 제공합니다.상세한 서비스 개요 및 활용 방법은 [서비스 소개 페이지]에서 확인하실 수 있습니다.▶ 서비스 소개 페이지: 바로가기서비스 사용 유의사항 및 결제 환불정책은 [이용약관]을 참고 부탁드립니다.▶ 서비스 이용약관: 바로가기💬 이용 문의사용 중 문의사항은 [프로그램 사용법 Q&A] 게시판에서 [예스나 AI] 카테고리를 설정 후 문의해 주시면 상세히 안내해 드리겠습니다.--------------------------------------------------앞으로도 AI를 활용한 다양한 트레이딩 기능들을 지속적으로 선보일 예정입니다.많은 관심과 기대 부탁드립니다.
2026-02-27
7526
글번호 230811
답변완료
수식 문의
안녕하세요
이식에 5프로 수익시 절반매도 하는 식 넣어주세요
input : 지정일(20130802),투입금액(1000000);
var : idx(0),vol(0);
if CodeCategory == 1 Then{
if BasePrice < 50000 Then
vol = int(int(투입금액/C)/10)*10;
Else
vol = int(투입금액/C);
}
if CodeCategory == 2 Then
vol = int(투입금액/C);
var1 = ma(c,5);
#5일선 상향돌파이고 양봉이면 다음봉시가 매수
if sdate >= 지정일 Then{
if crossup(c,var1) and (C > O or (H == L)) Then{
buy("b",AtMarket,def,vol);
exitlong("bx1",AtStop,L-PriceScale);
}
if MarketPosition == 1 Then{
ExitLong("bx1.",AtStop,L[BarsSinceEntry+1]-PriceScale);
if C >= EntryPrice*1.05 and L <= var1 and C < O Then
ExitLong("bx2",AtMarket);
}
}
SetStopProfittarget(100,PercentStop);
2013-12-23
171
글번호 70749
답변완료
진입신호가 발생된 봉에서 시가매매
항상 수고 많으십니다........
자동매매를 이용하는중입니다...
현재는 하나의 봉에서 진입/청산신호가 발생시에 봉의 종가에서 진입과 청산매매가 이루어집니다.
제가 원하는것은 진입/청산신호가 발생시에 즉시 또는 봉의 시가에서 매매가 이루어지도록 하게 하고싶습니다...
어떻게 해야할까요..?
도움좀 주세요...
2013-12-24
210
글번호 70743
답변완료
하나만 더 문의 드립니다
매수조건으로 매수한후 저점 이탈시 스탑을 하려고 합니다
매수조건은
c [2]< o[2] and
L[2] > C[1] and
c [1]< o[1] and
C[2] <= H[0] and
CrossUp(C,value4) and
C >O Then
buy("매수4") 라 할때
1봉전의 저가를 이탈하면 스탑을 하라고 하려면 어떻게 해야 하나요?
2013-12-23
168
글번호 70741
답변완료
누적. 손해. 식요청
안녕하세요
1계약 누적하여. 연속. 10 포인트
손실나면. 2계약. 으로. 연속. 20 포인트. 이익
목표. 까지. 진행하라. 그리고. 다시. 원점. 1계약 시작한다
감사^^
2013-12-23
147
글번호 70739
답변완료
바쁘신데 수고하십니다 수정부탁딉니다
아래식에서 시작시간과 끝시간을 설정하고 있는데 ....문제는 시작시간 이전에 기준가를
업, 다운 한것을 기억하고 있다가 시작시간에 바로 진입신호가 나옵니다
이것을 시작시간 설정할 때 부터 처음으로 인식하여 시작시간이전에 기준가 통과 한것은 인식하지 못하고, 시작시간 셋팅이후부터 기준가를 업, 다운 한 것을 인식하여 시스템이 작동하도록 부탁합니다
그리고 매매 시간을 외부변수로 설정하지 않고 내부변수로 안에서 직접 셋팅할수 있도록 수정 부탁드립니다..
input : 매수진입별횟수(2),매도진입별횟수(2),당일최대매수횟수(5),당일최대매도횟수(5),당일진입횟수(3);
input : 시작시간(93000),끝시간(150000);
var : direction(0),HH(0),LL(0),cnt(0),count(0),기준가(0);
var : Bcond1(false),Bcond2(false),Bcond3(false),Bcond4(false),Bcond5(false);
var : Scond1(false),Scond2(false),Scond3(false),Scond4(false),Scond5(false);
var : Bcnt1(0),Bcnt2(0),Bcnt3(0),Bcnt4(0),Bcnt5(0),Didx(0);
var : Scnt1(0),Scnt2(0),Scnt3(0),Scnt4(0),Scnt5(0),Buycnt(0),Sellcnt(0);
var : 당일주간장시가(0),전일주간장시가(0),updown(0);
if stime == 90000 or (stime > 090000 and stime[1] < 090000) Then{
당일주간장시가 = O;
전일주간장시가 = 당일주간장시가[1];
기준가 = 전일주간장시가 ;
Condition1 = false;
}
var1 = 기준가-6.0;
var2 = 기준가-3.0;
var3 = 기준가+3.0;
var4 = 기준가+6.0;
if condition1 == false and ((H >= 기준가 and L >= 기준가) or crossup(c,기준가) or CrossDown(C,기준가)) Then{
Condition1 = true;
updown = 0;
}
if Condition1 == true and (H >= var3 or L <= var2) Then
UPdown = updown+1;
if stime == 90000 or (stime > 090000 and stime[1] < 090000) Then{
direction = 0;
Didx = 0;
}
count = 0;
Bcnt1 = 0;Bcnt2 = 0;Bcnt3 = 0;Bcnt4 = 0;
Scnt1 = 0;Scnt2 = 0;Scnt3 = 0;Scnt4 = 0;
Buycnt = 0;
Sellcnt = 0;
for cnt = 0 to 20{
if sdate == EntryDate(cnt) and EntryTime(cnt) >= 090000 and EntryTime(cnt) <= 151500 Then{
count = count+1;
if IsEntryName("b1",cnt) == true Then Bcnt1 = Bcnt1+1;
if IsEntryName("b2",cnt) == true Then Bcnt2 = Bcnt2+1;
if IsEntryName("b3",cnt) == true Then Bcnt3 = Bcnt3+1;
if IsEntryName("b4",cnt) == true Then Bcnt4 = Bcnt4+1;
if IsEntryName("s1",cnt) == true Then Scnt1 = Scnt1+1;
if IsEntryName("s2",cnt) == true Then Scnt2 = Scnt2+1;
if IsEntryName("s3",cnt) == true Then Scnt3 = Scnt3+1;
if IsEntryName("s4",cnt) == true Then Scnt4 = Scnt4+1;
if MarketPosition(cnt) == 1 then
Buycnt = Buycnt+1;
if MarketPosition(cnt) == -1 then
SEllcnt = Sellcnt+1;
}
}
if stime >= 090000 and stime <= 151500 then{
Didx = Didx+1;
if Didx > 1 Then{
if crossup(C,var1) Then {
direction = 1;
HH = H;
}
if crossup(C,var2) Then {
direction = 2;
HH = H;
}
if crossup(C,var3) Then {
direction = 3;
HH = H;
}
if crossup(C,var4) Then {
direction = 4;
HH = H;
}
if CrossDown(C,var1) Then {
direction = -1;
LL = L;
}
if CrossDown(C,var2) Then {
direction = -2;
LL = L;
}
if CrossDown(C,var3) Then{
direction = -3;
LL = L;
}
if CrossDown(C,var4) Then {
direction = -4;
LL = L;
}
}
if H > HH Then HH = H;
if L < LL Then LL = L;
Bcond1 = (count == 0 and countif(direction == 1 and direction[1] != 1,Didx) >= 1) or
(count >= 1 and MarketPosition != 0 and countif(direction == 1 and direction[1] != 1,BarsSinceEntry) >= 1) or
(count >= 1 and MarketPosition == 0 and countif(direction == 1 and direction[1] != 1,BarsSinceExit(1)) >= 1);
Bcond2 = (count == 0 and countif(direction == 2 and direction[1] != 2,Didx) >= 1) or
(count >= 1 and MarketPosition != 0 and countif(direction == 2 and direction[1] != 2,BarsSinceEntry) >= 1) or
(count >= 1 and MarketPosition == 0 and countif(direction == 2 and direction[1] != 2,BarsSinceExit(1)) >= 1);
Bcond3 = (count == 0 and countif(direction == 3 and direction[1] != 3,Didx) >= 1) or
(count >= 1 and MarketPosition != 0 and countif(direction == 3 and direction[1] != 3,BarsSinceEntry) >= 1) or
(count >= 1 and MarketPosition == 0 and countif(direction == 3 and direction[1] != 3,BarsSinceExit(1)) >= 1);
Bcond4 = (count == 0 and countif(direction == 4 and direction[1] != 4,Didx) >= 1) or
(count >= 1 and MarketPosition != 0 and countif(direction == 4 and direction[1] != 4,BarsSinceEntry) >= 1) or
(count >= 1 and MarketPosition == 0 and countif(direction == 4 and direction[1] != 4,BarsSinceExit(1)) >= 1);
Scond1 = (count == 0 and countif(direction == -1 and direction[1] != -1,Didx) >= 1) or
(count >= 1 and MarketPosition != 0 and countif(direction == -1 and direction[1] != -1,BarsSinceEntry) >= 1) or
(count >= 1 and MarketPosition == 0 and countif(direction == -1 and direction[1] != -1,BarsSinceExit(1)) >= 1);
Scond2 = (count == 0 and countif(direction == -2 and direction[1] != -2,Didx) >= 1) or
(count >= 1 and MarketPosition != 0 and countif(direction == -2 and direction[1] != -2,BarsSinceEntry) >= 1) or
(count >= 1 and MarketPosition == 0 and countif(direction == -2 and direction[1] != -2,BarsSinceExit(1)) >= 1);
Scond3 = (count == 0 and countif(direction == -3 and direction[1] != -3,Didx) >= 1) or
(count >= 1 and MarketPosition != 0 and countif(direction == -3 and direction[1] != -3,BarsSinceEntry) >= 1) or
(count >= 1 and MarketPosition == 0 and countif(direction == -3 and direction[1] != -3,BarsSinceExit(1)) >= 1);
Scond4 = (count == 0 and countif(direction == -4 and direction[1] != -4,Didx) >= 1) or
(count >= 1 and MarketPosition != 0 and countif(direction == -4 and direction[1] != -4,BarsSinceEntry) >= 1) or
(count >= 1 and MarketPosition == 0 and countif(direction == -4 and direction[1] != -4,BarsSinceExit(1)) >= 1);
if stime > 090000 and stime < 150000 and count < 당일진입횟수 and stime >= 시작시간 and stime < 끝시간 then{
if BuyCnt < 당일최대매수횟수 then{
if direction == 1 and HH >= var1+0.5 and Bcond1 == true and Bcnt1 < 매수진입별횟수 Then buy("b1",AtLimit,HH-0.4);
if direction == 2 and HH >= var2+0.5 and Bcond2 == true and Bcnt2 < 매수진입별횟수 Then buy("b2",AtLimit,HH-0.4);
if direction == 3 and HH >= var3+0.5 and Bcond3 == true and Bcnt3 < 매수진입별횟수 Then buy("b3",AtLimit,HH-0.4);
if direction == 4 and HH >= var4+0.5 and Bcond4 == true and Bcnt4 < 매수진입별횟수 Then buy("b4",AtLimit,HH-0.4);
}
if Sellcnt < 당일최대매도횟수 then{
if direction == -1 and LL <= var1-0.5 and Scond1 == true and Scnt1 < 매도진입별횟수 Then Sell("s1",AtLimit,LL+0.4);
if direction == -2 and LL <= var2-0.5 and Scond2 == true and Scnt2 < 매도진입별횟수 Then Sell("s2",AtLimit,LL+0.4);
if direction == -3 and LL <= var3-0.5 and Scond3 == true and Scnt3 < 매도진입별횟수 Then Sell("s3",AtLimit,LL+0.4);
if direction == -4 and LL <= var4-0.5 and Scond4 == true and Scnt4 < 매도진입별횟수 Then Sell("s4",AtLimit,LL+0.4);
}
}
}
2013-12-23
151
글번호 70732
답변완료
씨스템 문의 드립니다.
수고 하십니다.
항상 감사드립니다.
문의 드리는 것은 아침 장이 시작되면 캔들을 카운팅하는것입니다.
양봉 음봉 ( 시가 종가 같은 봉은 카운팅에서 제외) 각각 N개째가 발생하면 양봉은 매수화살표 음봉은 매도 화살표 표시하게 하는것입니다.
첫번째 신호로 진입하고요 다음에 반대로 나오면 청산을 하구요.
같은 신호가 연속으로 나오면 2개 까지만 진입하고 반대 신호나오면 모두 청산합니다.
무포지션있을때 나오는 신호에만 진입합니다.
연속된 같은 신호 3개 까지 진입하는 로직하고
연속된같은 신호 2개 까지만 진입하는 로직을 부탁드립니다.
고맙습니다.
꾸벅
2013-12-23
174
글번호 70729
답변완료
지표식 부탁드립니다.
만들어 주신 HPI 헤릭청산지수를 사용자함수로 사용 중입니다.
이 식을 보니
MULT 와 FACT 두 가지 입력값이 있던데
각각 의미가 무엇인가요?
그리고
이걸로 볼린저 밴드를 만들어 주실 수 있나요?
2013-12-23
162
글번호 70726
답변완료
식. 부탁해요.
안녕하세요
매도건수.1001 >. 매수건수. 1
위와같이. 천개차이나고
매도잔량. 11개. >. 매수잔량.1 개 이면
매도.
위내용. 반대면. 매수
감사합니다^^
2013-12-23
148
글번호 70725
답변완료
문의드립니다
안녕하세요 첨부로 문의 드립니다
2013-12-23
167
글번호 70724