커뮤니티

예스랭귀지 Q&A

글쓰기
답변완료

[공지] 예스랭귀지 AI 어시스턴트, '예스나 AI' 출시 및 무료 체험 안내

안녕하세요, 예스스탁 입니다.복잡한 수식 공부 없이 여러분의 아이디어를 말하면 시스템 트레이딩 언어 예스랭귀지로 작성해주는 서비스예스나 AI(YesNa AI)가 출시되었습니다.지금 예스나 AI를 직접 경험해 보실 수 있도록 20크레딧(질문권 20회)를 무료로 증정해 드리고 있습니다.바로 여러분의 아이디어를 코드로 변환해보세요.--------------------------------------------------🚀 YesNa AI 핵심 기능- 지표식/전략식/종목검색식 생성: 자연어로 요청하면 예스랭귀지 문법에 맞는 코드를 작성합니다.- 종목검색식 변환 지원: K증권의 종목 검색식을 예스랭귀지로 변환 지원합니다.- 컴파일 검증: 작성된 코드가 실행 가능한지 컴파일러를 통해 문법 검증을 거쳐 결과물을 제공합니다.상세한 서비스 개요 및 활용 방법은 [서비스 소개 페이지]에서 확인하실 수 있습니다.▶ 서비스 소개 페이지: 바로가기서비스 사용 유의사항 및 결제 환불정책은 [이용약관]을 참고 부탁드립니다.▶ 서비스 이용약관: 바로가기💬 이용 문의사용 중 문의사항은 [프로그램 사용법 Q&A] 게시판에서 [예스나 AI] 카테고리를 설정 후 문의해 주시면 상세히 안내해 드리겠습니다.--------------------------------------------------앞으로도 AI를 활용한 다양한 트레이딩 기능들을 지속적으로 선보일 예정입니다.많은 관심과 기대 부탁드립니다.
프로필 이미지
예스스탁
2026-02-27
1711
글번호 230811
지표
답변완료

수식어 부탁 드립니다

input : StartTime(080000),EndTime(055000),xtime(055500); var : 전환선(0),기준선(0),선행스팬1(0),선행스팬2(0); var : Tcond(false); if sDate != sDate[1] then SetStopEndofday(xtime); 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); } INPUT : LENGTH(60); VAR : upv(0), dnv(0); upv = HIGHEST(HIGH, LENGTH); dnv = LOWEST(LOW, LENGTH); if MarketPosition <= 0 and L > dnv Then Buy("b",AtLimit,dnv); if MarketPosition >= 0 and H < upv Then sell("s",AtLimit,upv); ---------------------------------- input : StartTime(140000),EndTime(055000),xtime(055500); var : 전환선(0),기준선(0),선행스팬1(0),선행스팬2(0); var : Tcond(false),S1(0),D1(0),TM(0); if sDate != sDate[1] then SetStopEndofday(xtime); if Bdate != Bdate[1] Then { S1 = TimeToMinutes(stime); D1 = sdate; } 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); } if D1 > 0 then { if sdate == D1 Then TM = TimeToMinutes(stime)-S1; Else TM = TimeToMinutes(stime)+1440-S1; } 전환선 = (highest(H,9)+lowest(L,9))/2; 기준선 = (highest(H,26)+lowest(L,26))/2; 선행스팬1 = (전환선[25]+기준선[25])/2; 선행스팬2 = (highest(H,52)[25]+lowest(L,52)[25])/2; var1 = Disparity(60); Var2 = ma(C,300); if Tcond == true Then { if 전환선 > 기준선 and crossup(전환선,선행스팬1) and var1 >= 99 Then buy("b"); if MarketPosition == 1 then { if 전환선 < 기준선 and CrossDown(전환선,선행스팬2) and var1 >= 99 Then exitlong("bx1"); if TM <= TM[BarsSinceEntry]+30 and CountIf(CrossUp(c,Var2),BarsSinceEntry) >= 1 Then ExitLong("bx2",AtStop,EntryPrice); if CrossDown(c,Var2) Then ExitLong("bx3"); } if 전환선 < 기준선 and CrossDown(전환선,선행스팬1) and var1 <= 100 Then sell("s"); if MarketPosition == -1 then { if 전환선 > 기준선 and CrossUp(전환선,선행스팬2) and var1 <= 100 Then ExitShort("sx1"); if TM <= TM[BarsSinceEntry]+30 and CountIf(CrossDown(c,Var2),BarsSinceEntry) >= 1 Then ExitShort("sx2",AtStop,EntryPrice); if CrossUp(c,Var2) Then ExitShort("sx3"); } } =========================================== 위 2종류의 수식어를 결합하여 시스템을 부탁드립니다. 첫번째 수식어의 매매시간은 08시부터 오후 15시까지이며 청산시간은 15시 10분으로 수정해주시고 두번째 수식어의 매매시간은 15시50분 부터 익일 05시 50분까지이며 청산시간은 05시 55분으로 수정 부탁드립니다. 미리 감사 합니다.
프로필 이미지
푸른
2021-04-01
881
글번호 147612
시스템
답변완료

