커뮤니티

예스랭귀지 Q&A

글쓰기
답변완료

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

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

문의 드립니다.

아래 식에서 MACD를 추가하고자 합니다. 매수 때 30분봉에서 MACD 12 26 9 선이 시그널선 위에 있을 때 아래 식을 적용하여 매수 매도 때 30분봉 에서 MACD 12 26 9 선이 시그널선 아래에 있을 때 아래 식을 적용하여 매도 부탁드립니다. input : ntime(30); var : S1(0),D1(0),TM(0),TF(0),OO(0); if Bdate != Bdate[1] Then { S1 = TimeToMinutes(stime); D1 = sdate; } if D1 > 0 then { if sdate == D1 Then TM = TimeToMinutes(stime)-S1; Else TM = TimeToMinutes(stime)+1440-S1; TF = TM%ntime; if Bdate != Bdate[1] or (Bdate == Bdate[1] and ntime > 1 and TF < TF[1]) or (Bdate == Bdate[1] and ntime > 1 and TM >= TM[1]+ntime) or (Bdate == Bdate[1] and ntime == 1 and TM > TM[1]) Then { OO = O; } if MarketPosition <= 0 and OO > 0 and C > OO and C > O and C[1] < O[1] Then Buy(); if MarketPosition == 1 and C < O Then ExitLong(); } ------------------------------------------------------------------------------- input : ntime(30); var : S1(0),D1(0),TM(0),TF(0),OO(0); if Bdate != Bdate[1] Then { S1 = TimeToMinutes(stime); D1 = sdate; } if D1 > 0 then { if sdate == D1 Then TM = TimeToMinutes(stime)-S1; Else TM = TimeToMinutes(stime)+1440-S1; TF = TM%ntime; if Bdate != Bdate[1] or (Bdate == Bdate[1] and ntime > 1 and TF < TF[1]) or (Bdate == Bdate[1] and ntime > 1 and TM >= TM[1]+ntime) or (Bdate == Bdate[1] and ntime == 1 and TM > TM[1]) Then { OO = O; } if MarketPosition >= 0 and OO > 0 and C < OO and C < O and C[1] > O[1] Then Sell(); if MarketPosition == -1 and C > O Then ExitShort(); }
프로필 이미지
선물대장
2024-02-15
819
글번호 176646
시스템
답변완료

옵션 차익 청산

성실한 답변 늘 감사드립니다. 콜 행사가 360 를 3.0을 1개 매수 콜 행사가 362.5를 2.5을 1개 매도 두 행사가 차익이 100,000원발생 했을때 자동청산 수식 부탁드립니다.
프로필 이미지
노블레스
2024-02-15
823
글번호 176644
시스템
답변완료

문의드립니다:)

안녕하세요:) 답변해주신 시스템에 대해 추가하고 싶은 부분이 있어 문의드립니다. 역사적 신고가나 6년 신고가 가격을 돌파시 진입을 하게 되는 전략인데요:) 제주반도체가 1월25일 진입 조건에 해당하긴 했는데 신고가 갱신이 안된 것인지 전일 신고가 돌파시 진입을 하게 되어서요 해당 부분이 개선될 수 있는지 문의드립니다 ----------------------------------------------------------------- input : 금액(2000000); var : HisH(0,Data2),cnt(0),YH6(0,Data2),trade(False),dm(0,Data1),entry(0); var : Rebuy(False,Data1),NegCnt(0,Data1); Array : YH[20](0,Data2); #역사적 신고가(참조데이터의 전체봉 중 최고가) if HisH == 0 or (HisH > 0 and Data2(H) > HisH) Then HisH = data2(H); #연간 최고가 계산 if data2(Bdate > Bdate[1]+1000) Then { For cnt = 19 DownTo 1 { YH[cnt] = YH[cnt-1]; } YH[0] = Data2(H); } if YH[0] > 0 and Data2(H) > YH[0] Then YH[0] = Data2(H); if Bdate != Bdate[1] Then { trade = true; entry = 0; dm = 0; } dm = dm + m; if (MarketPosition != 0 and MarketPosition != MarketPosition[1]) or (MarketPosition == MarketPosition[1] and TotalTrades > TotalTrades[1]) Then entry = entry+1; if TotalTrades > TotalTrades[1] Then { if IsExitName("bl1",1) == true or IsExitName("bl2",1) == true Then trade = False; ReBuy = False; NegCnt = 0; } if Bdate == Bdate[1] Then { if h > DayHigh(0)[1] Then { rebuy = true; NegCnt = 0; } if rebuy == true and C < O Then NegCnt = NegCnt+1; } if MarketPosition == 0 and trade == true and sTime >= 91000 and sTime < 150000 and dm >= 80000000000 Then { #역사적 신고가+1틱이상이면 매수 if entry == 0 Then Buy("b1",AtStop,HisH+PriceScale*1,Floor(금액/max(NextBarOpen,HisH+PriceScale*1))); if YH[5] > 0 and entry == 0 Then { #6년 최고가 계산 YH6 = 0; For cnt = 0 to 5 { if YH6 == 0 or (YH6 > 0 and YH[cnt] > YH6) Then YH6 = YH[cnt]; } #6년 최고가 +1틱이면 매수 if YH6 > 0 Then Buy("b2",AtStop,YH6+PriceScale*1,Floor(금액/max(NextBarOpen,YH6+PriceScale*1))); } if entry >= 1 and reBuy == true and NegCnt >= 3 Then { Buy("b3",AtStop,DayHigh+PriceScale*1,Floor(금액/max(NextBarOpen,DayHigh+PriceScale*1))); } } if MarketPosition == 1 Then { if IsEntryName("b1") == true Then var1 = HisH[BarsSinceEntry]; if IsEntryName("b2") == true Then var1 = YH6[BarsSinceEntry]; if IsEntryName("b3") == true Then var1 = dayhigh[BarsSinceEntry]; if CurrentContracts == MaxContracts Then ExitLong("bx1",AtLimit,var1*1.02,"",Floor(MaxContracts*0.5),1); Else ExitLong("bx2",AtLimit,var1*1.04); ExitLong("bl1",AtStop,var1*0.985); ExitLong("bl2",AtStop,EntryPrice*0.96); }
프로필 이미지
노아
2024-02-15
1298
글번호 176642
시스템
답변완료

