커뮤니티
예스랭귀지 Q&A
답변완료
[공지] 예스랭귀지 AI 어시스턴트, '예스나 AI' 출시 및 무료 체험 안내
안녕하세요, 예스스탁 입니다.복잡한 수식 공부 없이 여러분의 아이디어를 말하면 시스템 트레이딩 언어 예스랭귀지로 작성해주는 서비스예스나 AI(YesNa AI)가 출시되었습니다.지금 예스나 AI를 직접 경험해 보실 수 있도록 20크레딧(질문권 20회)를 무료로 증정해 드리고 있습니다.바로 여러분의 아이디어를 코드로 변환해보세요.--------------------------------------------------🚀 YesNa AI 핵심 기능- 지표식/전략식/종목검색식 생성: 자연어로 요청하면 예스랭귀지 문법에 맞는 코드를 작성합니다.- 종목검색식 변환 지원: K증권의 종목 검색식을 예스랭귀지로 변환 지원합니다.- 컴파일 검증: 작성된 코드가 실행 가능한지 컴파일러를 통해 문법 검증을 거쳐 결과물을 제공합니다.상세한 서비스 개요 및 활용 방법은 [서비스 소개 페이지]에서 확인하실 수 있습니다.▶ 서비스 소개 페이지: 바로가기서비스 사용 유의사항 및 결제 환불정책은 [이용약관]을 참고 부탁드립니다.▶ 서비스 이용약관: 바로가기💬 이용 문의사용 중 문의사항은 [프로그램 사용법 Q&A] 게시판에서 [예스나 AI] 카테고리를 설정 후 문의해 주시면 상세히 안내해 드리겠습니다.--------------------------------------------------앞으로도 AI를 활용한 다양한 트레이딩 기능들을 지속적으로 선보일 예정입니다.많은 관심과 기대 부탁드립니다.
2026-02-27
1711
글번호 230811
답변완료
재문의 드립니다.
안녕하세요
예스스탁입니다.
수식에서 신호발생 후 몇초뒤 주문은 설정이 되지 않습니다.
문의하신 부분은 시스템 트레이딩 설정창의 부가기능에서
진입지연주문에 2초를 지정하셔야 합니다.
input : sto1(10),sto2(0);
var : stok(0);
input : StartTime(90000),EndTime(65000);
var : Tcond(false);
IF Endtime > starttime Then
SetStopEndofday(Endtime);
Else
{
if sDate != sDate[1] Then
SetStopEndofday(Endtime);
}
if (sdate != sdate[1] and stime >= EndTime) or
(sdate == sdate[1] and stime >= EndTime and stime[1] < EndTime) Then
Tcond = False;
if (sdate != sdate[1] and stime >= StartTime) or
(sdate == sdate[1] and stime >= StartTime and stime[1] < StartTime) Then
{
Tcond = true;
IF Endtime <= starttime Then
{
SetStopEndofday(0);
}
}
stok = StochasticsK(sto1,sto2);
if Tcond == true Then
{
if MarketPosition == 0 and CrossUp(stok,50) and stok < 60 Then
Sell("s1");
if MarketPosition == -1 and IsEntryName("s1") == true and CrossUp(stok,60) Then
Sell();
if MarketPosition == 1 Then
{
if C < L[BarsSinceEntry] Then
ExitLong();
}
}
SetStopProfittarget(PriceScale*200,PointStop);
즐거운 하루되세요
> 아침 님이 쓴 글입니다.
> 제목 : 문의드립니다.
> 스토캐스틱퍼스트 60아래에 있고 50상향돌파 매도. 익절200틱
스토캐스틱퍼스트 60상향돌파 매도청산.후 2초뒤의 매수진입.
스톡캐스틱퍼스트 60보다 캔들종가가 아래에 있어야 하고
매수진입한 그 캔들의 저가보다 캔들종가가 낮게 봉완성되면 손절청산.
오전9시 시작 다음날 06시50분 진입한 종목이 있다면 모두청산 후 시스템완전종료.
수식에서 신호발생 후 가 아니고요. 매입한거 청산하고 2초뒤 반대 진입하려는
수식을 부탁드린겁니다. 다시 한번 잘 읽어보시고 부탁드리겠습니다.
2021-12-20
742
글번호 154669
답변완료
해외선물만기일
안녕하세요
해외선물 연결지수를 이용하여 오버나잇이 되는 프로그램을 작성하여 실제 매매를
할 경우 관련하여 문의드립니다.
- 해외선물 만기일날 매수 또는 매도 진입 신호가 나와 진입한 이후 그 다음날 청산 신호가 나오는 경우 실 매매 에서는 별도의 청산을 하지 않아도 되는지요?
-만일 별도의 수식을 작성해야 한다면 항셍가 나스닥 매매의 경우로 수식 부탁드립니다.
감사합니다.
2021-12-20
897
글번호 154660
답변완료
부탁 드립니다~~
if DayOfWeek(Bdate) < DayOfWeek(Bdate[1]) Then
{
var1 = O;
Var2 = var1[1];
}
if CountIf(M>=30000000000,15) >= 1 and
var2 > 0 and CrossUp(C,var2) Then
Find(1);
위에 것은 1봉전 시가를 돌파 하는 검색식 입니다.
이것을 조금 변형 해서
1봉전 주봉에서 양봉이면 => 종가를 돌파 할 때 종목
1봉전 주봉에서 음봉이면 => 시가를 돌파 할 때 종목
으로 수정좀 부탁 드리겠습니다.
2021-12-20
675
글번호 154655
답변완료
문의드립니다
1
A지표의 당일 최고값
A지표의 당일 최저값
2
A지표의 전일 최고값
A지표의 전일 최저값
3
A지표의 오늘포함한 이틀 최고값
A지표의 오늘포함한 이틀 최저값
각각 나타내고싶습니다
감사합니다
2021-12-20
710
글번호 154654
답변완료
안녕하세요 수식 문의 드립니다.
나스닥 수식 입니다.
1. 나스닥 시작시간을 23시27분으로 변경해주시고, 종료 시간을 새벽 4시로 변경해주세요.
2. 나스닥도 지금 매수매도 신호에 바로 들어가는 것으로 되어있는데, 항셍과 마찬가지로 매수매도 신호 나오면 바로 들어가는 것이 아니라, 15틱 눌림후에 매수매도 신호 나왔던 그 자리에 들어가는 것으로 변경 부탁드립니다.
input : StartTime(223000),EndTime(011000);
input : Length(20), D1(2);
input : 익절(50),손절(30),익절연속횟수(3),손절연속횟수(3);
var : Tcond(false),profit(0),loss(0);
if (sdate != sdate[1] and stime >= EndTime) or
(sdate == sdate[1] and stime >= EndTime and stime[1] < EndTime) Then
Tcond = False;
if (sdate != sdate[1] and stime >= StartTime) or
(sdate == sdate[1] and stime >= StartTime and stime[1] < StartTime) Then
{
Tcond = true;
profit = 0;
loss = 0;
}
if TotalTrades > TotalTrades[1] Then
{
if IsExitName("bp.",1) or IsExitName("bp",1) or IsExitName("sp.",1) or IsExitName("sp",1) Then
profit = profit+1;
Else
profit = 0;
if IsExitName("bl.",1) or IsExitName("bl",1) or IsExitName("sl.",1) or IsExitName("sl",1) Then
loss = loss+1;
Else
loss = 0;
}
var1 = BollBandUp(Length,D1);
var2 = BollBandDown(Length,D1);
if Tcond == true Then
{
If CrossUP(H,var1) and c > o and profit < 익절연속횟수 and loss < 손절연속횟수 then
{
Buy("b",OnClose,DEF,1);
ExitLong("bp.",AtLimit,C+PriceScale*익절,"",1,1);
ExitLong("bl.",AtStop,C-PriceScale*손절,"",1,1);
}
If CrossDown(L,Var2) and C < O and profit < 익절연속횟수 and loss < 손절연속횟수 then
{
Sell("s",OnClose,DEF,1);
ExitShort("sp.",AtLimit,C-PriceScale*익절,"",1,1);
ExitShort("sl.",AtStop,C+PriceScale*손절,"",1,1);
}
}
if MarketPosition == 1 Then
{
ExitLong("bp",AtLimit,EntryPrice+PriceScale*익절,"",1,1);
ExitLong("bl",AtStop,EntryPrice-PriceScale*손절,"",1,1);
}
if MarketPosition == -1 Then
{
ExitShort("sp",AtLimit,EntryPrice-PriceScale*익절,"",1,1);
ExitShort("sl",AtStop,EntryPrice+PriceScale*손절,"",1,1);
}
IF Endtime > starttime Then
SetStopEndofday(Endtime);
Else
{
if sDate != sDate[1] Then
SetStopEndofday(Endtime);
}
if (sdate != sdate[1] and stime >= StartTime) or
(sdate == sdate[1] and stime >= StartTime and stime[1] < StartTime) Then
{
IF Endtime <= starttime Then
{
SetStopEndofday(0);
}
}
2021-12-20
686
글번호 154653
답변완료
안녕하세요 수식 문의 드립니다.
골드 입니다.
1. 골드 시작시간은 22시로 변경 부탁드리고, 끝나는 시간을 24시로 변경부탁드립니다.
2. 골드도 매수매도 신호 바로 진입이 아니라, 5틱 눌림후에 매수매도 신호가 발생한 그 자리에 들어가는 것으로 변경 부탁드립니다.
input : StartTime(205500),EndTime(221000);
input : Length(20), D1(2);
input : 익절(20),손절(15),익절연속횟수(3),손절연속횟수(2);
var : Tcond(false),profit(0),loss(0);
if (sdate != sdate[1] and stime >= EndTime) or
(sdate == sdate[1] and stime >= EndTime and stime[1] < EndTime) Then
{
Tcond = False;
if MarketPosition == 1 Then
ExitLong("bx");
if MarketPosition == -1 Then
ExitShort("sx");
}
if (sdate != sdate[1] and stime >= StartTime) or
(sdate == sdate[1] and stime >= StartTime and stime[1] < StartTime) Then
{
Tcond = true;
profit = 0;
loss = 0;
}
if TotalTrades > TotalTrades[1] Then
{
if IsExitName("bp.",1) or IsExitName("bp",1) or IsExitName("sp.",1) or IsExitName("sp",1) Then
profit = profit+1;
Else
profit = 0;
if IsExitName("bl.",1) or IsExitName("bl",1) or IsExitName("sl.",1) or IsExitName("sl",1) Then
loss = loss+1;
Else
loss = 0;
}
var1 = BollBandUp(Length,D1);
var2 = BollBandDown(Length,D1);
if Tcond == true Then
{
If CrossUP(H,var1) and c > o and profit < 익절연속횟수 and loss < 손절연속횟수 then
{
Buy("b",OnClose,DEF,1);
ExitLong("bp.",AtLimit,C+PriceScale*익절,"",1,1);
ExitLong("bl.",AtStop,C-PriceScale*손절,"",1,1);
}
If CrossDown(L,Var2) and C < O and profit < 익절연속횟수 and loss < 손절연속횟수 then
{
Sell("s",OnClose,DEF,1);
ExitShort("sp.",AtLimit,C-PriceScale*익절,"",1,1);
ExitShort("sl.",AtStop,C+PriceScale*손절,"",1,1);
}}
if MarketPosition == 1 Then
{
ExitLong("bp",AtLimit,EntryPrice+PriceScale*익절,"",1,1);
ExitLong("bl",AtStop,EntryPrice-PriceScale*손절,"",1,1);
}
if MarketPosition == -1 Then
{
ExitShort("sp",AtLimit,EntryPrice-PriceScale*익절,"",1,1);
ExitShort("sl",AtStop,EntryPrice+PriceScale*손절,"",1,1);
}
2021-12-20
778
글번호 154652
답변완료
안녕하세요 수식 문의 드립니다.
일전에 주신 수식 잘활요하고 있습니다. 항셍, 골드, 나스닥 한가지씩 추가 문의 드립니다.
항셍입니다. 항셍 수식입니다.
1. 매수 / 매도 신호시에 바로 진입으로 되있나요?
2. 바로 진입으로 되어있으면 바로진입이 아니라, 매수 매도 신호 발생하고,
10틱 눌림시에 매수매도 신호 발생시점에서 진입하는 것으로 변경 부탁드립니다.
기존수식 입니다.
input : StartTime(101200),EndTime(114000);
input : Length(20), D1(2),n(10);
input : 익절1(30),손절1(30),청산구분시간(103000),익절2(50),손절2(30),익절연속횟수(3),손절연속횟수(2);
var : Tcond(false),profit(0),loss(0),T(0),S(0),Y(0);
if (sdate != sdate[1] and stime >= EndTime) or
(sdate == sdate[1] and stime >= EndTime and stime[1] < EndTime) Then
Tcond = False;
if (sdate != sdate[1] and stime >= StartTime) or
(sdate == sdate[1] and stime >= StartTime and stime[1] < StartTime) Then
{
T = 0;
Tcond = true;
profit = 0;
loss = 0;
}
if TotalTrades > TotalTrades[1] Then
{
if IsExitName("bp1.",1) or IsExitName("bp2.",21) or IsExitName("bp1",1) or IsExitName("bp2",21) or
IsExitName("sp1.",1) or IsExitName("sp2.",1) or IsExitName("sp1",1) or IsExitName("sp2",1) Then
profit = profit+1;
Else
profit = 0;
if IsExitName("bl1.",1) or IsExitName("bl2.",1) or IsExitName("bl1",1) or IsExitName("bl2",1) or
IsExitName("sl1.",1) or IsExitName("sl2.",1) or IsExitName("sl1",1) or IsExitName("sl2",1) Then
loss = loss+1;
Else
loss = 0;
}
var1 = BollBandUp(Length,D1);
var2 = BollBandDown(Length,D1);
if Tcond == true Then
{
If CrossUP(H,var1) and (c > o or (C==O and C >= C[1])) then
{
T = 1;
S = C;
Y = S;
}
If CrossDown(L,Var2) and (C < O or (C==O and C < C[1])) then
{
T = -1;
S = C;
}
if T == 1 and C < Y Then
Y = C;
if T == -1 and C > Y Then
Y = C;
If T == 1 and Y <= S-PriceScale*n and CrossUP(c,S) then
{
T = 2;
if profit < 익절연속횟수 and loss < 손절연속횟수 then
{
Buy("b",OnClose,DEF,1);
if sTime >= StartTime and sTime < 청산구분시간 Then
{
ExitLong("bp1.",AtLimit,C+PriceScale*익절1,"",1,1);
ExitLong("bl1.",AtStop,C-PriceScale*손절1,"",1,1);
}
if sTime >= 청산구분시간 and sTime < Endtime Then
{
ExitLong("bp2.",AtLimit,C+PriceScale*익절2,"",1,1);
ExitLong("bl2.",AtStop,C-PriceScale*손절2,"",1,1);
}
}
}
If T == -1 and Y >= S+PriceScale*n and crossdown(C,S) then
{
T = -2;
if profit < 익절연속횟수 and loss < 손절연속횟수 then
{
Sell("s",OnClose,DEF,1);
if sTime >= StartTime and sTime < 103000 Then
{
ExitShort("sp1.",AtLimit,C-PriceScale*익절1,"",1,1);
ExitShort("sl1.",AtStop,C+PriceScale*손절1,"",1,1);
}
if sTime >= 103000 and sTime < Endtime Then
{
ExitShort("sp2.",AtLimit,C-PriceScale*익절2,"",1,1);
ExitShort("sl2.",AtStop,C+PriceScale*손절2,"",1,1);
}
}
}
}
if MarketPosition == 1 Then
{
if sTime >= StartTime and sTime < 청산구분시간 Then
{
ExitLong("bp1",AtLimit,EntryPrice+PriceScale*익절1,"",1,1);
ExitLong("bl1",AtStop,EntryPrice-PriceScale*손절1,"",1,1);
}
if sTime >= 청산구분시간 and sTime < Endtime Then
{
ExitLong("bp2",AtLimit,EntryPrice+PriceScale*익절2,"",1,1);
ExitLong("bl2",AtStop,EntryPrice-PriceScale*손절2,"",1,1);
}
}
if MarketPosition == -1 Then
{
if sTime >= StartTime and sTime < 103000 Then
{
ExitShort("sp1",AtLimit,EntryPrice-PriceScale*익절1,"",1,1);
ExitShort("sl1",AtStop,EntryPrice+PriceScale*손절1,"",1,1);
}
if sTime >= 103000 and sTime < Endtime Then
{
ExitShort("sp2",AtLimit,EntryPrice-PriceScale*익절2,"",1,1);
ExitShort("sl2",AtStop,EntryPrice+PriceScale*손절2,"",1,1);
}
}
IF Endtime > starttime Then
SetStopEndofday(Endtime);
Else
{
if sDate != sDate[1] Then
SetStopEndofday(Endtime);
}
if (sdate != sdate[1] and stime >= StartTime) or
(sdate == sdate[1] and stime >= StartTime and stime[1] < StartTime) Then
{
IF Endtime <= starttime Then
{
SetStopEndofday(0);
}
}
2021-12-20
672
글번호 154651
답변완료
보조차트에 지표그리기
보조차트에 지표는 못그리는건가요?
가능하다면 샘플코드 부탁드립니다.
감사합니다.
2021-12-20
827
글번호 154650
답변완료
문의
국내ETF 거래
아래 수식에 요청내용을 반영해주십시요.
1)피라미딩 수식 추가 요청
첫 진입 b1
두번째 진입 : 첫번째(1st) 진입가격에서 20 이상 상승 시 피라미딩 진입
세번째 진입 : 첫번째(1st) 진입가격에서 30 이상 상승 시 피라미딩 진입
첫번째 진입 수량 150개
두번째 진입 수량 100개
세번째 진입 수량 50개
2)피라미딩 수식 추가 요청
첫 진입 b1
두번째 진입 : 첫번째(1st) 진입가격에서 20 이상 하락 시 피라미딩 진입
세번째 진입 : 첫번째(1st) 진입가격에서 30 이상 하락 시 피라미딩 진입
첫번째 진입 수량 150개
두번째 진입 수량 100개
세번째 진입 수량 50개
*********************************************************************************
input : n(1);
var : cnt(0),count(0),Lcount(0);
Count = 0 ;
for cnt = 0 to 10 {
if EntryDate(cnt) == sdate then
Count = Count + 1;
}
input:d2(250),d3(150),d4(11),d5(1);
if data2(c>lowd(0)+d2) and data3(c>lowd(0)+d3) and data4(c>lowd(0)+d4) and data5(c<HighD(0)-d5) and count < n Then
Buy("b1");
2021-12-20
600
글번호 154643