수식 문의

var1 = ma(C,5); var2 = ma(C,20); 기준으로 피라미딩 모든진입허용 / 진입횟수 10으로 하여 순차적으로 전봉 진입보다 현봉진입이 높을때(매도), 낮을때(매수) 진입 전량 청산하고 반대방향으로 순차적으로 진입하는 수식이 가능한지요? 가능하다면 부탁드립니다.
프로필 이미지
유로만
2021-04-01
933
글번호 147609
시스템
답변완료

부탁드립니다.

도움에 감사 드립니다. 수식1)은 Low와 high값이 10개 수식2)은 Low와 high값이 20개 수식3)은 Low와 high값이 30개를 이용한 값을 구하고 있지만 Low와 high값을 10~300개(외부변수n을 이용하여)를 이용한 값을 구하고 싶습니다. "for cnt = 1 to n"문과 같은 예와같이 간단히 줄여 작성이 가능하지요? 수식1) var:a(0),b(0); a=100*(10-(( IFf(l ==lowest(l,11),0, IFf(l[1]==lowest(l,11),1, IFf(l[2]==lowest(l,11),2, IFf(l[3]==lowest(l,11),3, IFf(l[4]==lowest(l,11),4, IFf(l[5]==lowest(l,11),5, IFf(l[6]==lowest(l,11),6, IFf(l[7]==lowest(l,11),7, IFf(l[8]==lowest(l,11),8, IFf(l[9]==lowest(l,11),9,10)))))))))))))/10; b=100*(10-(( IFf(h ==highest(h,11),0, IFf(h[1]==highest(h,11),1, IFf(h[2]==highest(h,11),2, IFf(h[3]==highest(h,11),3, IFf(h[4]==highest(h,11),4, IFf(h[5]==highest(h,11),5, IFf(h[6]==highest(h,11),6, IFf(h[7]==highest(h,11),7, IFf(h[8]==highest(h,11),8, IFf(h[9]==highest(h,11),9,10)))))))))))))/10; var1=b-a Plot1(var1); 수식2) var:a(0),b(0); a=100*(20-(( IFf(l ==lowest(l,21),0, IFf(l[1]==lowest(l,21),1, IFf(l[2]==lowest(l,21),2, IFf(l[3]==lowest(l,21),3, IFf(l[4]==lowest(l,21),4, IFf(l[5]==lowest(l,21),5, IFf(l[6]==lowest(l,21),6, IFf(l[7]==lowest(l,21),7, IFf(l[8]==lowest(l,21),8, IFf(l[9]==lowest(l,21),9, IFf(l[10]==lowest(l,21),10, IFf(l[11]==lowest(l,21),11, IFf(l[12]==lowest(l,21),12, IFf(l[13]==lowest(l,21),13, IFf(l[14]==lowest(l,21),14, IFf(l[15]==lowest(l,21),15, IFf(l[16]==lowest(l,21),16, IFf(l[17]==lowest(l,21),17, IFf(l[18]==lowest(l,21),18, IFf(l[19]==lowest(l,21),19,20))))) ))))) ))))) ))))) )))/20; b=100*(20-(( IFf(h ==highest(h,21),0, IFf(h[1]==highest(h,21),1, IFf(h[2]==highest(h,21),2, IFf(h[3]==highest(h,21),3, IFf(h[4]==highest(h,21),4, IFf(h[5]==highest(h,21),5, IFf(h[6]==highest(h,21),6, IFf(h[7]==highest(h,21),7, IFf(h[8]==highest(h,21),8, IFf(h[9]==highest(h,21),9, IFf(h[10]==highest(h,21),10, IFf(h[11]==highest(h,21),11, IFf(h[12]==highest(h,21),12, IFf(h[13]==highest(h,21),13, IFf(h[14]==highest(h,21),14, IFf(h[15]==highest(h,21),15, IFf(h[16]==highest(h,21),16, IFf(h[17]==highest(h,21),17, IFf(h[18]==highest(h,21),18, IFf(h[19]==highest(h,21),19,20))))) ))))) ))))) ))))) )))/20; var1=b-a Plot1(var1); 수식3) var:a(0),b(0); a=100*(30-(( IFf(l ==lowest(l,31),0, IFf(l[1]==lowest(l,31),1, IFf(l[2]==lowest(l,31),2, IFf(l[3]==lowest(l,31),3, IFf(l[4]==lowest(l,31),4, IFf(l[5]==lowest(l,31),5, IFf(l[6]==lowest(l,31),6, IFf(l[7]==lowest(l,31),7, IFf(l[8]==lowest(l,31),8, IFf(l[9]==lowest(l,31),9, IFf(l[10]==lowest(l,31),10, IFf(l[11]==lowest(l,31),11, IFf(l[12]==lowest(l,31),12, IFf(l[13]==lowest(l,31),13, IFf(l[14]==lowest(l,31),14, IFf(l[15]==lowest(l,31),15, IFf(l[16]==lowest(l,31),16, IFf(l[17]==lowest(l,31),17, IFf(l[18]==lowest(l,31),18, IFf(l[19]==lowest(l,31),19, IFf(l[20]==lowest(l,31),20, IFf(l[21]==lowest(l,31),21, IFf(l[22]==lowest(l,31),22, IFf(l[23]==lowest(l,31),23, IFf(l[24]==lowest(l,31),24, IFf(l[25]==lowest(l,31),25, IFf(l[26]==lowest(l,31),26, IFf(l[27]==lowest(l,31),27, IFf(l[28]==lowest(l,31),28, IFf(l[29]==lowest(l,31),29, 30))))) )))) )))))) ))))) ))))) ))))) )))/30; b=100*(30-(( IFf(h ==highest(h,31),0, IFf(h[1]==highest(h,31),1, IFf(h[2]==highest(h,31),2, IFf(h[3]==highest(h,31),3, IFf(h[4]==highest(h,31),4, IFf(h[5]==highest(h,31),5, IFf(h[6]==highest(h,31),6, IFf(h[7]==highest(h,31),7, IFf(h[8]==highest(h,31),8, IFf(h[9]==highest(h,31),9, IFf(h[10]==highest(h,31),10, IFf(h[11]==highest(h,31),11, IFf(h[12]==highest(h,31),12, IFf(h[13]==highest(h,31),13, IFf(h[14]==highest(h,31),14, IFf(h[15]==highest(h,31),15, IFf(h[16]==highest(h,31),16, IFf(h[17]==highest(h,31),17, IFf(h[18]==highest(h,31),18, IFf(h[19]==highest(h,31),19, IFf(h[20]==highest(h,31),20, IFf(h[21]==highest(h,31),21, IFf(h[22]==highest(h,31),22, IFf(h[23]==highest(h,31),23, IFf(h[24]==highest(h,31),24, IFf(h[25]==highest(h,31),25, IFf(h[26]==highest(h,31),26, IFf(h[27]==highest(h,31),27, IFf(h[28]==highest(h,31),28, IFf(h[29]==highest(h,31),29, 30))))) )))) )))))) ))))) ))))) ))))) )))/30; var1=b-a Plot1(var1);
프로필 이미지
yes
2021-04-01
940
글번호 147608
지표
답변완료

