커뮤니티

예스랭귀지 Q&A

글쓰기
답변완료

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

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

수식 추가로 부탁드립니다

수고하십니다. 아래 사용자 함수는 첨부와 같은 에러 내용이 나오고 안됩니다.. 재확인 부탁드립니다. 감사합니다.수고하세요.. //2.minhighPrice1의 사용자 함수 Input : ATRperiod1(Numeric),amplitude1(Numeric); var : trend1(0),nexttrend1(0),maxlowPrice1(0); var : up1(0),down1(0),atrHigh1(0),atrLow1(0),arrowup1(0),arrowdown1(0); var : atr21(0),dev1(0),highPrice1(0),lowPrice1(0),highma1(0),lowma1(0),midma1(0),HTM1(0); atr21 = atr(ATRperiod1) / 2 ; dev1 = atr21 * 5.5 ; highPrice1 = Highest(H,amplitude1*1.5); lowPrice1 = Lowest(L,amplitude1*1.5); highma1 = ma(high, amplitude1*1.25); lowma1 = ma(low, amplitude1*0.75); midma1 = (highma1+lowma1)/2 ; if nexttrend1 == 1 Then { maxlowPrice1 = max(lowPrice1, maxlowPrice1); if midma1 < maxlowPrice1 and close < iff(isnan(low[1])==true,low,Low[1]) Then { trend1 = 1; nexttrend1 = 0; minhighPrice1 = highPrice1; } } else { minhighPrice1 = min(highPrice1, minhighPrice1[1]); if midma1 > minhighPrice1 and close > iff(isnan(high[1])==true,high,high[1]) Then { trend1 = 0; nexttrend1 = 1; maxlowPrice1 = lowPrice1; } }
프로필 이미지
오이도인
2022-06-02
1494
글번호 159504
사용자 함수
답변완료

수식 문의

안녕하세요. 일전에 아래와 같은 수식을 도움 받은바 있습니다. 그런데 깔아보니, 봉색깔이 하나로 밖에 나오지않습니다. 두개의 조건이면, 두개의 색깔이 나와야 할 터인데, 어찌된 영문인지 모르겠습니다. 다시 살펴봐주시면 감사하겠습니다. input : gamma(0); var : OSeries(0),ol0(0),ol1(0),ol2(0),ol3(0),ol(0); var : CSeries(0),cl0(0),cl1(0),cl2(0),cl3(0),cl(0); OSeries = Open; IF BarIndex == 0 THEN { OL = OSeries; ol0 = OSeries; ol1 = OSeries; ol2 = OSeries; ol3 = OSeries; } ELSE { ol0 = (1 - gamma) * OSeries + gamma * ol0; ol1 = -gamma * ol0 + ol0 + gamma * ol1; ol2 = -gamma * ol1 + ol1 + gamma * ol2; ol3 = -gamma * ol2 + ol2 + gamma * ol3; OL = (ol0 + 2 * ol1 + 2 * ol2 + ol3) / 6; } CSeries = c; IF BarIndex == 0 THEN { CL = CSeries; cl0 = CSeries; cl1 = CSeries; cl2 = CSeries; cl3 = CSeries; } ELSE { cl0 = (1 - gamma) * CSeries + gamma * cl0; cl1 = -gamma * cl0 + cl0 + gamma * cl1; cl2 = -gamma * cl1 + cl1 + gamma * cl2; cl3 = -gamma * cl2 + cl2 + gamma * cl3; CL = (cl0 + 2 * cl1 + 2 * cl2 + cl3) / 6; } PlotPaintBar(h,l,ol,cl,"강조");
프로필 이미지
까냐스키
2022-06-02
1345
글번호 159503
강조
답변완료

설명을 부탁 드립니다

if NextBarSdate != sDate Then { if NextBarOpen > C Then Sell("s",AtStop,C); if NextBarOpen < C Then Buy("b",AtStop,C); } --------------------- 신호발생이 시가나 전일 종가에 영향을 받는다는 내용인가요 ?
프로필 이미지
푸른
2022-06-02
1406
글번호 159494
시스템
답변완료

수정 부탁드립니다

