커뮤니티

예스랭귀지 Q&A

글쓰기
답변완료

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

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

수식 부탁드립니다.

예전에 문의로 작성해주신겁니다. 월물 만기주의 월화수목 그리고 만기전주의 금요일 5개 날짜를 표시해주는겁니다. 여기서 문제가 2/9일 9:00 에는 순간적으로 조건이 풀리는 상황이 있습니다. (condiw=1 로 표기되지 않는 현상) 매월 만기일이 그렇습니다. 방법 있을지 궁금합니다. 감사합니다. ------------------------------------------------------------------------ var : entry(0,Data1); var : month(0),nday(0),week(0),TL(0); var : condiw(0); month = int(date/100)-int(date/10000)*100; nday = date - int(date/100)*100; Week = DayOfWeek(date); if sDate != sDate[1] Then { condiw = 0; } if nday >= 8 and nday <= 14 and week == 4 and sTime >= 90000 and sTime[1] < 90100 Then condiw=1; else if nday >= 7 and nday <= 13 and week == 3 Then condiw=1; else if nday >= 6 and nday <= 12 and week == 2 Then condiw=1; else if nday >= 5 and nday <= 11 and week == 1 Then condiw=1; #else if nday >= 4 and nday <= 10 and week == 5 Then condiw=1; else if nday >= 2 and nday <= 8 and week == 5 Then condiw=1; Else condiw ==0; Plot1(condiw);
프로필 이미지
캣피쉬
2023-02-09
896
글번호 166155
지표
답변완료

부탁드립니다^^

선물 당일 중심선수식 부탁드립니다 꾸벅~
프로필 이미지
불새1
2023-02-09
1059
글번호 166136
지표
답변완료

문의드립니다.