수식어 부탁드립니다

input : StartTime(080000),EndTime(055000),xtime(055500); var : 전환선(0),기준선(0),선행스팬1(0),선행스팬2(0); var : Tcond(false); if sDate != sDate[1] then SetStopEndofday(xtime); 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); } INPUT : LENGTH(60); VAR : upv(0), dnv(0); upv = HIGHEST(HIGH, LENGTH); dnv = LOWEST(LOW, LENGTH); if MarketPosition <= 0 and L > dnv Then Buy("b",AtLimit,dnv); if MarketPosition >= 0 and H < upv Then sell("s",AtLimit,upv); ---------------------------------- input : StartTime(160000),EndTime(055000),xtime(055500); var : 전환선(0),기준선(0),선행스팬1(0),선행스팬2(0); var : Tcond(false); if sDate != sDate[1] then SetStopEndofday(xtime); 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); } 전환선 = (highest(H,9)+lowest(L,9))/2; 기준선 = (highest(H,26)+lowest(L,26))/2; 선행스팬1 = (전환선[25]+기준선[25])/2; 선행스팬2 = (highest(H,52)[25]+lowest(L,52)[25])/2; var1 = Disparity(60); if Tcond == true Then { if 전환선 > 기준선 and crossup(전환선,선행스팬1) and var1 >= 99 Then buy("b"); if MarketPosition == 1 then { if 전환선 < 기준선 and CrossDown(전환선,선행스팬2) and var1 >= 99 Then exitlong(); } if 전환선 < 기준선 and CrossDown(전환선,선행스팬1) and var1 <= 100 Then sell("s"); if MarketPosition == -1 then { if 전환선 > 기준선 and CrossUp(전환선,선행스팬2) and var1 <= 100 Then ExitShort(); } } =========================================== 위 2종류의 수식어를 결합하여 시스템을 부탁드립니다. 첫번째 수식어의 매매시간은 08시부터 오후 15시까지이며 청산시간은 15시 10분으로 수정해주시고 두번째 수식어의 매매시간은 15시50분 부터 익일 05시 50분까지이며 청산시간은 05시 55분으로 수정 부탁드립니다. 미리 감사 합니다.
프로필 이미지
푸른
2021-04-01
837
글번호 147606
시스템
답변완료

