커뮤니티
예스랭귀지 Q&A
답변완료
[공지] 예스랭귀지 AI 어시스턴트, '예스나 AI' 출시 및 무료 체험 안내
안녕하세요, 예스스탁 입니다.복잡한 수식 공부 없이 여러분의 아이디어를 말하면 시스템 트레이딩 언어 예스랭귀지로 작성해주는 서비스예스나 AI(YesNa AI)가 출시되었습니다.지금 예스나 AI를 직접 경험해 보실 수 있도록 20크레딧(질문권 20회)를 무료로 증정해 드리고 있습니다.바로 여러분의 아이디어를 코드로 변환해보세요.--------------------------------------------------🚀 YesNa AI 핵심 기능- 지표식/전략식/종목검색식 생성: 자연어로 요청하면 예스랭귀지 문법에 맞는 코드를 작성합니다.- 종목검색식 변환 지원: K증권의 종목 검색식을 예스랭귀지로 변환 지원합니다.- 컴파일 검증: 작성된 코드가 실행 가능한지 컴파일러를 통해 문법 검증을 거쳐 결과물을 제공합니다.상세한 서비스 개요 및 활용 방법은 [서비스 소개 페이지]에서 확인하실 수 있습니다.▶ 서비스 소개 페이지: 바로가기서비스 사용 유의사항 및 결제 환불정책은 [이용약관]을 참고 부탁드립니다.▶ 서비스 이용약관: 바로가기💬 이용 문의사용 중 문의사항은 [프로그램 사용법 Q&A] 게시판에서 [예스나 AI] 카테고리를 설정 후 문의해 주시면 상세히 안내해 드리겠습니다.--------------------------------------------------앞으로도 AI를 활용한 다양한 트레이딩 기능들을 지속적으로 선보일 예정입니다.많은 관심과 기대 부탁드립니다.
2026-02-27
8210
글번호 230811
답변완료
시스템식 변환 부탁
운영자님 수고하십니다.
아래 ct식을
변환 부탁드립니다.
입력변수 : p1(0.015), p2(0.1), ax1(36), a1(37), p3(0.016), p3(0.096), ax2(28), a2(26), s1(17), s2(1), len1(13)
settestmode
Var1=psar(p1, p2)
Var3=psar(p3, p4)
Var11=abs(highd-highd(1)) '+DM
Var12=abs(lowd-lowd(1)) '-DM
Var13=abs(closed-closed(1)) 'CL
Var14=maxlist(1,Var11,Var12,Var13) 'TR
Var15=mov(Var11, ax1, s) '+DMN
Var16=mov(Var12, ax1, s) '-DMN
Var17=mov(Var14, ax1, s) 'TRN
If Var17<>0 Then
Var18= Var5/var17 '+DI
Var19= Var6/var17 '-DI
End If
If (Var18+var19)<> 0 Then
Var20= (abs(Var18-var19)*100)/(Var18+var19)
Var2=mov(Var20, a1, s) 'ADX
End If
Var31=abs(highd-highd(1)) '+DM
Var32=abs(lowd-lowd(1)) '-DM
Var33=abs(closed-closed(1)) 'CL
Var34=maxlist(1,Var31,Var32,Var33) 'TR
Var35=mov(Var31, ax2, s) '+DMN
Var36=mov(Var32, ax2, s) '-DMN
Var37=mov(Var34, ax2, s) 'TRN
If Var37<>0 Then
Var38= Var35/var37 '+DI
Var39= Var36/var37 '-DI
End If
If (Var38+var39) <>0 Then
Var40= (abs(Var38-var39)*100)/(Var38+var39)
Var4=mov(Var40, a2, s) 'ADX
End If
Var5=sonar(close,s1, s2, Diff)
Var6=mov(Var5, len1,s)
If crossup(close, Var1) Then
Cond1=True
Else
Cond1=False
End If
Cond2= Var2(1)< Var2
If Cond1 Then
If (Cond2(0) And Cond2(1)) Or (Cond2(1) And Cond2(2)) Or (Cond2(2) And Cond2(3)) Then
Call buy("매수", Atmarket)
End If
End If
If crossdn(close, Var3) Then
Cond3=True
Else
Cond3=False
End If
Cond4= Var4(1)>var4(0) '상승 추세로 원할 시 Var4(1)< var4(0)
If Cond3=True Then
If (Cond4 And Cond4(1) And Cond4(2)) Or (Cond4(1) And Cond4(2) And Cond4(3)) Or (Cond4(2) And Cond4(3) And Cond4(4)) Or (Cond4(3) And Cond4(4) And Cond4(5)) Or (Cond4(4) And Cond4(5) And Cond4(6)) Then
Call sell("매도", Atmarket)
End If
End If
If position=-1 Then
If crossup(Var5, Var6) Then 'sonar 신호선교차
Call exitshort("매도청산", Atmarket)
End If
End If
2013-11-06
247
글번호 69259
답변완료
매도,매수 타이밍 분석
매도, 매수 타이밍에 대해 알려주는 프로그램이 있다고 들었는데 저는 도통 찾을 수가 없습니다. 일간,주간,종목별로 매도,매수타이밍을 이야기하는 것은 아니고, 적립식펀드를 가지고 있는 사람들이 참고 할 수 있는 매도,매수 타이밍을 알 수 있었으면 합니다. 가능한가요???
2013-11-06
245
글번호 69258
답변완료
시스템식 부탁드립니다.
매수조건1, 매수조건2, 매수조건3
매도조건1, 매도조건2, 매도조건3
상기와 같은 조건이 있을때
매수조건 3개가 동시 만족하는 시점(마지막 매수조건)에서 매수진입
매도조건 3개 중 1개 발생시 매수청산
매도조건 3개가 동시 만족하는 시점(마지막 매도조건)에서 매도진입
매수조건 3개 중 1개 발생이 매도청산
시스템식 부탁드립니다.
2013-11-06
213
글번호 69257
엠제이 님에 의해서 삭제되었습니다.
2013-11-06
2
글번호 69256
답변완료
감사합니다.
항상 친절한 답변에 감사드립니다.
손절, 트레일링 스탑(시스템매매설정 창의 강제청산 이용 중)후 일정시간이 경과(40분)후에만 진입이 허용되는 수식 부탁드립니다.
감사합니다
2013-11-06
200
글번호 69255
답변완료
33288 수정 바랍니다
수식 적용 결과가 의도한 내용이 안나옵니다
오늘 유니퀘스트 적용 결과 나타나지 안습니다
특정 시작일 (예를 들어 11/6일) 장시작가 부터 적용하는 식으로
수정 바랍니다
수정후 유니케스트와 같은 종목에 시험 적용 바랍니다
2013-11-06
237
글번호 69254
답변완료
외부데이터 일봉값 참조하기
1. 선물 수식입니다.
2. 주챠트는 분봉입니다.
3. 외부Data(예: 외국인 현물 순매수금액)의 일봉평균으로 매매대금의 평균을 구하고자합니다.
(직전 5(10/20등)일간 최고/최저의 평균 등)
4. 날짜가 바뀌는 첫 봉에서만 계산합니다.
5. 해당식을 아래와 같이 작성하였습니다.
6. 올바른 값이 리턴되지 않아서 오류에 대한 분석을 부탁드립니다.
==============================================================================
If DayIndex == 0 Then {
JJ=0; KK=0;
D2HighSum=0; D2LowSum=0;
For II=1 To D2Len {
If Data2(HighD(II)) > 0 Then {
D2HighSum= D2HighSum + Data2(HighD(II));
JJ= JJ+1; }
If Data2(LowD(II)) < 0 Then {
D2LowSum= D2LowSum + Data2(LowD(II));
KK= KK+1; }
}
If JJ > 0 Then
D2HighAvg= D2HighSum/JJ;
If KK > 0 Then
D2LowAvg= D2LowSum/KK;
}
2013-11-06
237
글번호 69253
답변완료
수정부탁드립니다
1. 아래수식에서 매수든 매도든 구분없이 전체 하루 진입 횟수를 1번내지 2번등 진입횟수를 제한 할수 있도록 부탁드리며,
2. 야간장 흐름에서 기준바를 터치 하여 다른바를 터지하지 않고 끝났다면 그 흐름을 당일 매매에 반영하려고 합니다 그 흐름을 인식하여 당일매매에 반영될수 있도록 수정 부탁드립니다
input : 매수진입별횟수(2),매도진입별횟수(2),당일최대매수횟수(5),당일최대매도횟수(5);
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);
if stime == 90000 or (stime > 090000 and stime[1] < 090000) Then
기준가 = 전일주간장시가 ;
var1 = 기준가-6.0;
var2 = 기준가-3.0;
var3 = 기준가+3.0;
var4 = 기준가+6.0;
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 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-11-06
225
글번호 69252
답변완료
지연후 진입
안녕하세요.
(배경)
데이트레이딩 당일청산인데
##1
진입신호가 A, B ,C, D, E가 있습니다.
다섯개 신호 모두 하루 한번만 실행되도록 했고
각각은 리버스시스템이 아니라 특정신호가 청산되어
포지션이 없을 때만 다른 신호가 발생하도록 했습니다.
(요청)
1. A~E의 원래 신호발생시에는 화면에 "예비매수A"라고 강조표시가 뜨고
2. 매수신호자체는 원래 매수하기로 되어있던 가격으로부터 0.1%하락한 상황에서
"매수A"의 진입신호가 나게 하려면 어떻게 할까요?
## 2.
동일 로직으로 첫번째 매수신호에는 진입하지 않고 두번째 매수신호가 났을 때 진입한다는
식은 어떻게 표현하나요?
감사합니다.
감사합니다.
2013-11-06
230
글번호 69251