문의 드립니다

input : starttime(140000),endtime(50000),n(30); var : Tcond(false),hh(0),h1(0),ll(0),l1(0); 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; hh = h; ll = l; h1 = hh[1]; l1 = ll[1]; IF Endtime <= starttime Then { SetStopEndofday(0); } } input : 익절틱수(0),손절틱수(50); 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("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("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); SetStopProfittarget(PriceScale*익절틱수,PointStop); SetStopLoss(PriceScale*손절틱수,PointStop); ----------- 위 수식어의 매매시간이 14시부터 익일 5시까지이고 매매의 청산싯점도 5시이고 잔고도 없는것으로 보면 정확한지요?
프로필 이미지
푸른
2024-02-15
1138
글번호 176638
시스템
답변완료

선물거래식에서 2개의 챠트에 동시 발생한 신호의 청산시간이 다릅니다.

선물거래식에서 2개의 챠트에 각각 동시 발생한 신호의 청산시간이 다릅니다. 한 화면에 2개의 챠트를 띄우고 각각 시스템-01 과 시스템-02를 운영하고 있습니다. 예제 내용을 보시면 아시겠지만 계좌1 운영--시스템-01 과 계좌2 운영--시스템-02 는 반대로 진입합니다. 당연히 익절, 손절은 아래와같이 동일하게 되어 있구요 buy-stocro-01 --> $익절 +0.95 $손절 -0.95 sell-stocro-01--> $익절 +0.95 $손절 -0.95 buy-stocro-02 --> $익절 +1.05 $손절 -2.25 sell-stocro-02--> $익절 +1.05 $손절 -2.25 그런데 2024-02-06일자 성능보고서를 보면 시스템-01, 시스템-02 같은 시간 09:19:35 에 시스템신호 'sell-stocro-02' 가 발생했으나 청산된 시간이 시스템-01 ---> 12:19:54 에 시스템-02 ---> 09:26:20 입니다. 챠트설정 등 뭔가 다르게 설정되어 이렇게 된 것 같은데 무엇을 설정해야 할까요?
프로필 이미지
우후훗
2024-02-15
1058
글번호 176637
시스템
답변완료

수고많습니다. 4가지 조건검색중 3가지 이상조건이 될때 검색되게 해주세요... 감사드립

