커뮤니티

예스랭귀지 Q&A

글쓰기
답변완료

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

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

수식 점검부탁드립니다.

#,63405 답변수식에서 1, 6월20일 이전으로 날짜를 지정하면 선이 나타나는데, 시작날짜를 6월20일 이후로 지정하면 선이 나타나지 않습니다,왜일까요? 제가 원하는수식은 시작날짜 지정해서 지정한 영영일,또는 지정한날짜 다음날에 초기화 되 는 수식입니다, 다시한번 확인 부탁드립니다. 2, 1개월주기를 if bdate > bdate[1]+30 then 으로 작성한다면 2개월주기,3개월주기는 어찌 작성하나요? 도움부탁드립니다.
프로필 이미지
회원
2019-07-23
152
글번호 130580
지표
답변완료

부탁드립니다.

답변 감사드립니다. 제의 설명이 부족 했던거 같습니다. 다시한번만 봐주시길 부탁드립니다. 1)수정요청 var2 = -1, -2, -3, -4..... var2 = -1,-2 까지는 매수 계약수 1개씩 var2 = -3 이하 일때는 매수 계약수 2개씩 진입을 말씀드린 내용입니다. Var2가 -2이상 (var2= -1,-2) 이면 매수 계약수 1개. Var2가 -3이하 (var2= -3,-4,-5..)이면 매수 계약수 2개 매수 2) 추가 보조차트를 이용하여 보조차트의 100이동평균선이 상승할때 만 var2 값이 1씩 증가 보조차르의 100이동평균선이 하락할때만 var2 값이 -1씩 하락 보조지표의 100 이동평균선이 변곡하면 var2값도 1부터 다시 시작 input : n(10),u(3); var : tx(0),ll(0),hh(0); if (sdate != sdate[1] and stime >= 73000) or (sdate == sdate[1] and stime >= 73000 and stime[1] < 73000) Then { var1 = c; var2 = 0; } else { if H >= var1+PriceScale*10 and var1 > 0 Then { var1 = var1 + PriceScale*10; if var2[1] >= 0 Then var2 = var2+1; Else var2 = 1; tx = Text_New(sdate,stime,H,NumToStr(var2,0)); Text_SetColor(tx,RED); // if MarketPosition >= 0 or MaxContracts < n Then // sell("s",OnClose,def,1); } if L <= var1-PriceScale*10 and var1 > 0 Then { var1 = var1 - PriceScale*10; if var1 <= 0 Then var2 = var2-1; Else var2 = -1; tx = Text_New(sdate,stime,L,NumToStr(var2,0)); Text_SetColor(tx,BLUE); if MarketPosition <= 0 or MaxContracts < n Then Buy("b",OnClose,def,1); } } if MarketPosition == 1 then { if CurrentContracts > CurrentContracts[1] Then { hh = h; ll = l; } if h > hh Then hh = h; if l < ll Then ll = l; // ExitLong("bp1",AtStop,AvgEntryPrice+(PriceScale*100)/CurrentContracts); if hh >= AvgEntryPrice+(PriceScale*100)/CurrentContracts Then ExitLong("bp2",AtStop,hh-(hh-AvgEntryPrice)*0.2); if CurrentContracts >= 5 and C >= LL+PriceScale*20 and C < AvgEntryPrice and (C-AvgEntryPrice) <= -(CurrentContracts*U)*PriceScale Then ExitLong("bl1"); } 즐거운 하루되세요
프로필 이미지
라떼처럼
2019-07-24
143
글번호 130578
시스템
답변완료

시스템 질문입니다

당일 바닥에서 처음 나타나는 연속 2양봉 매수해서 8번째 양봉에서 청산하는 수식과 청산 후 신규 매도하는 수식을 각각 알고싶습니다.8번째는 밖으로 빼서 자유롭게 숫자를 수정하는 수식도 부탁드립니다
프로필 이미지
회원
2019-07-23
144
글번호 130572
시스템
답변완료

수식 문의 드립니다

1. 매매횟수를 조절하려고 합니다. 하루에 10번으로 제한하려고 하는데 장시작하고 10번 매매가 이루어지면 다청산하고 멈추고 다음날 다시 시작이요 2. 익절이 7틱이거나 손절 7틱 나면 매매횟수랑 상관없이 멈추는 기능도 추가하려면 어떻게 할까요 누적수익 말고요 3. 23시에 조건에따라 무조건 진입하고 만약에 23시에서 23시30분사이에 매매가 일어나면 그사이에 일어난 매매횟수만큼 10회 제한에서 추가하고 싶습니다.매매가 안일어나면 그대로 10회제한으로 가는거고요
프로필 이미지
toal
2019-07-23
146
글번호 130567
시스템
답변완료

수식적용해 보니 이상합니다~

아래 만들어주신 식을 적용해보니 일정구간에서는 봉마다 매수매도가 계속 반복됩니다;;ㅋ --------------------------------------------- 거래는 60분봉에서 하려고 합니다. 매수금액 과 이평선 설정을 변수로 조정할수 있었음 합니다. **매수) 1차매수 주가가 위에서 부터 떨어져서 분봉상 400일선 5% 까지 근접하는순간 물량의 30% 매수 2차매수 주가가 위에서 부터 떨어져서 분봉상 400일선을 데드크로스 하는 순간 물량의 30% 매수 3차매수 주가가 위에서 부터 떨어져서 분봉상 400일선에서 -5% 까지 떨어지는 순간 물량의 40% 매수 ----------------------------------------------- 개별 주식 매매고 60분봉상의 이평400 일선을 기준으모 3분할 매수를 하는 식을 만들고 싶습니다~ 30분봉상의 이평400 일로 적용할수도 있구요~ 어떤 분봉이든 그 분봉의 400이평을 기준으로 하고 싶고 그 400이평이란 건 변수로 이평을 바꿀수도 있었음 합니다~ 아래 식이 맞는건지요?ㅎ 안녕하세요 예스스탁입니다. input : 금액(100000000); var : idx(0); var1 = ma(C,400); if MarketPosition == 0 and L > var1*1.05 Then buy("b1",atlimit,var1*1.05,Floor((금액*0.3)/min(NextBarOpen,var1*1.05))); if MarketPosition == 1 then { if bdate != bdate[1] Then { idx = idx+1; } if MaxEntries == 1 and L > var1 Then buy("b2",atlimit,var1,Floor((금액*0.3)/min(NextBarOpen,var1))); if MaxEntries == 2 and L > var1*0.95 Then buy("b3",atlimit,var1*0.95,Floor((금액*0.4)/min(NextBarOpen,var1*0.95))); if CurrentContracts < CurrentContracts[1] and LatestExitName(0) == "bp1" Then Condition1 = true; if CurrentContracts < CurrentContracts[1] and LatestExitName(0) == "bp2" Then Condition2 = true; if CurrentContracts < CurrentContracts[1] and LatestExitName(0) == "bp3" Then Condition3 = true; if CurrentContracts < CurrentContracts[1] and LatestExitName(0) == "bp11" Then Condition11 = true; if CurrentContracts < CurrentContracts[1] and LatestExitName(0) == "bp12" Then Condition12 = true; if CurrentContracts < CurrentContracts[1] and LatestExitName(0) == "bp21" Then Condition21 = true; if CurrentContracts < CurrentContracts[1] and LatestExitName(0) == "bp22" Then Condition22 = true; if CurrentContracts < CurrentContracts[1] and LatestExitName(0) == "bp31" Then Condition31 = true; if CurrentContracts < CurrentContracts[1] and LatestExitName(0) == "bp32" Then Condition32 = true; if CurrentContracts < CurrentContracts[1] and LatestExitName(0) == "bl1" Then Condition4 = true; if CurrentContracts < CurrentContracts[1] and LatestExitName(0) == "bl2" Then Condition5 = true; if Condition1 == false Then ExitLong("bp1",atlimit,AvgEntryPrice*1.03,"",Floor(CurrentContracts*0.3),1); if Condition2 == false Then ExitLong("bp2",atlimit,AvgEntryPrice*1.06,"",Floor(CurrentContracts*0.5),1); if Condition3 == false Then ExitLong("bp3",atlimit,AvgEntryPrice*1.09); if Condition1 == true then { if Condition11 == false Then ExitLong("bp11",AtStop,EntryPrice*1.015,"",Floor(CurrentContracts*0.5),1); if Condition12 == false Then ExitLong("bp12",AtStop,EntryPrice*1.01); } if Condition2 == true then { if Condition21 == false Then ExitLong("bp21",AtStop,EntryPrice*1.035,"",Floor(CurrentContracts*0.5),1); if Condition22 == false Then ExitLong("bp22",AtStop,EntryPrice*1.03); } if Condition3 == true then { if Condition31 == false Then ExitLong("bp31",AtStop,EntryPrice*1.08,"",Floor(CurrentContracts*0.5),1); if Condition32 == false Then ExitLong("bp32",AtStop,EntryPrice*1.7); } if stime >= 93000 and stime[1] < 93000 then { if idx == 1 Then ExitLong("bx1",OnClose,def,"",Floor(CurrentContracts*0.2),1); if idx == 2 Then ExitLong("bx2",OnClose,def,"",Floor(CurrentContracts*0.2),1); if idx == 3 Then ExitLong("bx3",OnClose,def,"",Floor(CurrentContracts*0.2),1); if idx == 4 Then ExitLong("bx4"); } if Condition4 == false Then ExitLong("bl1",AtStop,AvgEntryPrice*0.85,"",Floor(CurrentContracts*0.5),1); if Condition5 == false Then ExitLong("bl2",AtStop,AvgEntryPrice*1.80); } Else { idx = 0; Condition1 = false; Condition2 = false; Condition3 = false; Condition11 = false; Condition12 = false; Condition21 = false; Condition22 = false; Condition31 = false; Condition31 = false; Condition4 = false; Condition5 = false; } 즐거운 하루되세요 > 부자청년28 님이 쓴 글입니다. > 제목 : 수식 여쭤봅니다~ㅎ > 안녕하세요? 수식 여쭤봅니다. 거래는 60분봉에서 하려고 합니다. 매수금액 과 이평선 설정을 변수로 조정할수 있었음 합니다. **매수) 1차매수 주가가 위에서 부터 떨어져서 분봉상 400일선 5% 까지 근접하는순간 물량의 30% 매수 2차매수 주가가 위에서 부터 떨어져서 분봉상 400일선을 데드크로스 하는 순간 물량의 30% 매수 3차매수 주가가 위에서 부터 떨어져서 분봉상 400일선에서 -5% 까지 떨어지는 순간 물량의 40% 매수 **매도) 1차 매수든 2차매수든 3차매수든 매수가 일어나고 3% 상승시 가진 물량의 30% 매도 6% 상승시 가진 물량의 50% 매도 10% 상승시 가진 물량 전부 매도 **이익보전) 1차 매수든 2차매수든 3차매수든 매수가 일어나고 3% 상승후 다시 1.5%로 떨어질시 가진물량의 50% 매도 3% 상승후 다시 1%로 떨어질시 전부 매도 6% 상승후 다시 3.5%로 떨어질시 가진 물량의 50% 매도 6% 상승후 다시 3%로 떨어질시 가진 물량 전부 매도 10% 상승후 다시 8%떨어질시 가진 물량의 50% 매도 10% 상승후 다시 7%떨어질시 가진 물량 전부 매도 **날짜 지남에 따라 매도) 매수후 +1일 09시30분에 가진 물량의 20% 매도 매수후 +2일 09시30분에 가진 물량의 20% 매도 매수후 +3일 09시30분에 가진 물량의 20% 매도 매수후 +4일 09시30분에 가진 물량 전부 매도 **손절) 현재 매수 평단가에서 -15% 하락시 가진 물량의 50% 매도 -20% 하락시 전부 매도 **어떤 식으로든 전체 물량이 매도된 날에 재매수 금지) 감사합니다~
프로필 이미지
부자청년28
2019-07-23
222
글번호 130561
시스템
답변완료

