커뮤니티
예스랭귀지 Q&A
답변완료
[공지] 예스랭귀지 AI 어시스턴트, '예스나 AI' 출시 및 무료 체험 안내
안녕하세요, 예스스탁 입니다.복잡한 수식 공부 없이 여러분의 아이디어를 말하면 시스템 트레이딩 언어 예스랭귀지로 작성해주는 서비스예스나 AI(YesNa AI)가 출시되었습니다.지금 예스나 AI를 직접 경험해 보실 수 있도록 20크레딧(질문권 20회)를 무료로 증정해 드리고 있습니다.바로 여러분의 아이디어를 코드로 변환해보세요.--------------------------------------------------🚀 YesNa AI 핵심 기능- 지표식/전략식/종목검색식 생성: 자연어로 요청하면 예스랭귀지 문법에 맞는 코드를 작성합니다.- 종목검색식 변환 지원: K증권의 종목 검색식을 예스랭귀지로 변환 지원합니다.- 컴파일 검증: 작성된 코드가 실행 가능한지 컴파일러를 통해 문법 검증을 거쳐 결과물을 제공합니다.상세한 서비스 개요 및 활용 방법은 [서비스 소개 페이지]에서 확인하실 수 있습니다.▶ 서비스 소개 페이지: 바로가기서비스 사용 유의사항 및 결제 환불정책은 [이용약관]을 참고 부탁드립니다.▶ 서비스 이용약관: 바로가기💬 이용 문의사용 중 문의사항은 [프로그램 사용법 Q&A] 게시판에서 [예스나 AI] 카테고리를 설정 후 문의해 주시면 상세히 안내해 드리겠습니다.--------------------------------------------------앞으로도 AI를 활용한 다양한 트레이딩 기능들을 지속적으로 선보일 예정입니다.많은 관심과 기대 부탁드립니다.
2026-02-27
3598
글번호 230811
답변완료
문의드립니다.
1. 연속 2개 양봉 시 다음봉 시가에서 매수 진입
2. 진입 후 음봉 발생 시 다음 봉 시가에서 청산
수식 부탁드립니다.
2020-11-14
541
글번호 143885
답변완료
현재 있는 수식에서 분할매도 기능 추가 부탁드려요~~
제가 사용하고 있는 수식인데요....
매도 되는 수식이 두개가 있는데
1) 전체 진입 매수 평균가에 10% 수익시 일괄 청산
2) 기타 보조지수 를 충족시 분할 청산
거기에서
2번의 경우는 분할매도로 청산되는데
1번의 조건을 만족시에도 분할 매도 되게 수식 부탁드림니다.~~
input : 시작일(19000101);
input : 일봉RSI기간(30);
input : 일봉RSI값1(52),일봉RSI값2(36),일봉RSI값3(30);
input : 최대투자금액(1500);
input : 진입금액1(5);
input : 진입금액2(15);
input : 진입금액3(20);
input : 진입금액4(25);
input : 진입금액5(30);
input : 진입금액6(35);
input : 진입금액7(40);
input : 진입금액8(50);
input : 진입금액9(60);
input : 진입금액10(70);
input : 이차진입금액(100);
input : 삼차진입금액(200);
input : MFI기간(15),MFI값(90);
input : 심리도기간(15),심리도값(80);
# 보조지수 충족시
input : 분할매도횟수(25);
input : 분할매도퍼센트(10);
input: 청산수익률(1.09);
var : mav(0,data2),MM(0,Data3),SS(0,Data3);
var : MMM(0,Data2),SSS(0,Data2),Xcnt(0,Data2),Xvol(0,data1);
MM = Data3(mfi(MFI기간));
SS = Data3(Simrido(심리도기간));
MMM = Data2(mfi(MFI기간));
SSS = Data2(Simrido(심리도기간));
var : vol(0);
var : RSI2(0,Data2);
RSI2 = Data2(RSI(일봉RSI기간));
if Data1(sDate) >= 시작일 Then
{
if MarketPosition == 0 or (MarketPosition == 1 and AvgEntryPrice*CurrentContracts < 최대투자금액*10000 ) Then
{
if data1(sTime == 93000 or sTime == 120000 ) Then # or sTime == 123000
{
if Data2(RSI2 > 일봉RSI값1) Then
{
if MarketPosition == 0 or (MarketPosition == 1 and C >= AvgEntryPrice*0.98) Then
vol = Floor(진입금액1*10000/c);
if MarketPosition == 1 and C < AvgEntryPrice*0.98 and C >= AvgEntryPrice*0.96 Then
vol = Floor(진입금액2*10000/c);
if MarketPosition == 1 and C < AvgEntryPrice*0.96 and C >= AvgEntryPrice*0.94 Then
vol = Floor(진입금액3*10000/c);
if MarketPosition == 1 and C < AvgEntryPrice*0.94 and C >= AvgEntryPrice*0.92 Then
vol = Floor(진입금액4*10000/c);
if MarketPosition == 1 and C < AvgEntryPrice*0.92 and C >= AvgEntryPrice*0.90 Then
vol = Floor(진입금액5*10000/c);
if MarketPosition == 1 and C < AvgEntryPrice*0.90 and C >= AvgEntryPrice*0.88 Then
vol = Floor(진입금액6*10000/c);
if MarketPosition == 1 and C < AvgEntryPrice*0.88 and C >= AvgEntryPrice*0.86 Then
vol = Floor(진입금액7*10000/c);
if MarketPosition == 1 and C < AvgEntryPrice*0.86 and C >= AvgEntryPrice*0.84 Then
vol = Floor(진입금액8*10000/c);
if MarketPosition == 1 and C < AvgEntryPrice*0.84 and C >= AvgEntryPrice*0.82 Then
vol = Floor(진입금액9*10000/c);
if MarketPosition == 1 and C < AvgEntryPrice*0.82 and C >= AvgEntryPrice*0.80 Then
vol = Floor(진입금액10*10000/c);
Buy("불타기매매1",OnClose,DEf,vol);
}
if Data2(RSI2 < 일봉RSI값2 and RSI2 > 일봉RSI값3 ) Then
{
Buy("하락과도매매1",OnClose,DEf,Floor(이차진입금액*10000/c));
}
if Data2(RSI2 < 일봉RSI값3) Then
{
Buy("폭락과도매매1",OnClose,DEf,Floor(삼차진입금액*10000/c));
}
}
}
}
if MarketPosition == 1 Then
{
ExitLong("bx",AtLimit,AvgEntryPrice*청산수익률);
}
if MM > MFI값 or SS > 심리도값 or MMM > MFI값 or SSS > 심리도값 Then
{
xcnt = xcnt+1;
if Xcnt <= (분할매도횟수-1) Then
Xvol = Floor(MaxContracts*분할매도퍼센트/100);
else
Xvol = CurrentContracts;
if Xcnt <= 분할매도횟수 Then
exitlong("청산",atlimit,C,"",Xvol,2);
}
Else
xcnt = 0;
2020-11-14
567
글번호 143884
답변완료
주종목(Data1) 시스템과 참조종목(Data2) 시스템의 합성
안녕하세요.
간단히 말씀드리면 파라볼릭 시스템과 주가 이평선 골드크로스 시스템을 AND 조건으로 합성하고자 합니다.
1. 아래 로직을 시스템으로 작성하고 싶습니다.
1-1. 매수 진입
(1) 주종목(Data1)은 3분봉이고, 주종목의 파라볼릭(0.02, 0.2) 시스템에서 매수 신호가 발생하거나 매수 신호가 유지된다.
(2) 참조종목(Data2, 정확하게는 타주기)은 5분봉이고, 참조종목은 종가가 20봉 이평선을 상향 돌파하거나 상향 돌파가 유지된다.
(3) 위 (1), (2) 조건을 모두 만족하면, 매수 진입하라.
1-2. 매수 청산
(1) 주종목(Data1)의 파라볼릭(0.02, 0.2) 시스템에서 매도 신호가 발생하면 매수 청산하라.
<매도 진입, 매도 청산: 위에 있는 매수 진입, 매수 청산과 반대 조건입니다>
1-3. 매도 진입
(1) 주종목(Data1)은 3분봉이고, 주종목의 파라볼릭(0.02, 0.2) 시스템에서 매도 신호가 발생하거나 매도 신호가 유지된다.
(2) 참조종목(Data2)은 5분봉이고, 참조종목은 종가가 20봉 이평선을 하향 이탈하거나 하향 이탈이 유지된다.
(3) 위 (1), (2) 조건을 모두 만족하면, 매도 진입하라.
1-4. 매도 청산
(1) 주종목(Data1)의 파라볼릭(0.02, 0.2) 시스템에서 매수 신호가 발생하면 매도 청산하라.
2. 주의 사항
2-1. 위 진입(매수, 매도)은 파라볼릭 시스템과 주가 이평선 골드크로스(데드크로스) 시스템을 AND 조건으로 합성한 것입니다. 그런데, 주가 이평선의 진입 신호를 참조종목(같은 종목의 타주기)에서 가져오겠다는 것이 핵심인데, 작성한 시스템의 결과가 예상과 다르게 나타납니다.
2-2. 아래는 매수 진입, 매수 청산의 경우에 한정한 시스템입니다. 그러나 아래 시스템을 적용했더니 첨부화일 1(그림 1)에 있듯이 매수신호가 발생해야 하는 봉에서 매수신호가 전혀 없네요. 첨부화일 2(그림 2)에는 예상과 다른 봉에서 매수신호가 발생합니다. 예상과 다르게 신호가 나오게 어디가 잘못되서 그런지 모르겠네요.
Input : af(0.02), maxAF(0.2);
Input : shortPeriod(20), longPeriod(50);
Var : value(0);
Var : mav(0), sarv(0), Bcond(false), Scond(false);
Var : mav1(0,Data1),mav2(0,Data1);
Var : avg1(0,Data2),avg2(0,Data2);
mav = Ema(c,shortPeriod);
sarv = csar(af,maxAF);
mav1 = Data1(Ema(C,shortPeriod));
mav2 = Data1(Ema(C,longPeriod));
avg1 = Data2(Ema(C,shortPeriod));
avg2 = Data2(Ema(C,longPeriod));
Bcond = Data2(C) > avg1 and Data1(C) > sarv;
# 매수 진입
If MarketPosition<=0 and Bcond == true and Bcond[1] == false Then
{
Buy();
}
# 매수 청산
If MarketPosition==1 and C < sarv Then
{
ExitLong();
}
많은 도움에 대단히 감사합니다.
2020-11-14
545
글번호 143883
답변완료
문의 드립니다.
안녕하세요
아래 지표를 사용중에 있는데요..
Input : Period(5);
var1 = ma(C,Period+0);
var2 = ma(C,Period+1);
var3 = ma(C,Period+2);
var4 = ma(C,Period+3);
var5 = ma(C,Period+4);
var6 = ma(C,Period+5);
var7 = ma(C,Period+6);
var8 = ma(C,Period+7);
var9 = ma(C,Period+8);
var10 = ma(C,Period+9);
var11 = ma(C,Period+10);
plot1(var1,"이동평균0",iff(var1>var1[1],YELLOW,GREEN));
plot2(var2,"이동평균1",iff(var2>var2[1],YELLOW,GREEN));
plot3(var3,"이동평균2",iff(var3>var3[1],YELLOW,GREEN));
plot4(var4,"이동평균3",iff(var4>var4[1],YELLOW,GREEN));
plot5(var5,"이동평균4",iff(var5>var5[1],YELLOW,GREEN));
plot6(var6,"이동평균5",iff(var6>var6[1],YELLOW,GREEN));
plot7(var7,"이동평균6",iff(var7>var7[1],YELLOW,GREEN));
plot8(var8,"이동평균7",iff(var8>var8[1],YELLOW,GREEN));
plot9(var9,"이동평균8",iff(var9>var9[1],YELLOW,GREEN));
plot10(var10,"이동평균9",iff(var10>var10[1],YELLOW,GREEN));
plot11(var11,"이동평균10",iff(var11>var11[1],YELLOW,GREEN));
이지표를 변수를 조정해서 3개를 사용중입니다.
변수는 1 . 5 . 15
이렇게 사용중입니다.
여기서 1 변수에서 제일 작은 이평과 15 변수에서 제일 큰 이평이 서로 크로스 할때
매수,매도 신호가 나오게 수식좀 만들어 주시면 감사하겠습니다.
그리고요
선색이 노랑색과 연두색인데요...
모든선들이 노랑색으로 변하면 매수 신호
모든선들이 연두색으로 변하면 매도 신호 나오게도 부탁드립니다.
감사합니다.
2020-11-14
516
글번호 143882
답변완료
문의 드립니다.
보유하고 있는 포지션이 청산되면
그날은 신호가 새로 나와도
진입을 안하는 수식을 작성하고 싶습니다.
차트는 브이아이 금융투자의 연결_Euro-FX 입니다.
2020-11-13
589
글번호 143881
답변완료
매매시스템 오류 검증
항상 감사합니다
아래시스템식 검증 부탁드립니다.
input : 시작시간(090000),끝시간(113000);
var : Start(false),entrycnt(0),Bcond(false),Bcond1(false),Scond(false),Scond1(false),idx(0);
var : NP(0),PreNP(0),dayPL(0);
NP = NetProfit;
if stime == 시작시간 or (stime > 시작시간 and stime[1] < 시작시간) Then{
Start = True;
entrycnt = 0;
Idx = 0;
PreNP = NP;
}
dayPL = (NP-PreNP)+PositionProfit;
Idx = idx+1;
if stime == 끝시간 or (stime > 끝시간 and stime[1] < 끝시간) Then
Start = false;
if stime == 090000 or (stime > 090000 and stime[1] < 090000) Then # 현지시간_ 09:00 장시작 #
Entrycnt = 0;
Bcond = t100==1 and var20>var10 and t60==1 and c>var480 ;
Scond = t100==-1 and var20<var10 and t60==-1 and c<var480 ;
Condition1 = ExitDate(1) == true and MarketPosition(1) == 1 and
(IsExitName("eB_청산",1) == true or IsExitName("StopLoss",1) == true);
Condition2 = ExitDate(1) == true and MarketPosition(1) == -1 and
(IsExitName("eS_청산",1) == true or IsExitName("StopLoss",1) == true);
if MarketPosition != 0 and MarketPosition != MarketPosition[1] Then
Entrycnt = Entrycnt+1;
if Idx >= 1 and
Start == true and
Bcond == true and
((entrycnt == 0) or (entrycnt >= 1 and MarketPosition == 0 and MarketPosition(1) != 1) or (MarketPosition == -1)) and #동일방향 재진입금지#
(EntryCnt == 0 or MarketPosition == -1 or (EntryCnt > 0 and MarketPosition == 0 and Condition1 == False )) Then {
if dayPL <= PriceScale*30 and EntryCnt < 6 THEN
buy("B1");
Else
ExitShort("eB_청산");
}
if Idx >= 1 and
Start == true and
Scond == true and
((entrycnt == 0) or (entrycnt >= 1 and MarketPosition == 0 and MarketPosition(1) != -1) or (MarketPosition == 1)) and #동일방향 재진입금지#
(EntryCnt == 0 or MarketPosition == 1 or (EntryCnt > 0 and MarketPosition == 0 and Condition2 == False )) Then{
IF dayPL <= PriceScale*30 and EntryCnt < 6 Then
sell("S1");
Else
ExitLong("eS_청산");
}
##################################
##### 중심선 돌파 청산 #####
##################################
if MarketPosition == 1 and 66==-1 and t100==-1 /*var20<var10/*중심선*/ Then
exitlong("eB_중심선");
if MarketPosition == -1 and t66==1 and t100==1 /*var20>var10 /*중심선*/ Then
ExitShort("eS_중심선");
2020-11-13
548
글번호 143880
답변완료
문의 드립니다.
분봉에서 현재 월봉의 시가값을
알고 싶은데요.
어떻게 수식을 작성해야
분봉해서 정확한 월봉 시가값을
알수 있을까요?
차트는 브이아이 금융투자의 연결_Euro-FX 입니다.
2020-11-13
491
글번호 143879
로꼬로꼬 님에 의해서 삭제되었습니다.
2020-11-13
4
글번호 143878
답변완료
문의 드립니다
아래 시스템식을 시스템신호대신 삼각표시 지표로 부탁드립니다
감사합니다
var : cnt(0),Bcnt(0),Scnt(0);
Bcnt = 0;
Scnt = 0;
for cnt = 0 to 20{
if sdate == EntryDate(cnt) and MarketPosition(cnt) == 1 then
Bcnt = Bcnt+1;
if sdate == EntryDate(cnt) and MarketPosition(cnt) == -1 then
Scnt = Scnt+1;
}
if MarketPosition <= 0 and Bcnt < 1 Then
buy("b",atlimit,daylow-1);
if MarketPosition >= 0 and Scnt < 1 Then
sell("s",atlimit,DayHigh+1);
2020-11-13
566
글번호 143877