커뮤니티

예스랭귀지 Q&A

글쓰기
답변완료

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

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

질문드립니다.

1. 현재 고가(value99)가 형성된 전일값이 그 다음날에도 이어지네요. 사진과 같이 당일초기화되어 O자로 표시되는 당일 첫파동에만 표시되게 하고싶습니다. 2. 위 수정된 식이 data2의 고가값을 data1상에 출력할 수 있게 설정하고 싶습니다. 3. 아래 atr청산식입니다. data2에서 고가와 -atr값으로 산정해 exitlong신호를 내고싶습니다. if MarketPosition() == 1 then { exitlong("CHDR Exit",Atstop,highest(H,barssinceentry)-ATR(ATRperiod)*ATRS); } // 1과 2의 식입니다. 감사합니다. Input:barCnt(10); Var:j(0),turnPntBit(""),TL1(0),TL2(0); Array:valArr[10](0),barArr[10](0),turnPntArr[10](""); var : count1(0),count2(0), idx(0); if bdate != bdate[1] Then { Condition99 = false; count1 = 0; count2 = 0; Value1 = 0; Value2 = 0; } For j = 0 To 9 { barArr[j] = barArr[j] + 1; } Condition1 = Highest(H,barCnt)[barCnt+1] <= H[barCnt] and H[barCnt] > Highest(H,barCnt); Condition2 = Lowest(L,barCnt)[barCnt+1] >= L[barCnt] and L[barCnt] < Lowest(L,barCnt); turnPntBit = ""; If Condition1 and Condition2 Then { If Max(valArr[1],valArr[2]) < H[barCnt] and Min(valArr[1],valArr[2]) > L[barCnt] Then turnPntBit = "HiLo"; Else If Max(valArr[1],valArr[2]) < H[barCnt] Then turnPntBit = "Hi"; Else If Min(valArr[1],valArr[2]) > L[barCnt] Then turnPntBit = "Lo"; Else If turnPntArr[1] == "Hi" Then turnPntBit = "Lo"; Else If turnPntArr[1] == "Lo" Then turnPntBit = "Hi"; } Else If Condition1 Then turnPntBit = "Hi"; Else If Condition2 Then turnPntBit = "Lo"; If turnPntBit <> "" Then { If turnPntBit == "HiLo" Then { valArr[1] = IFF(turnPntArr[1] == "Hi",H[barCnt],L[barCnt]); barArr[1] = barCnt; TL_SetEnd(TL1,sDate[barArr[1]],sTime[barArr[1]],valArr[1]); If turnPntArr[1] == "Hi" Then turnPntBit = "Lo"; Else turnPntBit = "Hi"; } If turnPntBit <> turnPntArr[1] Then { for j = 8 downto 1 { valArr[j+1] = valArr[j]; barArr[j+1] = barArr[j]; turnPntArr[j+1] = turnPntArr[j]; } } If turnPntBit <> turnPntArr[1] or (turnPntBit == turnPntArr[1] and ((turnPntBit == "Hi" and valArr[1] < H[barCnt]) or (turnPntBit == "Lo" and valArr[1] > L[barCnt]))) Then { valArr[1] = IFF(turnPntBit == "Hi",H[barCnt],L[barCnt]); barArr[1] = barCnt; turnPntArr[1] = turnPntBit; If bdate != bdate[1] Then{ value99 = 0; } If turnPntArr[1][1] <> turnPntArr[1][0] Then { if Condition99 == false and turnPntBit == "Hi" Then { Condition99 = true; value99 = valArr[1]; } } Else { TL_SetEnd(TL1,sDate[barArr[1]],sTime[barArr[1]],valArr[1]); } } } /////////////////////////고가 형성 계산종료//////////////////////////// Plot1(value99,"고가");
프로필 이미지
stockric
2019-01-11
275
글번호 125137
지표
답변완료

지표

틱봉에서 60분봉의 싯가선을 우측 수평으로 긋고 다음60분봉이 나타나면 이전봉의 선은 그만 그려지고 다음 봉에서 싯가선이 그어지고 현재가선하고 부탁드립니다..
프로필 이미지
야크
2019-01-10
221
글번호 125135
지표
답변완료

수식 부탁드립니다

아래는 이평선을 수평으로 표시한건데요 제가 하고 싶은게 이 선을 일정한 %로 수직 이동하고 싶습니다. 수식으로 표현이 안된다면 지표속성창에서 할수있게 부탁드립니다. 색상이나 굵기도 속성창에서 변경할수 있도록 부탁드립니다. Inputs: period(20); var : TL(0); Var1 = ma(c,period); TL_delete(TL); TL = TL_New(sdate[1],stime[1],var1,sdate,stime,var1); TL_SetExtLeft(TL,true); TL_SetExtRight(TL,true);
프로필 이미지
스캘퍼
2019-01-10
240
글번호 125134
지표
답변완료

문의드립니다.

실시간으로 현재 봉에서 50개 전의 봉에 계속 표시가 나타나게 하고 싶습니다.. 봉이 하나하나 진행되면 따라서 표시도 다음봉으로 옮겨가면서 계속 현재봉에서 50개 전의 봉에 표시가 되게 하고 싶습니다. 감사합니다^^
프로필 이미지
고스트
2019-01-10
200
글번호 125122
강조
답변완료