input : N(5),금액(10000000); var : cnt(0),hh(0),ll(0); hh = 0; ll = 0; For cnt = 1 to N { if (hh == 0 or (hh > 0 and DayHigh(cnt) > hh)) Then hh = DayHigh(cnt); if (ll == 0 or (ll > 0 and DayLow(cnt) < ll)) Then ll = DayLow(cnt); } var1 = hh-(hh-ll)*0; var2 = hh-(hh-ll)*0.236; var3 = hh-(hh-ll)*0.382; var4 = hh-(hh-ll)*0.500; var5 = hh-(hh-ll)*0.618; var6 = hh-(hh-ll)*0.786; var7 = hh-(hh-ll)*1.000; if CrossDown(C,var2) Then Buy("b1",OnClose,DEF,Floor((금액*0.2)/C)); if CrossDown(C,var3) Then Buy("b2",OnClose,DEF,Floor((금액*0.2)/C)); if CrossDown(C,var4) Then Buy("b3",OnClose,DEF,Floor((금액*0.2)/C)); if CrossDown(C,var5) Then Buy("b4",OnClose,DEF,Floor((금액*0.2)/C)); if CrossDown(C,var6) Then Buy("b5",OnClose,DEF,Floor((금액*0.2)/C)); if MarketPosition == 1 Then { if CrossUp(c,var1) Then ExitLong("bx1",OnClose,DEF,"b1"); if CrossUp(c,Var2) Then ExitLong("bx2",OnClose,DEF,"b2"); if CrossUp(c,Var3) Then ExitLong("bx3",OnClose,DEF,"b3"); if CrossUp(c,Var4) Then ExitLong("bx4",OnClose,DEF,"b4"); if CrossUp(c,var5) Then ExitLong("bx5",OnClose,DEF,"b5"); } --------------------------- 수정 부탁드립니다. 1. 익절 300틱, 손절 20틱 2. 반대도 부탁드려요~
프로필 이미지
푸른
2022-06-02
1509
글번호 159493
시스템
답변완료

트레이딩뷰 지표소스 검색식

트레이딩뷰 지표소스로 종목 검색식을 만들고 싶은데 가능할까요? 지표상 Buy 신호 종목 검색을 하고 싶습니다. //@version=3 study(title="ATR Smoothed (By dysrupt)_BuySell version", shorttitle="ATR_SM_BuySell", overlay = true) //Modifyed by @guikroth ////////////////////////////////////////////////////////////////////////////////INPUTS nATRPeriod = input(21, "Period") nATRMultip = input(6.3, "Multiplier",type=float, minval=0.5, maxval=1000, step=0.1) /////////////////////////////////////////////////////////////////////////////////ATR xATR = atr(nATRPeriod) nLoss = nATRMultip * xATR xATRTrailingStop = na xATRTrailingStop := iff(close > nz(xATRTrailingStop[1], 0) and close[1] > nz(xATRTrailingStop[1], 0), max(nz(xATRTrailingStop[1]), close - nLoss), iff(close < nz(xATRTrailingStop[1], 0) and close[1] < nz(xATRTrailingStop[1], 0), min(nz(xATRTrailingStop[1]), close + nLoss), iff(close > nz(xATRTrailingStop[1], 0), close - nLoss, close + nLoss))) pos = na pos := iff(close[1] < nz(xATRTrailingStop[1], 0) and close > nz(xATRTrailingStop[1], 0), 1, iff(close[1] > nz(xATRTrailingStop[1], 0) and close < nz(xATRTrailingStop[1], 0), -1, nz(pos[1], 0))) color = pos == -1 ? red: pos == 1 ? lime : blue //patr=plot(xATRTrailingStop, color=color, linewidth=2, title="ATR Trailing Stop", transp=0) // Deternine if we are currently LONG isLong = false isLong := nz(isLong[1], false) // Determine if we are currently SHORT isShort = false isShort := nz(isShort[1], false) //Trading // Buy only if the buy signal is triggered and we are not already long LONG = not isLong and pos == 1 // Sell only if the sell signal is triggered and we are not already short SHORT = not isShort and pos == -1 if (LONG) isLong := true isShort := false if (SHORT) isLong := false isShort := true barcolor(isLong ? lime : isShort ? red : na) // Show Break Alerts plotshape(SHORT, title="Sell", style=shape.labeldown, location=location.abovebar, size=size.normal, text="Sell", transp=0, textcolor = white, color=red, transp=0) plotshape(LONG, title="Buy", style=shape.labelup, location=location.belowbar, size=size.normal, text="Buy", textcolor = white, color=green, transp=0) // === /PLOTTING === // Send alert to TV alarm sub-system alertcondition(LONG,title="Sell",message="Sell") alertcondition(SHORT,title="BuY",message="Buy") alertcondition(SHORT,title="BuY",message="Buy") alertcondition(SHORT,title="BuY",message="Buy") ////////////////////////////////////////////////////////////////////////////////VWMA len2 = input(100, minval=1, title="Smooth") src = input(close, title="Source") out = vwma(src, len2) avg1=avg(out, xATRTrailingStop) plot(avg1, color=aqua, transp=0, title="ATR")
프로필 이미지
귀족온달
2022-06-02
2570
글번호 159492
종목검색
답변완료

문의

도움 주셔서 감사드립니다. 아래 영웅문 수식 변환하여 종목검색에 활용하고자 합니다. *수식* a=(sum(if(C>C(1),1,0),Period)*sum(if(C>C(1),C-C(1),0),Period)/(sum(if(C>C(1),C-C(1),0),Period)+sum(if(C<C(1),C(1)-C,0),Period))-sum(if(C<C(1),1,0),Period)*sum(if(C<C(1),C(1)-C,0),Period)/(sum(if(C>C(1),C-C(1),0),Period)+sum(if(C<C(1),C(1)-C,0),Period)))/Period*100 *검색 조건* a가 -50 이하인 종목 검색
프로필 이미지
장태주
2022-06-02
1410
글번호 159491
종목검색
답변완료