수식

1.차트상 우축가격대을50틱단위로4개의실선자동으로표시 2.차트상우축가격대을100틱단위로4개의실선자동으로표시 잘부탁 합니다
프로필 이미지
용각산
2019-07-23
179
글번호 130560
지표
답변완료

수식 의뢰합니다

macd 기준선 시스템으로 오전10시 15분부터 오후 5시 까지만 신호나오게 부탁드립니다
프로필 이미지
이공주7
2019-07-23
147
글번호 130553
시스템
답변완료

요청드립니다.

아래식에서 아래 사항에 대해 수정 요청드립니다. 1) 매수 매수가 -1, -2, -3.. 가 표시되면서 아래와 같이 매수 수량이 증가 되지 않습니다. n(15) 15개가 채워지기까지 지속적으로 매수가 발생되게 수정부탁드립니다. 2) 청산 Var2가 -2이상 (var2= -1,-2) 이면 매수 1개. Var2가 -3이하 (var2= -3,-4,-5..)이면 매수 2개 매수 input : n(10),u(3); var : tx(0),ll(0),hh(0); if (sdate != sdate[1] and stime >= 73000) or (sdate == sdate[1] and stime >= 73000 and stime[1] < 73000) Then { var1 = c; var2 = 0; } else { if H >= var1+PriceScale*10 Then { var1 = var1 + PriceScale*10; if var2[1] >= 0 Then var2 = var2+1; Else var2 = 1; tx = Text_New(sdate,stime,H,NumToStr(var2,0)); Text_SetColor(tx,RED); // if MarketPosition >= 0 or MaxContracts < n Then // sell("s",OnClose,def,1); } if L <= var1-PriceScale*10 Then { var1 = var1 - PriceScale*10; if var1 <= 0 Then var2 = var2-1; Else var2 = -1; tx = Text_New(sdate,stime,L,NumToStr(var2,0)); Text_SetColor(tx,BLUE); if MarketPosition <= 0 or MaxContracts < n Then Buy("b",OnClose,def,1); } } if MarketPosition == 1 then { if CurrentContracts > CurrentContracts[1] Then { hh = h; ll = l; } if h > hh Then hh = h; if l < ll Then ll = l; // ExitLong("bp1",AtStop,AvgEntryPrice+(PriceScale*100)/CurrentContracts); if hh >= AvgEntryPrice+(PriceScale*100)/CurrentContracts Then ExitLong("bp2",AtStop,hh-(hh-AvgEntryPrice)*0.2); if CurrentContracts >= 5 and C >= LL+PriceScale*20 and C < AvgEntryPrice and (C-AvgEntryPrice) <= -(CurrentContracts*U)*PriceScale Then ExitLong("bl1");
프로필 이미지
라떼처럼
2019-07-23
143
글번호 130545
시스템
답변완료

기준라인

답변대로 수식 방배열은 20개로 했고 시뮬레이션 최소값을 0.05부터 했으나 똑같은 문제가 발생합니다. 시뮬레이션에서 0과 3사이의 결과가 2개만 나오는데 중간에 0.5와 1.00과 1.5를 실제 대입하면 -2.84, 12.06, 10.18이 나옵니다.(수수료 0.0032, 슬리피지 진입,청산 2틱씩) 시뮬레이션에서 보이는 값과 하나하나 대입한 결과값이 다른 경우는 처음입니다. ************************************************************************************ 안녕하세요 예스스탁입니다. 1 Array : EP[10](0); 배열이 총 10개 방입니다. (0번방~9번방) 10개 이상 지정하시면 해당 배열의 방갯수도 늘려주셔야 합니다. 2 상승은 0보다 큰값을 지정하셔야 합니다. 상승 0은 해당 수식에서 의미가 없는 습니다. 0.05씩 상승하면 최소값을 0.05로 지정하시기 바랍니다. 즐거운 하루되세요 ********************************************************************************* input : 기준(265),상승(1.00); input : 손절1(50),익절1(300),TR1(150); input : 손절2(50),익절2(300),TR2(150); input : 손절3(50),익절3(300),TR3(150); input : 손절4(50),익절4(300),TR4(150); input : 손절5(50),익절5(300),TR5(150); input : 손절6(50),익절6(300),TR6(150); input : 손절7(50),익절7(300),TR7(150); input : 손절8(50),익절8(300),TR8(150); input : 손절9(50),익절9(300),TR9(150); input : 손절10(50),익절10(300),TR10(150); input : 손절11(50),익절11(300),TR11(150); input : 손절12(50),익절12(300),TR12(150); Array : EP[20](0); if MarketPosition == 0 and H < 기준+상승 and ExitDate(1) != sdate Then buy("b1",AtStop,기준+상승); if MarketPosition == 1 Then { var1 = (기준+상승) + 상승*MaxEntries; EP[MaxEntries] = LatestEntryPrice(0); if MaxEntries == 1 and H < var1 Then buy("b2",AtStop,var1); if MaxEntries == 2 and H < var1 Then buy("b3",AtStop,var1); if MaxEntries == 3 and H < var1 Then buy("b4",AtStop,var1); if MaxEntries == 4 and H < var1 Then buy("b5",AtStop,var1); if MaxEntries == 5 and H < var1 Then buy("b6",AtStop,var1); if MaxEntries == 6 and H < var1 Then buy("b7",AtStop,var1); if MaxEntries == 7 and H < var1 Then buy("b8",AtStop,var1); if MaxEntries == 8 and H < var1 Then buy("b9",AtStop,var1); if MaxEntries == 9 and H < var1 Then buy("b10",AtStop,var1); if MaxEntries == 10 and H < var1 Then buy("b11",AtStop,var1); if MaxEntries == 11 and H < var1 Then buy("b12",AtStop,var1); if MaxEntries >= 1 and EP[1] > 0 Then { ExitLong("bl1",AtStop,EP[1]-PriceScale*손절1,"b1"); ExitLong("bp1",Atlimit,EP[1]+PriceScale*익절1,"b1"); ExitLong("btr1",AtStop,highest(h,BarsSinceEntry)-PriceScale*TR1,"b1"); } if MaxEntries >= 2 and EP[2] > 0 Then { ExitLong("bl2",AtStop,EP[2]-PriceScale*손절2,"b2"); ExitLong("bp2",Atlimit,EP[2]+PriceScale*익절2,"b2"); ExitLong("btr2",AtStop,highest(h,BarsSinceEntry)-PriceScale*TR2,"b2"); } if MaxEntries >= 3 and EP[3] > 0 Then { ExitLong("bl3",AtStop,EP[3]-PriceScale*손절3,"b3"); ExitLong("bp3",Atlimit,EP[3]+PriceScale*익절3,"b3"); ExitLong("btr3",AtStop,highest(h,BarsSinceEntry)-PriceScale*TR3,"b3"); } if MaxEntries >= 4 and EP[4] > 0 Then { ExitLong("bl4",AtStop,EP[4]-PriceScale*손절4,"b4"); ExitLong("bp4",Atlimit,EP[4]+PriceScale*익절4,"b4"); ExitLong("btr4",AtStop,highest(h,BarsSinceEntry)-PriceScale*TR4,"b4"); } if MaxEntries >= 5 and EP[5] > 0 Then { ExitLong("bl5",AtStop,EP[5]-PriceScale*손절5,"b5"); ExitLong("bp5",Atlimit,EP[5]+PriceScale*익절5,"b5"); ExitLong("btr5",AtStop,highest(h,BarsSinceEntry)-PriceScale*TR5,"b5"); } if MaxEntries >= 6 and EP[6] > 0 Then { ExitLong("bl6",AtStop,EP[6]-PriceScale*손절6,"b6"); ExitLong("bp6",Atlimit,EP[6]+PriceScale*익절6,"b6"); ExitLong("btr6",AtStop,highest(h,BarsSinceEntry)-PriceScale*TR6,"b6"); } if MaxEntries >= 7 and EP[7] > 0 Then { ExitLong("bl7",AtStop,EP[7]-PriceScale*손절7,"b7"); ExitLong("bp7",Atlimit,EP[7]+PriceScale*익절7,"b7"); ExitLong("btr7",AtStop,highest(h,BarsSinceEntry)-PriceScale*TR7,"b7"); } if MaxEntries >= 8 and EP[8] > 0 Then { ExitLong("bl8",AtStop,EP[8]-PriceScale*손절8,"b8"); ExitLong("bp8",Atlimit,EP[8]+PriceScale*익절8,"b8"); ExitLong("btr8",AtStop,highest(h,BarsSinceEntry)-PriceScale*TR8,"b8"); } if MaxEntries >= 9 and EP[9] > 0 Then { ExitLong("bl9",AtStop,EP[9]-PriceScale*손절9,"b9"); ExitLong("bp9",Atlimit,EP[9]+PriceScale*익절9,"b9"); ExitLong("btr9",AtStop,highest(h,BarsSinceEntry)-PriceScale*TR9,"b9"); } if MaxEntries >= 10 and EP[10] > 0 Then { ExitLong("bl10",AtStop,EP[10]-PriceScale*손절10,"b10"); ExitLong("bp10",Atlimit,EP[10]+PriceScale*익절10,"b10"); ExitLong("btr10",AtStop,highest(h,BarsSinceEntry)-PriceScale*TR10,"b10"); } if MaxEntries >= 11 and EP[11] > 0 Then { ExitLong("bl11",AtStop,EP[11]-PriceScale*손절11,"b11"); ExitLong("bp11",Atlimit,EP[11]+PriceScale*익절11,"b11"); ExitLong("btr11",AtStop,highest(h,BarsSinceEntry)-PriceScale*TR11,"b11"); } if MaxEntries >= 12 and EP[12] > 0 Then { ExitLong("bl12",AtStop,EP[12]-PriceScale*손절12,"b12"); ExitLong("bp12",Atlimit,EP[12]+PriceScale*익절12,"b12"); ExitLong("btr12",AtStop,highest(h,BarsSinceEntry)-PriceScale*TR12,"b12"); } }
프로필 이미지
목마와숙녀
2020-01-20
171
글번호 130544
시스템