수식 변경부탁드립니다.

아래 서식으로 시스템매매 했을시 매수,매도 합산 수익금액이나 손실금액이 목표치에 도달했을 때 거래를 멈추게 되어있는데 매도 진입 후 수익금액이나 손실금액이 만족되었을 시에는 종료 타이틀이 정상적으로 금일종료(수익), 금일종료1(손실)로 나오는데 매수진입 후 수익금액이나 손실금액이 만족되었을 시에는 매수청산1로 나오는데 이것도 매도시와 마찬가지로 금일종료2(수익)나 금일종료3(손실)로 명칭이 나오게끔 수식 변경 부탁드립니다. 당일수익 = PriceScale*당일수익틱수; 당일손실 = PriceScale*당일목표손실; if (sdate != sdate[1] and stime >= b_time1) or (sdate == sdate[1] and stime >= b_time1 and stime[1] < b_time1) Then { Tcond = true; Xcond = false; N1 = NetProfit; } daypl = NetProfit-N1; if TotalTrades > TotalTrades[1] Then { if (IsExitName("금일종료",1) == true or IsExitName("금일종료1",1) == true or IsExitName("금일종료",1) == true or IsExitName("금일종료1",1) == true) then Xcond = true; if daypl >= 당일수익 or daypl <= -당일손실 Then Xcond = true; } value1 = ma(C, shortPeriod); value2 = ma(C, longPeriod); If b_time1<=sTime and sTime<= e_time1 Then { stoK = StochasticsK(stoK_p11,stoK_p12); stoD = StochasticsD(stoK_p11,stoK_p12,stoK_p13); If countif(ma(C,ma_Period11)[1] < ma(C,ma_Period11),1) == 1 and (ma(C,ma_Period12)[1] <= ma(C,ma_Period13)[1] and ma(C,ma_Period12) > ma(C,ma_Period13)) and countif(ma(C,ma_Period14)[1] < ma(C,ma_Period14),1) == 1 and countif(ma(C,ma_Period15)[1] < ma(C,ma_Period15),1) == 1 and countif(ma(C,ma_Period16)[1] < ma(C,ma_Period16),1) == 1 and countif(ma(C,ma_Period17)[1] < ma(C,ma_Period17),1) == 1 Then { T1 = 1; } If countif(ma(C,ma_Period11)[1] > ma(C,ma_Period11),1) == 1 and (ma(C,ma_Period12)[1] >= ma(C,ma_Period13)[1] and ma(C,ma_Period12) < ma(C,ma_Period13)) and countif(ma(C,ma_Period14)[1] > ma(C,ma_Period14),1) == 1 and countif(ma(C,ma_Period15)[1] > ma(C,ma_Period15),1) == 1 and countif(ma(C,ma_Period16)[1] > ma(C,ma_Period16),1) == 1 and countif(ma(C,ma_Period17)[1] > ma(C,ma_Period17),1) == 1 Then { T1 = -1; } If countif(ma(C,ma_Period21)[1] < ma(C,ma_Period21),1) == 1 and (ma(C,ma_Period22)[1] <= ma(C,ma_Period23)[1] and ma(C,ma_Period22) > ma(C,ma_Period23)) and countif(ma(C,ma_Period24)[1] < ma(C,ma_Period24),1) == 1 and countif(ma(C,ma_Period25)[1] < ma(C,ma_Period25),1) == 1 and countif(ma(C,ma_Period26)[1] < ma(C,ma_Period26),1) == 1 and countif(ma(C,ma_Period27)[1] < ma(C,ma_Period27),1) == 1 Then { T2 = 2; } If countif(ma(C,ma_Period21)[1] > ma(C,ma_Period21),1) == 1 and (ma(C,ma_Period22)[1] >= ma(C,ma_Period23)[1] and ma(C,ma_Period22) < ma(C,ma_Period23)) and countif(ma(C,ma_Period24)[1] > ma(C,ma_Period24),1) == 1 and countif(ma(C,ma_Period25)[1] > ma(C,ma_Period25),1) == 1 and countif(ma(C,ma_Period26)[1] > ma(C,ma_Period26),1) == 1 and countif(ma(C,ma_Period27)[1] > ma(C,ma_Period27),1) == 1 Then { T2 = -2; } } if Xcond == false and MarketPosition == 0 and T1 == -1 and T2 == -2 and Crossup(stok,상단) and MarketPosition >= 0 then sell("매도",AtMarket); if MarketPosition == -1 Then { ExitShort("금일종료",atlimit,EntryPrice-((당일수익-daypl)/CurrentContracts)); ExitShort("금일종료1",AtStop,EntryPrice+((당일손실+daypl)/CurrentContracts)); if T1==1 and T2==2 then ExitShort("매도청산",AtMarket); if Crossdown(stok,하단) and C <= EntryPrice Then ExitShort("매도청산1",AtMarket); } if Xcond == false and MarketPosition == 0 and T1 == 1 and T2 == 2 and Crossdown(stok,하단) and MarketPosition <= 0 then buy("매수",AtMarket); if MarketPosition == 1 Then { ExitShort("금일종료2",atlimit,EntryPrice-((당일수익-daypl)/CurrentContracts)); ExitShort("금일종료3",AtStop,EntryPrice+((당일손실+daypl)/CurrentContracts)); if T1==-1 and T2==-2 then Exitlong("매수청산",AtMarket); if Crossup(stok,상단) and C >= EntryPrice Then Exitlong("매수청산1",AtMarket); } SetStopProfittarget(PriceScale*익절틱수,PointStop);
프로필 이미지
미완
2019-01-10
225
글번호 125108
시스템
답변완료