아래수식을 보아도 코딩 지식이 없어서 어떻게 매수 매도 되는 원리인지 해석을 할 수가 없네요. 식들이 어떤 의미로 매수가 되고 청산되며 다시 매도되고 청산되는 지를 알고 싶습니다. 그리고 제가 원하는 수식은 특정 날자와 시간과 특정 가격을 input 으로 하고요. 어떤 특정 가격 A 를 input 으로 임의로 정해주고 특정 날자와 시간 이후에 기다리고 있다가 아래나 위에 있던 현재가 상승 또는 하락하여 A 가격에 도달하면 비로서 매수 매도가 활성화 되어서 그 가격 A + PriceScale*5 을 현재가가 한번 위로 터치하면 매수하고 계속 위로 올라가면 놓아두고 다시 아래로 떨어져서 A - PriceScale*5 를 터치하면 매수청산과 더불어서 히방으로 1계약 매도합니다. 이런 식으로 계속 반복합니다. 현재가가 A + PriceScale*5 위로 도달시 매수 1게약 현재가가 A - PriceScale*5 아래로 도달시 매도 1게약 을 반복하는 것입니다. 아래 수식처럼 비슷하게 하면 ATSTOP 함수를 써서 가능할 것 같은데요. 아래 수식에서 ExitLong("bx",AtMarket); 이 왜 수식으로 게속 와야 하는 지 등를 모르겠어요. 제가 원하는 수식도 마저 부탁드립니다. 늘 수고하심에 감사드립니다. if NextBarSdate != sDate Then { if NextBarOpen != C Then { Buy("b",AtStop,NextBarOpen+PriceScale*5); } } ExitLong("bx",AtMarket); if NextBarOpen != C Then { Buy("b1",AtStop,NextBarOpen+PriceScale*5); } ExitLong("bx1",AtMarket); if NextBarOpen != C Then { Buy("b2",AtStop,NextBarOpen+PriceScale*5); } ExitLong("bx2",AtMarket); if NextBarOpen != C Then { Buy("b3",AtStop,NextBarOpen+PriceScale*5); } ExitLong("bx3",AtMarket); if NextBarOpen != C Then { Buy("b4",AtStop,NextBarOpen+PriceScale*5); } ExitLong("bx4",AtMarket); if NextBarOpen != C Then { Buy("b5",AtStop,NextBarOpen+PriceScale*5); } ExitLong("bx5",AtMarket); if NextBarOpen == C Then { Buy("b6",AtStop,NextBarOpen+PriceScale*5); } ExitLong("bx6",AtMarket); if NextBarOpen == C Then { Buy("b7",AtStop,NextBarOpen+PriceScale*5); } ExitLong("bx7",AtMarket); if NextBarOpen == C Then { Buy("b8",AtStop,NextBarOpen+PriceScale*5); } ExitLong("bx8",AtMarket); if NextBarOpen == C Then { Buy("b9",AtStop,NextBarOpen+PriceScale*5); } ExitLong("bx9",AtMarket); if NextBarOpen == C Then { Buy("b10",AtStop,NextBarOpen+PriceScale*5); } ExitLong("bx10",AtMarket); if NextBarOpen == C Then { Buy("b11",AtStop,NextBarOpen+PriceScale*5); } ExitLong("bx11",AtMarket); if NextBarSdate != sDate Then { if NextBarOpen != C Then { Sell("s",AtStop,NextBarOpen-PriceScale*5); } } ExitShort("sx",AtMarket); if NextBarOpen != C Then { Sell("s1",AtStop,NextBarOpen-PriceScale*5); } ExitShort("sx1",AtMarket); if NextBarOpen != C Then { Sell("s2",AtStop,NextBarOpen-PriceScale*5); } ExitShort("sx2",AtMarket); if NextBarOpen != C Then { Sell("s3",AtStop,NextBarOpen-PriceScale*5); } ExitShort("sx3",AtMarket); if NextBarOpen != C Then { Sell("s4",AtStop,NextBarOpen-PriceScale*5); } ExitShort("sx4",AtMarket); if NextBarOpen != C Then { Sell("s5",AtStop,NextBarOpen-PriceScale*5); } ExitShort("sx5",AtMarket); if NextBarOpen == C Then { Sell("s6",AtStop,NextBarOpen-PriceScale*5); } ExitShort("sx6",AtMarket); if NextBarOpen == C Then { Sell("s7",AtStop,NextBarOpen-PriceScale*5); } ExitShort("sx7",AtMarket); if NextBarOpen == C Then { Sell("s8",AtStop,NextBarOpen-PriceScale*5); } ExitShort("sx8",AtMarket); if NextBarOpen == C Then { Sell("s9",AtStop,NextBarOpen-PriceScale*5); } ExitShort("sx9",AtMarket); if NextBarOpen == C Then { Sell("s10",AtStop,NextBarOpen-PriceScale*5); } ExitShort("sx10",AtMarket); if NextBarOpen == C Then { Sell("s11",AtStop,NextBarOpen-PriceScale*5); } ExitShort("sx11",AtMarket); if NextBarSdate != sDate Then { if NextBarOpen != C Then { Buy("b12",AtStop,NextBarOpen+PriceScale*5); } } ExitLong("bx12",AtMarket); if NextBarOpen != C Then { Buy("b13",AtStop,NextBarOpen+PriceScale*5); } ExitLong("bx13",AtMarket); if NextBarOpen != C Then { Buy("b14",AtStop,NextBarOpen+PriceScale*5); } ExitLong("bx14",AtMarket); if NextBarOpen != C Then { Buy("b15",AtStop,NextBarOpen+PriceScale*5); } ExitLong("bx15",AtMarket); if NextBarOpen != C Then { Buy("b16",AtStop,NextBarOpen+PriceScale*5); } ExitLong("bx16",AtMarket); if NextBarOpen != C Then { Buy("b17",AtStop,NextBarOpen+PriceScale*5); } ExitLong("bx17",AtMarket); if NextBarOpen == C Then { Buy("b18",AtStop,NextBarOpen+PriceScale*5); } ExitLong("bx18",AtMarket); if NextBarOpen == C Then { Buy("b19",AtStop,NextBarOpen+PriceScale*5); } ExitLong("bx19",AtMarket); if NextBarOpen == C Then { Buy("b20",AtStop,NextBarOpen+PriceScale*5); } ExitLong("bx20",AtMarket); if NextBarOpen == C Then { Buy("b21",AtStop,NextBarOpen+PriceScale*5); } ExitLong("bx21",AtMarket); if NextBarOpen == C Then { Buy("b22",AtStop,NextBarOpen+PriceScale*5); } ExitLong("bx22",AtMarket); if NextBarOpen == C Then { Buy("b23",AtStop,NextBarOpen+PriceScale*5); } ExitLong("bx23",AtMarket); if NextBarSdate != sDate Then { if NextBarOpen != C Then { Sell("s12",AtStop,NextBarOpen-PriceScale*5); } } ExitShort("sx12",AtMarket); if NextBarOpen != C Then { Sell("s13",AtStop,NextBarOpen-PriceScale*5); } ExitShort("sx13",AtMarket); if NextBarOpen != C Then { Sell("s14",AtStop,NextBarOpen-PriceScale*5); } ExitShort("sx14",AtMarket); if NextBarOpen != C Then { Sell("s15",AtStop,NextBarOpen-PriceScale*5); } ExitShort("sx15",AtMarket); if NextBarOpen != C Then { Sell("s16",AtStop,NextBarOpen-PriceScale*5); } ExitShort("sx16",AtMarket); if NextBarOpen != C Then { Sell("s17",AtStop,NextBarOpen-PriceScale*5); } ExitShort("sx17",AtMarket); if NextBarOpen == C Then { Sell("s18",AtStop,NextBarOpen-PriceScale*5); } ExitShort("sx18",AtMarket); if NextBarOpen == C Then { Sell("s19",AtStop,NextBarOpen-PriceScale*5); } ExitShort("sx19",AtMarket); if NextBarOpen == C Then { Sell("s20",AtStop,NextBarOpen-PriceScale*5); } ExitShort("sx20",AtMarket); if NextBarOpen == C Then { Sell("s21",AtStop,NextBarOpen-PriceScale*5); } ExitShort("sx21",AtMarket); if NextBarOpen == C Then { Sell("s22",AtStop,NextBarOpen-PriceScale*5); } ExitShort("sx22",AtMarket); if NextBarOpen == C Then { Sell("s23",AtStop,NextBarOpen-PriceScale*5); } ExitShort("sx23",AtMarket); if NextBarSdate != sDate Then { if NextBarOpen != C Then { Buy("b24",AtStop,NextBarOpen+PriceScale*5); } } ExitLong("bx24",AtMarket); if NextBarOpen != C Then { Buy("b25",AtStop,NextBarOpen+PriceScale*5); } ExitLong("bx25",AtMarket); if NextBarOpen != C Then { Buy("b26",AtStop,NextBarOpen+PriceScale*5); } ExitLong("bx26",AtMarket); if NextBarOpen != C Then { Buy("b27",AtStop,NextBarOpen+PriceScale*5); } ExitLong("bx27",AtMarket); if NextBarOpen != C Then { Buy("b28",AtStop,NextBarOpen+PriceScale*5); } ExitLong("bx28",AtMarket); if NextBarOpen != C Then { Buy("b29",AtStop,NextBarOpen+PriceScale*5); } ExitLong("bx29",AtMarket); if NextBarOpen == C Then { Buy("b30",AtStop,NextBarOpen+PriceScale*5); } ExitLong("bx30",AtMarket); if NextBarOpen == C Then { Buy("b31",AtStop,NextBarOpen+PriceScale*5); } ExitLong("bx31",AtMarket); if NextBarOpen == C Then { Buy("b32",AtStop,NextBarOpen+PriceScale*5); } ExitLong("bx32",AtMarket); if NextBarOpen == C Then { Buy("b33",AtStop,NextBarOpen+PriceScale*5); } ExitLong("bx33",AtMarket); if NextBarOpen == C Then { Buy("b34",AtStop,NextBarOpen+PriceScale*5); } ExitLong("bx34",AtMarket); if NextBarOpen == C Then { Buy("b35",AtStop,NextBarOpen+PriceScale*5); } ExitLong("bx35",AtMarket); if NextBarSdate != sDate Then { if NextBarOpen != C Then { Sell("s24",AtStop,NextBarOpen-PriceScale*5); } } ExitShort("sx24",AtMarket); if NextBarOpen != C Then { Sell("s25",AtStop,NextBarOpen-PriceScale*5); } ExitShort("sx25",AtMarket); if NextBarOpen != C Then { Sell("s26",AtStop,NextBarOpen-PriceScale*5); } ExitShort("sx26",AtMarket); if NextBarOpen != C Then { Sell("s27",AtStop,NextBarOpen-PriceScale*5); } ExitShort("sx27",AtMarket); if NextBarOpen != C Then { Sell("s28",AtStop,NextBarOpen-PriceScale*5); } ExitShort("sx28",AtMarket); if NextBarOpen != C Then { Sell("s29",AtStop,NextBarOpen-PriceScale*5); } ExitShort("sx29",AtMarket); if NextBarOpen == C Then { Sell("s30",AtStop,NextBarOpen-PriceScale*5); } ExitShort("sx30",AtMarket); if NextBarOpen == C Then { Sell("s31",AtStop,NextBarOpen-PriceScale*5); } ExitShort("sx31",AtMarket); if NextBarOpen == C Then { Sell("s32",AtStop,NextBarOpen-PriceScale*5); } ExitShort("sx32",AtMarket); if NextBarOpen == C Then { Sell("s33",AtStop,NextBarOpen-PriceScale*5); } ExitShort("sx33",AtMarket); if NextBarOpen == C Then { Sell("s34",AtStop,NextBarOpen-PriceScale*5); } ExitShort("sx34",AtMarket); if NextBarOpen == C Then { Sell("s35",AtStop,NextBarOpen-PriceScale*5); } ExitShort("sx35",AtMarket);
프로필 이미지
종호
2023-02-09
978
글번호 166135
시스템
답변완료