문의드립니다.

수고 많으십니다. 키움 영웅문의 검색식을 예스스탁 검색식으로 사용하고져 합니다. 동일조건으로 검색 될 수 있도록 부탁드립니다. ★ 검색식 - [일] 0봉전 일목균형표(9,26,52) 1봉이내 후행스팬이 전환선 상향돌파후 지속 - [일] 0봉전 일목균형표(9,26,52) 1봉이내 후행스팬이 기준선 상향돌파후 지속 # 첨부 - 후행스팬이 전환선+기준선 돌파 검색
프로필 이미지
관스
2022-06-01
1188
글번호 159490
종목검색

맴맴잉 님에 의해서 삭제되었습니다.

프로필 이미지
맴맴잉
2022-06-01
0
글번호 159489
시스템
답변완료

매도 청산식 문의 드립니다.

얼마전에 현물관련 분할매도 관련 시스템식을 요청드린적이 있었습니다. 그런데 해당식으로 적용했을때 적용이 안되는 경우가 있는데 이유를 찾을수가 없어 이렇게 글을 남깁니다. 요청드렸던 식은 아래와 같습니다. 위 그림파일을 보시면 1,2,3번 으로 동그라미를 쳐놨습니다. 1. 1번 동그라미에서 3%분할익절, 4% 분할일익절 청산이 되지 않은 이유가 궁금합니다. 2. 2번 동그라미에서는 아주 잘 적용 된것 같습니다. 이부분에선 질문이 없습니다. 3. 3번 동그라미에서는 B, C, D 에서 매수가 되었고, 3%에서 전량 매도청산되었는데, 해당부분에서는 4, 5, 7, 10%의 분할익절이 왜 적용안되었는지 궁금합니다. 확인부탁드리겠습니다. 그리고 항상 감사드립니다. --------------------------------------------------------------- 안녕하세요 예스스탁입니다. 예스랭귀지는 대소문자 구분하지 않습니다 h나 H나 같습니다. #매수진입 if MarketPosition == 1 Then { #전봉대비 수량 감소(일부 청산발생을 위미) if CurrentContracts < CurrentContracts[1] Then { #청산가 저장 var1 = LatestExitPrice(0); #청산시간 저장 Var2 = TimeToMinutes(sTime); } #전봉대비 수량 증가(추가 진입발생을 의미) if CurrentContracts > CurrentContracts[1] Then { #현재수량 저장 Var3 = CurrentContracts; #고가 저장 Var4 = H; } #최근 진입후 최고가 계산 #현재봉 고가가 Var4보다 크면 Var4의 값을 현재봉 고가로 저장 if h > Var4 Then Var4 = h; #일부청산이 한번이상 발생하고 #현재 시간이 일부청산후 10분 이후이고 #종가가 청산가 보다 작으면 #전량 청산 if var1 > 0 and TimeToMinutes(sTime) >= Var2+10 and C < AvgEntryPrice then ExitLong("bx"); #진입후 최고가가 평단가+3% 작으면 #평단가+3%를 셋팅하고 다음봉에서 해당가격 터치시 즉시 40% 청산 if Var4 < AvgEntryPrice*1.03 Then ExitLong("3%익절",AtLimit,AvgEntryPrice*1.03,"",Floor(Var3*0.40)); #진입후 최고가가 평단가+4% 작으면 #평단가+4%를 셋팅하고 다음봉에서 해당가격 터치시 즉시 30% 청산 if Var4 < AvgEntryPrice*1.04 Then ExitLong("4%익절",AtLimit,AvgEntryPrice*1.04,"",Floor(Var3*0.30)); #진입후 최고가가 평단가+5% 작으면 #평단가+5%를 셋팅하고 다음봉에서 해당가격 터치시 즉시 10% 청산 if Var4 < AvgEntryPrice*1.05 Then ExitLong("5%익절",AtLimit,AvgEntryPrice*1.05,"",Floor(Var3*0.10)); #진입후 최고가가 평단가+6% 작으면 #평단가+6%를 셋팅하고 다음봉에서 해당가격 터치시 즉시 10% 청산 if Var4 < AvgEntryPrice*1.06 Then ExitLong("7%익절",AtLimit,AvgEntryPrice*1.06,"",Floor(Var3*0.10)); #진입후 최고가가 평단가+10% 작으면 #평단가+10%를 셋팅하고 다음봉에서 해당가격 터치시 즉시 전량 청산 if Var4 < AvgEntryPrice*1.10 Then ExitLong("10%익절",AtLimit,AvgEntryPrice*1.10); } Else#매수진입중이 아니면 { #변수 0으로 초기화 var1 = 0; Var2 = 0; }
프로필 이미지
맴맴잉
2022-06-01
896
글번호 159488
시스템