input : sonarP(20),sonarsig(9),voscP1(5),voscP2(20),rsiP(14); Var21 = SONAR(sonarP); Var22 = ema(Var21,sonarsig); Var5 = OSCV(voscP1,voscP2); var6 = RSI(rsiP); if CrossUp(Var21,Var22) and Var21[1] < 0 and Var5 > 0 and var6[1]<=30 AND var6[1]<var6 Then Find(1); input : pd(22), bbl(20), mult(2.0), lb(50), ph(0.85),기간1(10),기간2(20); var : wvf(0), sDev(0), midLine(0), upperBand(0),rangeHigh(0), OverSold(0); var : ap(0),esa(0),d(0),ci(0),wt1(0),wt2(0); # williams vix fix 및 과매도권 밴드 계산 wvf = ((highest(close, pd) - low) / (highest(close, pd))) * 100; sDev = mult * std(wvf, bbl); midLine = ma(wvf, bbl); upperBand = midLine + sDev; rangeHigh = (highest(wvf, lb)) * ph; # 웨이브트렌드 ap = (HIGH+LOW+CLOSE)/3; esa = Ema(ap, 기간1); d = Ema(abs(ap - esa), 기간1); ci = (ap - esa) / (0.015 * d); wt1 = Ema(ci,기간2); wt2 = ma(wt1,4); if wt1[1]<=-53 && (wvf >= upperBand or wvf >= rangeHigh or wvf[1] >= upperBand or wvf[1] >= rangeHigh) && wvf[1]>wvf && Crossup(wt1,wt2) Then Find(1); input : 배분1(0.236),배분2(1.02); var : 중최고가(0),중최저가(0); var : 경계(0),경계1(False),경계2(False); var : 기준봉(0),기준봉1(False),기준봉2(False); var : 결과기준(0),결과기준1(False),결과기준2(False); var : 평균(0),평균라인(0); var : a(0), m5(0),m10(0),m20(0),m60(0),m120(0),m240(0),m480(0); var : bh(0),bc(0),b(0),aa(0); 중최고가=highest(h,20); 중최저가=lowest(l,20); 경계=(중최고가+중최저가)/2-(중최고가-중최저가)*배분1; 경계1=crossup(c, 경계)&& c>o*배분2; 경계2=crossdown(c, 경계); if 경계1 or 경계2 Then 기준봉 = O; 기준봉1=crossup(c, 기준봉); 기준봉2=crossdown(c, 기준봉); if 기준봉1 or 기준봉2 Then 결과기준=o; 결과기준1=crossup(c, 결과기준); 결과기준2=crossdown(c, 결과기준); if 결과기준1 or 결과기준2 Then A=o; M5=ema(C,5); M10=ema(C,10); M20=ema(C,20); M60=ema(C,60); M120=ema(C,120); M240=ema(C,240); M480=ema(C,480); BH=BollBandUp(20,2); BC=ma(c,20); 평균=((M5*2)+(M10*2)+(M20*3)+(M60*2)+(M120*3)+(M240*2)+(M480*2)+(BH*1)+(BC*1)) / 18; 평균라인=Ema(Ema(Ema(평균, 5), 5), 5); B=평균라인 + 20*std(평균라인,5); AA=sar(0.02,0.2); if C>=A && CROSSUP(C,B) && AA<=C Then Find(1); input : rsiLenghth(14); input : rsiOverBought(70); input : rsiOverSold(30); var : bullishCandle(False),bearishCandle(False); var : rsiValue(0),isRSIOB(False),isRSIOS(False),tradeSignal(False); var : tx1(0),tx2(0),조건(False); bullishCandle=close >= open[1] and close[1] < open[1]; //close[1] < open[1] && close[1] >= open && close >= open[1]; //high >= high[1] and low <= low[1] rsiValue=rsi(rsiLenghth); isRSIOB=rsiValue >= rsiOverBought and rsiValue; isRSIOS=rsiValue <= rsiOverSold and rsiValue; tradeSignal=((isRSIOS or isRSIOS[1] or isRSIOS[2]) and bullishCandle); if tradeSignal && bullishCandle && C>O Then Find(1);
프로필 이미지
그냥생각없슴
2024-02-15
977
글번호 176636
종목검색
답변완료

480 tjs

10분봉에서.... 1 ,주가가 480 선위에 있고 2 ,스톡해스틱 슬로우 12, 5, 5,=> (0 에서 20 사이ㄷ또는 (1 or 2 봉전) 20돌파) 3 ,볼린저밴드 period :20 , d1 : 2 의 하단선 맞고거나 or 돌파 (저가도 인정) 위세경우를 만족 하는 검색식과 종목검색식을 알고 싶습니다. 새해 복 많이 받의세요
프로필 이미지
ujkl
2024-02-15
755
글번호 176635
검색

2wnwn 님에 의해서 삭제되었습니다.

프로필 이미지
2wnwn
2024-02-15
11
글번호 176634
시스템
답변완료

수식요청

다음 조건에 맞는 수식을 요청드립니다. 0.(일봉 1봉전) 평균거래량 5만주 이상 1.(일봉 1봉전) 주가범위 천원~ 5만원 a.0봉전 RSI(14) 65.0선 상향돌파 b.1봉전 RSI(14) 64.9 이하 c.2봉전 RSI(14) 64.9 이하 d.3봉전 RSI(14) 64.9 이하 e.4봉전 RSI(14) 64.9 이하 f.5봉전 RSI(14) 64.9 이하 g.0봉전 지수이평배열 60>120>240 h.0봉전 이평이격도; 시가 1이평과 종가 240이평 95%~110% i.0봉전 지수이평배열 60<120<240 j.0봉전 이평이격도; 종가 1이평과 종가 240이평 70%~105% k.1봉전 대비 0봉전 종가등락율: 3%이상 0 and 1 and a and b and c and d and e and f and ((g and h) or (i and j)) and k 소량으로 자동매매에 사용해보고자 하는 수식입니다.
프로필 이미지
ksks
2024-02-14
1052
글번호 176633
종목검색