봉개수 세기

감사합니다. 툴바에 보면 "봉개수 세기"가 있습니다. 이것과 비슷하게 당일만 (현재봉 1봉전부터 당일 첫봉까지) 봉번호 숫자를 자동으로 표시하고 싶습니다. 예) 1분봉이고 현재 09시 04분이라면 09시 첫봉에 3, 09시1분에 2, 09시3분에 3이렇게 자동으로 표시
프로필 이미지
jdavid
2023-02-09
1008
글번호 166134
지표
답변완료

분봉상 최고종가 돌파

당일 최고종가를 돌파하면서 20이평평돌파가 동시에 되는것을찾고싶어요
프로필 이미지
아무다
2023-02-09
789
글번호 166131
종목검색
답변완료

수식 문의 드립니다.

안녕하세요. 아래 수식에서 익절 틱수를 시간에 따라 변경하고 싶은데 어떻게 하면 되나요? 08시~15시 익절 160틱 15시~익일 05시 익절 400틱 05시~07시 익절 160틱 이렇게 변경하고 싶습니다. 부탁 드립니다. input : StartTime(080000),EndTime(070000); input : 익절포인트수(400),손절포인트수(80); input : 타주기분(60),P(5),Period(5); var : S1(0),D1(0),TM(0),TF(0),cnt(0),entry(0),bbup(0),bbdn(0); var : sum1(0),mav1(0),sum2(0),mav2(0),sum3(0),mav3(0),avgv(0),avgv1(0),Tcond(False); Array : CC[100](0); avgv = ma(c,Period); avgv1 =ma(c,20); bbup = BollBandUp(20,2); bbdn = BollBandDown(20,2); 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); } } if Bdate != Bdate[1] Then { S1 = TimeToMinutes(stime); D1 = sdate; entry = 0; } if D1 > 0 then { if (MarketPosition != 0 and MarketPosition != MarketPosition[1]) or (MarketPosition == MarketPosition[1] and TotalTrades > TotalTrades[1]) Then entry = entry+1; if sdate == D1 Then TM = TimeToMinutes(stime)-S1; Else TM = TimeToMinutes(stime)+1440-S1; TF = TM%타주기분; if Bdate != Bdate[1] or (Bdate == Bdate[1] and 타주기분 > 1 and TF < TF[1]) or (Bdate == Bdate[1] and 타주기분 > 1 and TM >= TM[1]+타주기분) or (Bdate == Bdate[1] and 타주기분 == 1 and TM > TM[1]) Then { for cnt = 1 to 99 { CC[cnt] = CC[cnt-1][1]; } } CC[0] = C; if CC[P+2] > 0 then { sum1 = 0; sum2 = 0; sum3 = 0; for cnt = 0 to P-1 { sum1 = sum1 + CC[cnt]; sum2 = sum2 + CC[cnt+1]; sum3 = sum3 + CC[cnt+2]; } mav1 = sum1/P; mav2 = sum2/P; mav3 = sum3/P; if MarketPosition <= 0 and mav1>mav2+10 Then Buy("b",AtMarket); if MarketPosition >= 0 and mav1<mav2-10 Then Sell("s",AtMarket); } } SetStopProfittarget(PriceScale*익절포인트수,PointStop); SetStopLoss(PriceScale*손절포인트수,PointStop);
프로필 이미지
동백초보
2023-02-09
805
글번호 166130
시스템
답변완료

