커뮤니티
예스랭귀지 Q&A
답변완료
[공지] 예스랭귀지 AI 어시스턴트, '예스나 AI' 출시 및 무료 체험 안내
안녕하세요, 예스스탁 입니다.복잡한 수식 공부 없이 여러분의 아이디어를 말하면 시스템 트레이딩 언어 예스랭귀지로 작성해주는 서비스예스나 AI(YesNa AI)가 출시되었습니다.지금 예스나 AI를 직접 경험해 보실 수 있도록 20크레딧(질문권 20회)를 무료로 증정해 드리고 있습니다.바로 여러분의 아이디어를 코드로 변환해보세요.--------------------------------------------------🚀 YesNa AI 핵심 기능- 지표식/전략식/종목검색식 생성: 자연어로 요청하면 예스랭귀지 문법에 맞는 코드를 작성합니다.- 종목검색식 변환 지원: K증권의 종목 검색식을 예스랭귀지로 변환 지원합니다.- 컴파일 검증: 작성된 코드가 실행 가능한지 컴파일러를 통해 문법 검증을 거쳐 결과물을 제공합니다.상세한 서비스 개요 및 활용 방법은 [서비스 소개 페이지]에서 확인하실 수 있습니다.▶ 서비스 소개 페이지: 바로가기서비스 사용 유의사항 및 결제 환불정책은 [이용약관]을 참고 부탁드립니다.▶ 서비스 이용약관: 바로가기💬 이용 문의사용 중 문의사항은 [프로그램 사용법 Q&A] 게시판에서 [예스나 AI] 카테고리를 설정 후 문의해 주시면 상세히 안내해 드리겠습니다.--------------------------------------------------앞으로도 AI를 활용한 다양한 트레이딩 기능들을 지속적으로 선보일 예정입니다.많은 관심과 기대 부탁드립니다.
2026-02-27
3155
글번호 230811
답변완료
문의 드립니다.~~~~
답변주신 내용으로 햬결이 되지 않아
추가 요청을 더해 다시 부탁드립니다~
<진입>
진입은 아래 수식에서 설정된 시간대별로 구분되어
매일 진입이 실행되도록 시간대 설정
(왜그런지 아래식에서는 23시에서 1시까지는 진입이 이루어지지 않습니다.)
<청산>
1, 설정된 각 시간대 내에서는 청산 조건이 충족되면 수식 그대로
청산 및 스위칭 재진입
2, 설정된 각 시간내에서 청산 조건이 충족 되지 않아
포지션을 가지고 각 시간대를 지날때에는
청산 조건이 충족되면 스위칭 재진입 없이
청산만 이루어지도록 부탁드립니다~~~
항상 감사합니다 건강하세요~``
input : 진입틱수(10);
input : 최소손실틱(0),손실감소틱(10);
input : StartTime1(70000),EndTime1(100000);
input : StartTime2(110000),EndTime2(130000);
input : StartTime3(150000),EndTime3(180000);
input : StartTime4(230000),EndTime4(010000);
var : Tcond(false);
var : OO(0),HH(0),LL(0);
if (sdate != sdate[1] and stime >= EndTime1) or
(sdate == sdate[1] and stime >= EndTime1 and stime[1] < EndTime1) Then
{
Tcond = False;
if MarketPosition == 1 Then
ExitLong();
if MarketPosition == -1 Then
ExitShort();
}
if (DayOfWeek(sDate) != 1 and sdate != sdate[1] and stime >= StartTime1) or
(sdate == sdate[1] and stime >= StartTime1 and stime[1] < StartTime1) Then
{
Tcond = true;
OO = O;
HH = H;
LL = L;
}
if (sdate != sdate[1] and stime >= EndTime2) or
(sdate == sdate[1] and stime >= EndTime2 and stime[1] < EndTime2) Then
{
Tcond = False;
if MarketPosition == 1 Then
ExitLong();
if MarketPosition == -1 Then
ExitShort();
}
if (DayOfWeek(sDate) != 1 and sdate != sdate[1] and stime >= StartTime2) or
(sdate == sdate[1] and stime >= StartTime2 and stime[1] < StartTime2) Then
{
Tcond = true;
OO = O;
HH = H;
LL = L;
}
if (sdate != sdate[1] and stime >= EndTime3) or
(sdate == sdate[1] and stime >= EndTime3 and stime[1] < EndTime3) Then
{
Tcond = False;
if MarketPosition == 1 Then
ExitLong();
if MarketPosition == -1 Then
ExitShort();
}
if (DayOfWeek(sDate) != 1 and sdate != sdate[1] and stime >= StartTime3) or
(sdate == sdate[1] and stime >= StartTime3 and stime[1] < StartTime3) Then
{
Tcond = true;
OO = O;
HH = H;
LL = L;
}
if (sdate != sdate[1] and stime >= EndTime4) or
(sdate == sdate[1] and stime >= EndTime4 and stime[1] < EndTime4) Then
{
Tcond = False;
if MarketPosition == 1 Then
ExitLong();
if MarketPosition == -1 Then
ExitShort();
}
if Tcond == true Then
{
if MarketPosition == 0 and OO > 0 and LL > OO-PriceScale*진입틱수 Then
Sell("하루시작매도",AtLimit,LL+PriceScale*진입틱수);
if MarketPosition == 0 and OO > 0 and HH < OO+PriceScale*진입틱수 Then
Buy("하루시작메수",AtLimit,HH-PriceScale*진입틱수);
}
if MarketPosition == 1 Then
{
Sell("Bp",AtLimit,EntryPrice+PriceScale*진입틱수);
if Lowest(L,BarsSinceEntry) <= EntryPrice-PriceScale*최소손실틱 Then
Sell("sx",AtLimit,Lowest(L,BarsSinceEntry)+PriceScale*손실감소틱);
}
if MarketPosition == -1 Then
{
Buy("sp",AtLimit,EntryPrice-PriceScale*진입틱수);
if highest(H,BarsSinceEntry) >= EntryPrice+PriceScale*최소손실틱 Then
Buy("bx",AtLimit,highest(H,BarsSinceEntry)-PriceScale*손실감소틱);
}
2021-11-04
718
글번호 153357
답변완료
​​​해외선물 타주기 시스템 변환
​​​항상 감사드립니다
​​​​​​​​​​​​아래 조건식을 타주기챠트에 적용할수있도록 변환하여주시기 바랍니다
*****************************************************
input:period90(20),횡보율(0.0006);
var : var301(0),var321(0);
var : t60(0),t70(0);
var301=ema(c,period90);
var321=ema(c,period90+20);
value1 = 0;
value2 = 0;
value3 = 0;
if var301>var301[1]*(1+횡보율/100) then value1 = value1+1;
else if var301<var301[1]*(1-횡보율/100) then value2 = value2+1;
else value3 = value3+1;
if var321>var321[1]*(1+횡보율/100) then value1 = value1+1;
else if var321<var321[1]*(1-횡보율/100) then value2 = value2+1;
else value3 = value3+1;
if Var301>Var321 Then
t60 = 1 ;
else if Var301<Var321 Then
t60 = -1;
if value1 == 2 Then
t70 = 1 ;
else if value2 == 2 Then
t70 = -1;
Else if value3 == 2 Then
t70 = 0;
/****************************************************/
var : entrycnt(0);
if stime == 170000 or (stime > 170000 and stime[1] < 170000) Then # 현지시간_뉴욕 17:00 장시작 #
Entrycnt = 0;
if MarketPosition != 0 and MarketPosition != MarketPosition[1] Then
Entrycnt = Entrycnt+1;
if ((entrycnt == 0) or (entrycnt >= 1 and MarketPosition == 0 and MarketPosition(1) != 1) or (MarketPosition == -1)) and #동일방향 재진입금지#
T60==1 then
buy("B1");
if ((entrycnt == 0) or (entrycnt >= 1 and MarketPosition == 0 and MarketPosition(1) != -1) or (MarketPosition == 1)) and #동일방향 재진입금지#
T60==-1 Then
sell("S1");
/***********************************************/
if MarketPosition == 1 and T70==-1 Then
exitlong("eB_B");
if MarketPosition == -1 and T70==1 Then
ExitShort("eS_S");
2021-11-03
899
글번호 153351
답변완료
문의드립니다.
1.codecategoryex의 미니코스피선물과 위클리콜옵션 풋옵션의 코드를 알고 싶습니다.
어디서 찾아봐야하는지 않나오네요.
2.var1의 소수점 2째자리까지의 크기를 비교하고싶습니다.
예로 if var1 > var1[1] then
var2 = 1;
var1의 소수점 2째자리까지의 크기보다 var[1] 소수점2째자리까지의 크기가 작을 경우
var2 = 1;
if int(var1*100) > int(var1[1]*100) then
var2 = 1;
이런식으로 작성했더니 지표출력 plot1 소수2째자리 값이 전봉값보다 커지지 않았는데 var2 = 1;로 출력이 되서요.
답변부탁드려요 수고하세요^^
2021-11-03
926
글번호 153346
답변완료
문의 드립니다
value1 = (c,Data2)/2;
D2의 현재가를 2로 나눈값.... 를 표시하고 싶은데 위와 같이 하니까 오류라고 뜨네요
수정 좀 부탁드립니다.. 감사합니다
2021-11-03
755
글번호 153340
답변완료
수식 부탁드립니다
input : StartTime(233000),EndTime(030000);
var : 전환선(0),기준선(0),선행스팬1(0),선행스팬2(0);
var : Tcond(false);
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;
SetStopEndofday(0);
}
var : entry(0);
if bdate != bdate[1] Then
entry = 0;
if (MarketPosition != 0 and MarketPosition != MarketPosition[1]) or
(MarketPosition == MarketPosition[1] and TotalTrades > TotalTrades[1]) Then
entry = entry+1;
if MarketPosition <= 0 and entry < 1 Then
buy("b",atlimit,dayhigh-PriceScale*20);
if MarketPosition == 1 Then
exitlong("bx",atlimit,lowest(L,BarsSinceEntry)+PriceScale*20);
if MarketPosition >= 0 and entry < 1 Then
sell("s",atlimit,daylow+PriceScale*30);
if MarketPosition == -1 Then
ExitShort("sx",atlimit,Highest(H,BarsSinceEntry)-PriceScale*30);
---------------------------
위 시스템의 매매신호는 당일 고저가대비 매수,매도의 청산 수식 입니다.
수정할것은 당일 고저가대비 매수,매도의 신호에서 청산은 그 진입신호에서
틱폭의 숫자만큼 청산이 되도록 부탁드립니다
늘 감사합니다
2021-11-04
799
글번호 153337
답변완료
신호표시
항상 도움 주심에 감사드립니다^^
아래 두조건을 모두 만족 할 때에만 신호가 발생되게 부탁드립니다.
그리고 2)번 조건식을 지표식으로 바꿀수 있는지와 지표식으로 바꿀때 기호로 표시되게하고 색상까지 넣을수 있다면 모두 부탁드립니다. 감사합니다^^
1)종가가 5일 20일선을 동시에 돌파시
var1 = ma(c,5);
Var2 = ma(C,20);
Condition1 = C > max(var1,Var2) and min(var1,Var2) > O;
Condition2 = O > max(var1,Var2) and min(var1,Var2) > C;
#b1
if Condition1 == true Then
Buy("★");
#s1
if Condition2 == true Then
Sell(" ★ ");
2)단기 추세선이 선행스팬1을 돌파시
var : 전환선(0),단기추세선(0),선행스팬1(0),선행스팬2(0);
전환선 = (highest(H,1)+lowest(L,1))/2;
단기추세선 = (highest(H,26)+lowest(L,26))/2;
선행스팬1 = (전환선+단기추세선)/2;
선행스팬2 = (highest(H,52)+lowest(L,52))/2;
#b2
if 선행스팬1 > 단기추세선 Then
Buy("▲");
#s2
if 선행스팬1 < 단기추세선 Then
sell("▼");
2021-11-03
925
글번호 153336
답변완료
문의
안녕하세요
선물호가잔량이 +으로출발시매수진입 -로바뀌면매도진입하는수식부탁합니다
추가로 +에서-로전환시잔량이-500개 -에서+으로전환시도+500개을넘었을때쓰위칭하는수식도부탁합니다 감사합니다
2021-11-03
610
글번호 153333
답변완료
문의드립니다
수고많으십니다~
1. 현재 캔들이 이전 30개 캔들의 최고가를 돌파하면 매수,
이전 30개 캔들의 최저가를 돌파하면 매도.
아래 수식을 데모해보면 꼭 그렇지만은 않은 거 같습니다.
확인 및 수정 부탁드립니다.
2. 그리고 n1(10), n2(30) 로 했을때, 현재 캔들의 이전 30개 캔들의 최고가와 10개 캔들의 최고가를 돌파할 때 매수, 현재 캔들의 이전 30개 캔들의 최저가와 10개 캔들의 최저가를 돌파할 때 매도.
이 수식도 추가해 주시면 좋겠습니다.
친절한 도움에 감사드립니다~~
input : n1(30);
input : StartTime(223000),EndTime(233000);
input : 익절틱수(80),손절틱수(0);
var : Tcond(false);
Array : H1[50](0),L1[50](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;
if Tcond == true Then
{
#봉완성 매수
if C > H[n1]+PriceScale*1 and C > O Then
Buy("b");
#봉완성 매도
if C < L[N1]-PriceScale*1 and C < O Then
Sell("s");
#즉시 매수
if NextBarOpen <= H[n1] Then
Buy("b1",AtStop,H[n1]+PriceScale*1);
#즉시 매도
if NextBarOpen >= L[n1] Then
Sell("s1",AtStop,L[n1]-PriceScale*1);
#매수진입 후 매수봉의 저가보다 1틱이상 낮은 시세 발생하면 청산
if MarketPosition == 1 Then
ExitLong("bx",AtStop,L[BarsSinceEntry]-PriceScale*1);
#매도진입 후 매도봉의 고가보다 1틱이상 높은 시세 발생하면 청산
if MarketPosition == -1 Then
ExitShort("sx",AtStop,H[BarsSinceEntry]+PriceScale*1);
}
SetStopProfittarget(PriceScale*익절틱수,PointStop);
SetStopLoss(PriceScale*손절틱수,PointStop);
2021-11-03
565
글번호 153332
답변완료
수식 부탁드립니다.
관리자님,
다음 수식을 data2 식으로 표기해 주시면 감사 하겠습니다.
input : P18(90),P28(100);
var18 = CCI(P18);
var28 = ema(var18,P28);
input : P19(9),P29(10);
var19 = CCI(P19);
var29 = ema(var19,P29);
input : P1(20),P2(5);
var11 = trix(P1);
var21 = ema(var11,p2);
input : period5(12), period15(5),period25(5);
var : 스토g(0), 스토q(0);
스토g = StochasticsK(period5,period15);
스토q = StochasticsD(period5,period15,period25);
Inputs: ShortPeriod(5),LongPeriod(20),매수기준선(100),매도기준선(-100);
Variables: Fval(0),FvalFast(0),FvalSlow(0);
Fval = ((Close - Close[1]) * Volume) ;
FvalFast = Ema(Fval, ShortPeriod);
FvalSlow = Ema(Fval, LongPeriod);
Input : Period9(20), D(2.0);
var : BBdown(0),BBUp(0),BandB(0);
BBDown = BollBandDown(Period9,D);
BBUp = BollBandUp(Period9,D);
BandB = ((C-BBDown)/(BBUp-BBDown))*100;
Input : shortP231(12), longP231(26), emaP31(8);
Var : MACDlong31(0),MACDlongSIG31(0);
MACDlong31 = MACD(shortP231, longP231);
MACDlongSIG31 = ema(MACD(shortP231, longP231), emaP31);
2021-11-03
746
글번호 153331