문의 드립니다.

1. 음봉진행 하다가 양봉 발생 시 매수 진입 / 음봉 발생 시 매도 청산완료 2. 양봉진행 하다가 음봉 발생 시 매도 진입 / 양봉 발생 시 매수 청산완료 상승추세에서 1번을 적용하고 2번은 하락추세에서 적용하려고 하오니 각각 분리해서 따로 부탁드립니다. 감사합니다.
프로필 이미지
선물대장
2021-04-01
926
글번호 147601
시스템
답변완료

수식 수정 요청부탁드립니다.

안녕하세요. 저번에 작성해주신 수식 참고가 많이 되었습니다. 고맙습니다. 추가로 수정 좀 부탁드립니다. < 수정 요청 사항 > 아래에 답변해주신 수식에서 1. 손실발생시 진입수량을 최대 8개까지만으로 해주시면 고맙겠습니다. (1-2-4-8) 2. 익절 포인트를 0.0011, 손절 포인트는 0.001로 해주시면 고맙겠습니다. ======================================================= 안녕하세요 예스스탁입니다. 1 익절시 동시에 동일방향 진입이 가능하지 않습니다. 시스템은 청산과 동일시점에 같은 방향의 진입신호가 발생하면 다시 해당 진입도 청산됩니다.일절이 발생하면 다음봉 시가에 진입하게 작성해 드립니다. 2 해외선물의 경우 시초가 진입이 어렵습니다. 첫진입은 첫봉의 종가에 진입하게 작성해 드립니다. 3 if sDate != sDate[1] Then SetStopEndofday(53000); if Bdate != Bdate[1] Then { SetStopEndofday(0); Buy("b1",AtMarket,DEF,1); } Else { if MarketPosition == 0 and IsExitName("StopProfittarget",1) == true Then { if MarketPosition(1) == 1 Then Buy("b",AtMarket); if MarketPosition(1) == -1 Then Sell("s",AtMarket); } } if MarketPosition == 1 Then { Sell("bs",AtStop,EntryPrice-0.001,CurrentContracts*2); } if MarketPosition == -1 Then { Buy("sb",AtStop,EntryPrice+0.001,CurrentContracts*2); } SetStopProfittarget(0.001,PointStop); 즐거운 하루되세요 > 바다가좋아 님이 쓴 글입니다. > 제목 : 수식 문의드립니다. > 안녕하세요. 수식 좀 만들어주시면 고맙겠습니다. 1. 적용환경 : 해외선물 (Australian Dollar 기준) 2. 매매 조건 1) 장 시초가 1계약 매수 2) 매수됨과 동시에 익절(0.001 pt), 손절(0.001 pt) 설정 3. 수익발생시 1) 익절시에는 매수청산 후 1계약 매수진입 반복 4. 손해 발생시 1) 1차 손절시에는 매수청산 후 2계약 매도진입 2) 2차 손절시에는 매도청산 후 4계약 매수진입 3) 3차 손절시에는 매수청산 후 8계약 매도진입 5. 손해 발생후 익절이 되면 다시 그 방향으로 1계약 매수 or 매도 진입 위 사항을 반복하는 시스템을 만들어주시면 고맙겠습니다. 그럼 수고하세요.
프로필 이미지
바다가좋아
2021-04-01
945
글번호 147600
시스템
답변완료