함수요청

안녕하세요? 국내선물 분봉으로 일중거래를 하고자 합니다. A조건에 2계약 매수 B조건에 1계약 매수청산 C조건에 1계약 매수청산 D조건에 2계약 매수청산 샘플 부탁드립니다.
프로필 이미지
흰둥이아빠
2023-02-09
931
글번호 166129
시스템
답변완료

수식 문의 드립니다.

안녕하세요 지표식 하나 부탁드립니다. 1.1분봉에서 30분 단위로 (최고값+최저값)/2 의 값을 30분동안 옆으로 선을 긋고 30분 뒤에는 또다른 선을 긋고, 30분 뒤에는 또다른 선을 긋고 하는 지표식 을 부탁 드립니다.(30분마다 1개의 선이 30분 동안에 그어 집니다) 2.1분봉에서 (최고가+최저가)/2 의 값으로 선을 그을수 있게 만들어 주시면은 감사하겠 습니다.(30분단위나 1시간 단위가 아닌 하루동안에 1개의 선이 그어집니다) 항상 감사드립니다.
프로필 이미지
뭐이런걸다
2023-02-09
1002
글번호 166128
지표
답변완료

부탁드립니다.

1.당일 옵션 3.30을 기준으로 위로 올라서면 첫번째는 진입하지 말고, 두번째 진입하라. 그 다음 최고가에서 청산하라, 또 아래로 내려서면 첫번째는 진입하지 말고, 두번째 진입하라, 그 다음 최저가에서 청산하라 고맙습니다.
프로필 이미지
서태공
2023-02-08
855
글번호 166127
시스템