수식되로 매매가 진행되지 않네요.. 뭐가 문제인지 확인부탁드림니다.

제가 지금 사용하고 있는 수식은 다음과 같습니다. 매수진입후 84틱 수익시 바로 청산을 하는 수식인데 위 그림과 같이 84틱이 넘었는데 봉종가에 청산되는 현상이 발생하였고... 검증 돌려보니 84틱 수익도달시 청산되는 case가 하나도 없네요..결국 제가 의도한대로 되지 않았다는 뜻인데요.... 아래 수식에서 뭐가 문제가 있는지 알려주시고 혹시 잘못되었으면 제가 의도한대로 수식좀 수정 부탁드려요... 제 의도 매수진입시 (1) 60틱이상 수익시 봉완성후 청산 (2) 90틱이상 손실시 봉완성후 청산 (3) 84틱 수익도달시 즉시 청산 (4) 40틱이상 수익도달후 1틱수익까지 떨어졌을때 즉시 청산(본전청산) (5) 200틱 이상 손실시 즉시 청산 매도진입시 (1) 90틱이상 수익시 봉완성후 청산 (2) 80틱이상 손실시 봉완성후 청산 (3) 110틱 수익도달시 즉시 청산 (4) 30틱이상 수익도달후 1틱수익까지 떨어졌을때 즉시 청산(본전청산) (5) 190틱 이상 손실시 즉시 청산 공통) 당일 5시 40분에 매수 매도 모두 청산 ============================================================================== if MarketPosition == 1 then SetStopProfittarget(PriceScale*60, PointStop); SetStopLoss(PriceScale*90, PointStop); if MarketPosition == -1 then SetStopProfittarget(PriceScale*90, PointStop); SetStopLoss(PriceScale*80, PointStop); if MarketPosition == 1 Then { if highest(H,BarsSinceEntry) >= EntryPrice+PriceScale*84 Then ExitLong("최고점즉시청산1",AtLimit,EntryPrice+PriceScale*84); Else { if highest(H,BarsSinceEntry) >= EntryPrice+PriceScale*40 Then ExitLong("약손실청산1",AtStop,EntryPrice+PriceScale*1); Else ExitLong("가슴아픈손절1",AtStop,EntryPrice-PriceScale*200); } } if MarketPosition == -1 Then { If Lowest(L,BarsSinceEntry) <= EntryPrice-PriceScale*110 Then ExitShort("최고점즉시청산2",AtStop,EntryPrice-PriceScale*110); Else { if Lowest(L,BarsSinceEntry) <= EntryPrice-PriceScale*30 Then ExitShort("약손실청산2",AtStop,EntryPrice-PriceScale*1); Else ExitShort("가슴찢어지는손절",AtStop,EntryPrice+PriceScale*190); } } } if stime == 54000 Then{ exitlong("당일청산1"); ExitShort("당일청산2"); } ==============================================================================
프로필 이미지
이형지
2019-01-10
245
글번호 125097
시스템
답변완료

예스랭귀지 질문요

저는 프로그래머이구요. 이번에 시스템트레이딩 개발 하려고 합니다. 질문요. 예스랭귀지 질문요. 하이투자증권것을 사용함. 1. 국내 선물매매도 매매 가능한가요? 2. 9시에 장 시작후, 실시간으로 변수 var1에 var1 = 최고가 - 현재가 이렇게 값을 가져올수 있나요? 이렇게 하면 되나요? var1 = High- CurrentContracts; var1이라는 변수에 고점 빼기 현재가격의 값이 들어가나요?
프로필 이미지
나도아프다
2019-01-10
222
글번호 125096
시스템
답변완료

문의드립니다~

240일선과 960일선의 골든크로스가 나오고나서 "롱매수"라는 진입신호가 한번만 나오도록 240일선과 960일선의 데드크로스 이후에 "숏매도"라는 진입신호가 한번만 나오도록 그리고 하루에 숏매수,숏매도라는 신호가 한번씩만 나오도록 감사합니다~
프로필 이미지
겐지
2019-01-09
197
글번호 125095
시스템
답변완료

수식 이관하려고 하는데 가능할까요?

키움에서 yes global로 옮겨가려고 하는데요~ 키움에서 사용하던 수식이 약 10개정도가 있는데 혹시 이관 가능할까요??
프로필 이미지
아웃오브초조
2019-01-09
216
글번호 125094
지표