시스템 수식 부탁드립니다

불철주야 수고 많으십니다. 틱 챠트 사용하고 있습니다. 3분봉 시가가 기준선과 같거나 위에 있을때 5일선이 아래에서 위로 통과할때 매수. 3분봉 시가가 기준선과 같거나 아래에 있을때 5일선이 위에서 아래로 통과할 때 매도. 이상입니다.
프로필 이미지
라몬
2021-04-01
994
글번호 147598
시스템
답변완료

일봉,분봉관련없이 "n개봉"에서의 최대거래량 고가와 저가 지표

수고가 많으십니다. 항상 감사합니다. 일봉,분봉관련없이 "n개봉"에서의 최대거래량 고가와 저가 지표를 plot으로 나타내고 싶습니다. 감사합니다.
프로필 이미지
챠트미소
2021-04-01
1209
글번호 147597
지표
답변완료

수식어 부탁드립니다

input : StartTime(160000),EndTime(055000),xtime(055500); var : 전환선(0),기준선(0),선행스팬1(0),선행스팬2(0); var : Tcond(false); if sDate != sDate[1] then SetStopEndofday(xtime); 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); } 전환선 = (highest(H,9)+lowest(L,9))/2; 기준선 = (highest(H,26)+lowest(L,26))/2; 선행스팬1 = (전환선[25]+기준선[25])/2; 선행스팬2 = (highest(H,52)[25]+lowest(L,52)[25])/2; var1 = Disparity(60); if Tcond == true Then { if 전환선 > 기준선 and crossup(전환선,선행스팬1) and var1 >= 99 Then buy("b"); if MarketPosition == 1 then { if 전환선 < 기준선 and CrossDown(전환선,선행스팬2) and var1 >= 99 Then exitlong(); } if 전환선 < 기준선 and CrossDown(전환선,선행스팬1) and var1 <= 100 Then sell("s"); if MarketPosition == -1 then { if 전환선 > 기준선 and CrossUp(전환선,선행스팬2) and var1 <= 100 Then ExitShort(); } } ----------------------------- 수식어 추가입니다 buy 1.진입신호후 이동평균선 276선 crossup시 30분내 진입가격 되돌림시 자동청산 2.진입신호후 이동평균선 276선 crossdown시 자동청산 sell 1.진입신호후 이동평균선 276선 crossdown시 30분내 진입가격 되돌림시 자동청산 2.진입신호후 이동평균선 276선 crossdown시 자동청산
프로필 이미지
푸른
2021-04-01
976
글번호 147587
시스템