커뮤니티

예스랭귀지 Q&A

글쓰기
답변완료

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

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

배움이 님에 의해서 삭제되었습니다.

프로필 이미지
배움이
2023-09-11
22
글번호 172364
시스템

천지고원 님에 의해서 삭제되었습니다.

프로필 이미지
천지고원
2023-09-11
1
글번호 172363
종목검색
답변완료

수식작성요청

1.분봉챠트에 지수이동평균선을 표시하고 특정조건의 종목검색식을 만들어 보았으나 내부함수의 입력값이 2개 필요합니다 선언되지않은 이름 nPredayclose가 사용되었습니다며 검증이 안되네요. 하나는 사용자함수를 등록하면 될듯한데 키움이라면 어렵지 않지만 이건 어렵군요.10일 20일 지수이동평균도 맞는건지 삐리하고요 ㅋ. 수식작성좀 부탁드립니다^^ 2.작성해본 검색식인데 참조해주시기 바랍니다 VAR : LL(0),M10(0),M20(0); LL = Lowest(L, 60); if LL[1]>L Then M10=ema((DayClose()+npredayclose(1)+npredayclose(2)+npredayclose(3)+,,npredayclose(9))/10); if LL[1]>L Then M20=ema((dayclose()+npredayclose(1)+npredayclose(2)+npredayclose(3)+npredayclose(4)+npredayclose(5) +npredayclose(6)+npredayclose(7)+npredayclose(8)+,,,npredayclose(19))/20); IF M10 < M20 && CrossUp(DayClose(), M20) && DayClose()>O TheN Find(1);
프로필 이미지
트라이
2023-09-12
1033
글번호 172362
종목검색
답변완료

추세선 시작점

input : Period(180); Var:j(0),T(0),tl(0),TL1(0),tx(0) ,box(0); Var: date11(0),date12(0),time11(0),time12(0), date21(0),date22(0),time21(0),time22(0), date31(0),date32(0),time31(0),time32(0); Array: HiVal[20](0),LoVal[20](0),HiBar[20](0),LoBar[20](0); Plot1(0); For j = 0 To 19 { HiBar[j] = HiBar[j] + 1; LoBar[j] = LoBar[j] + 1; } if crossup(c,highest(H,Period)[1]) Then T = 1; if CrossDown(c,Lowest(L,Period)[1]) Then T = -1; If T == -1 Then { If T[1] != -1 Then { For j = 18 DownTo 0 { LoVal[j+1] = LoVal[j]; LoBar[j+1] = LoBar[j]; } LoVal[0] = L; LoBar[0] = 0; date11 = date[HiBar[0]]; time11 = stime[HiBar[0]]; Value11 = HiVal[0]; date12 = date[LoBar[0]]; time12 = stime[LoBar[0]]; Value12 = LoVal[0]; TL_Delete(TL); TL = TL_New(sdate,stime,Value12,NextBarSdate,NextBarStime,NextBarOpen); TL1 = TL_New(date11,time11,Value11,date12,time12,Value12); TL_SetColor(TL1,Blue); TL_SetSize(TL1,2); date21 = date[HiBar[0]]; time21 = stime[HiBar[0]]; date22 = date[0]; time22 = stime[0]; box = Box_New(date11,time11,Value11,date12,time12,Value12); Text_SetSize(tx,25); Text_SetColor(Tx,Red); Text_SetStyle(tx,1,1); Text_SetBold(tx,1); if abs(value12[1]-value11[1]) < 0.7 Then Text_Delete(tx); tx = Text_New(sDate,stime,value12,NumToStr(value11-value12,2)); Text_SetColor(Tx,Blue); Text_SetStyle(tx,1,0); Text_SetSize(tx,25); Text_SetBold(tx,1); } If LoVal[0] >= L Then { LoVal[0] = L; LoBar[0] = 0; date12 = date[LoBar[0]]; time12 = stime[LoBar[0]]; Value12 = LoVal[0]; TL_SetEnd(TL1, date12,time12,Value12); date22 = date[0]; time22 = stime[0]; Box_SetEnd(box,date12,time12,Value12); Text_SetString(tx,NumToStr(value11-value12,2)); Text_SetLocation(tx,sDate,sTime,value12); } if value12 > value11-0.7 Then { Box_SetColor(box,Cyan); Box_SetFill(box,true,50); } else if value12 <= value11-0.7 and value12 > value11-0.9 Then { Box_SetColor(box,Yellow); Box_SetFill(box,true,90); } else if value12 <= value11-0.9 and value12 > value11-1.3 Then { Box_SetColor(box,Lime); Box_SetFill(box,true,80); } else if value12 <= value11-1.3 and value12 > value11-1.6 Then { Box_SetColor(box,Cyan); Box_SetFill(box,true,50); } else if value12 <= value11-1.6 and value12 > value11-2 Then { Box_SetColor(box,Blue); Box_SetFill(box,true,25); } else { Box_SetColor(box,Lime); Box_SetFill(box,true,35); } } If T == 1 Then { If T[1] != 1 Then { For j = 18 DownTo 0 { HiVal[j+1] = HiVal[j]; HiBar[j+1] = HiBar[j]; } HiVal[0] = H; HiBar[0] = 0; date11 = date[LoBar[0]]; time11 = stime[LoBar[0]]; Value11 = LoVal[0]; date12 = date[HiBar[0]]; time12 = stime[HiBar[0]]; Value12 = HiVal[0]; TL_Delete(TL); TL = TL_New(sdate,stime,Value12,NextBarSdate,NextBarStime,NextBarOpen); TL1 = TL_New(date11,time11,Value11,date12,time12,Value12); TL_SetColor(TL1,Red); TL_SetSize(TL1,2); date31 = date[LoBar[0]]; time31 = stime[LoBar[0]]; date32 = date[0]; time32 = stime[0]; box = Box_New(date11,time11,Value11,date12,time12,Value12); Text_SetSize(tx,25); Text_SetColor(Tx,Blue); Text_SetStyle(tx,1,0); Text_SetBold(tx,1); if abs(value12[1]-value11[1]) < 0.7 Then Text_Delete(tx); tx = Text_New(sDate,stime,value12,NumToStr(value12-value11,2)); Text_SetColor(Tx,Red); Text_SetStyle(tx,1,1); Text_SetSize(tx,25); Text_SetBold(tx,1); } If HiVal[0] <=H Then { HiVal[0] = H; HiBar[0] = 0; date12 = date[HiBar[0]]; time12 = stime[HiBar[0]]; Value12 = HiVal[0]; TL_SetEnd(TL1, date12,time12,Value12); date32 = date[0]; time32 = stime[0]; Box_SetEnd(box,date12,time12,Value12); Text_SetString(tx,NumToStr(value12-value11,2)); Text_SetLocation(tx,sDate,sTime,value12); } if Value12 > value11+1.1 Then { Box_SetColor(box,Pink); Box_SetFill(box,true,90); } else if value12 >= value11+0.8 and value12 <= value11+1.1 Then { Box_SetColor(box,Magenta); Box_SetFill(box,true,40); } Else { Box_SetColor(box,Orange); Box_SetFill(box,true,60); } } 추세선, 박스, 추세선크기, 세가지 시작점 변경. 선물 15틱 차트에서 여러봉의 고점이 같을 때, 마지막 최고가봉이 하락추세선 시작점인것을, 첫 최고가봉이 하락추세선의 시작점으로 변경. 그림1의 아래쪽은 83322와 동일한 수식이고, 그림2는 82425에서 알려주신 상기 수식의 상하대칭 지점인데 모두 첫 최고가봉이 기준점으로 되어 있습니다. 참고해서 첫 최고가봉으로 변경 부탁드립니다.
프로필 이미지
고성
2023-09-12
1070
글번호 172361
지표
답변완료

문의 드립니다.

1. input : StartTime(190000),EndTime(30000),진입횟수(0); input : 익절틱수(850),손절틱수(60); Input:Length(1),Pval(0.01); var : Tcond(False),entry(0); Variables: Mom(0); Var : N1(0),dayPl(0),당일수익(0),당일손실(0),Xcond(false); IF Endtime > starttime Then SetStopEndofday(Endtime); Else { if sDate != sDate[1] Then SetStopEndofday(Endtime); } if (sdate != sdate[1] and stime >= StartTime) or (sdate == sdate[1] and stime >= StartTime and stime[1] < StartTime) Then { Tcond = true; entry = 0; Xcond = false; N1 = NetProfit; IF Endtime <= starttime Then { SetStopEndofday(0); } } if (sdate != sdate[1] and stime >= EndTime) or (sdate == sdate[1] and stime >= EndTime and stime[1] < EndTime) Then { Tcond = False; } if TotalTrades > TotalTrades[1] then { if daypl >= 당일수익 or daypl <= -당일손실 Then Xcond = true; if (IsExitName("dbp",1) == true or IsExitName("dbl",1) == true ) then Xcond = true; } if (MarketPosition != 0 and MarketPosition != MarketPosition[1]) or (MarketPosition == MarketPosition[1] and TotalTrades > TotalTrades[1]) Then entry = entry+1; Buy("CBI_LE",AtStop,Highest(High,Length)+Pval); ExitLong("CBI_SE",AtStop,Lowest(High,Length)+Pval); if MarketPosition < 1 then { ExitLong("dbp",atStop,EntryPrice+((당일수익-daypl)/CurrentContracts)); ExitLong("dbl",AtStop,EntryPrice-((당일손실+daypl)/CurrentContracts)); } SetStopProfittarget(PriceScale*익절틱수,PointStop); SetStopLoss(PriceScale*손절틱수,PointStop); 2. input : StartTime(190000),EndTime(30000),진입횟수(0); input : 익절틱수(850),손절틱수(60); Input:Length(1),Pval(0.01); var : Tcond(False),entry(0); Variables: Mom(0); Var : N1(0),dayPl(0),당일수익(0),당일손실(0),Xcond(false); IF Endtime > starttime Then SetStopEndofday(Endtime); Else { if sDate != sDate[1] Then SetStopEndofday(Endtime); } if (sdate != sdate[1] and stime >= StartTime) or (sdate == sdate[1] and stime >= StartTime and stime[1] < StartTime) Then { Tcond = true; entry = 0; Xcond = false; N1 = NetProfit; IF Endtime <= starttime Then { SetStopEndofday(0); } } if (sdate != sdate[1] and stime >= EndTime) or (sdate == sdate[1] and stime >= EndTime and stime[1] < EndTime) Then { Tcond = False; } if TotalTrades > TotalTrades[1] then { if daypl >= 당일수익 or daypl <= -당일손실 Then Xcond = true; if (IsExitName("dbp",1) == true or IsExitName("dbl",1) == true ) then Xcond = true; } if (MarketPosition != 0 and MarketPosition != MarketPosition[1]) or (MarketPosition == MarketPosition[1] and TotalTrades > TotalTrades[1]) Then entry = entry+1; ExitShort("CBI_LE",AtStop,Highest(High,Length)-Pval); Sell("CBI_SE",AtStop,Lowest(Low,Length)-Pval); if MarketPosition < 1 then { ExitShort("dbp",AtStop,EntryPrice-((당일수익-daypl)/CurrentContracts)); ExitShort("dbl",AtStop,EntryPrice-((당일손실+daypl)/CurrentContracts)); } SetStopProfittarget(PriceScale*익절틱수,PointStop); SetStopLoss(PriceScale*손절틱수,PointStop); 질의를 드렸던 내용인데요. 매수는 앞 캔들의 고가를 0.01 이상일때 진입신호로 되어있습니다. 매도는 앞 캔들의 저가를 0.01 이상일때 진입신호로 되어있습니다. 아래로 수정을 부탁드립니다. 매수는 앞 캔들의 종가를 0.01 이상일때 진입신호로 수정을 부탁드립니다. 매도는 앞 캔들의 종가를 0.01 이하일때 진입신호로 수정을 부탁드립니다. 미리 감사드립니다.
프로필 이미지
푸른
2023-09-11
1142
글번호 172359
시스템
답변완료

문의 드립니다.

//@version=3 study(title="Money Flow Index") // Typical price = (high price + low price + closing price) / 3 // Raw money flow = typical price x volume // Money flow ratio = (14-day Positive Money Flow) / (14-day Negative Money Flow) // Positive money flow is calculated by summing up all of the money flow on the days in the period // where the typical price is higher than the previous typical price. This same logic applies for the negative money flow. // MFI = 100 - 100 / (1 + money flow ratio) length = input(title="Period Length", type=integer, defval=10, minval=1) show_value = input(title="Show which value", type=string, options=["Raw Money Flow", "Money Flow Ratio", "Money Flow Index"], defval="Money Flow Index") show_raw = (show_value == "Raw Money Flow") show_ratio = (show_value == "Money Flow Ratio") show_index = (show_value == "Money Flow Index") show_sma = input(title="Show MFI SMA", type=bool, defval=true) avg_len = input(title="SMA Length", type=integer, defval=5, minval=1) mfi_high = 80 mfi_mid = 50 mfi_low = 20 prc = avg(high, low, close) raw = prc * volume pos_day = (prc[0] >= prc[1]) ? raw : 0 neg_day = (prc[0] <= prc[1]) ? raw : 0 pos_period = sum(pos_day, length) neg_period = sum(neg_day, length) mf_ratio = (pos_period / neg_period) mf_index = 100 - (100 / (1 + mf_ratio)) mfi_sma = sma(mf_index, avg_len) plot(show_raw ? pos_period : na, "Positive Flow", green, linewidth=2, transp=0) plot(show_raw ? neg_period : na, "Negative Flow", red, linewidth=2, transp=0) plot(show_ratio ? mf_ratio : na, "Money Flow Ratio", black, linewidth=2, transp=0) plot(show_index ? mf_index : na, "Money Flow Index", blue, linewidth=2, transp=0) plot(show_index and show_sma ? mfi_sma : na, "Money Flow SMA", gray, linewidth=1, transp=0) plot(show_index ? mfi_high : na, "High Line", green) plot(show_index ? mfi_mid : na, "Mid Line", silver) plot(show_index ? mfi_low : na, "Low Line", red) 트레이딩뷰 수식인데 위 수식에서 Money Flow Index선과 시그널선 그리고 기준선만 예스로 좀 바꿔주세요.
프로필 이미지
신대륙발견
2023-09-11
1480
글번호 172347
지표
답변완료

수식오류수정 부탁드립니다

당일 두번째 진입(b2)부터는 직전 청산후 5봉 경과후 진입식 입니다.그런데 어떤날은 첫번째 진입인 데도 두번째이후 진입명인 b2가 표시가 됩니다. 어떤 표현이 잘못된건지 수정 부탁드립니다. input : left(5),right(5),ln(3),dn(12),ts(30),loss(20),scl(3),LAT(5); var : ii(0),entry(0),T1(0); if Bdate != Bdate[1] Then{ T1 = TotalTrades; } if MarketPosition == 0 Then entry = TotalTrades-T1; Else entry = TotalTrades-T1+1;//당일 진입 3회까지만 if bdate != Bdate[1] Then { var1 = 0; ii = 0; } ii = ii +1; if ii >= 11 and Swinglow(1,L,5,5,11) != -1 Then { var2 =L[5]; } if date != date[1] then{ var3 = 0;// 당일 첫번째 진입 } if MarketPosition==0 and NextBarSdate == sDate AND Var3<1 and var2>0 and entry< 3 Then//var3<1 당일 첫번째진입은 { Buy("b1",AtLimit,var2+PriceScale*scl);//첫번째 진입은 b1 var3=1; } if MarketPosition==0 and BarsSinceExit(1)>5 and NextBarSdate == sDate and var2>0 and entry< 3 Then// 당일 두 번재 진입부터는 직전 청산후 5봉 경과후 진입 { Buy("b2",AtLimit,var2+PriceScale*scl);//2번째봉부터는 청산후 5본 경과 } SetStopLoss(LOSS,PercentStop); SetStopTrailing(dn,ts,PercentStop,1); SetStopEndofday(151500);
프로필 이미지
피카2
2023-09-11
1008
글번호 172345
시스템
답변완료

어제까지 42일평균값

안녕하세요? 종목검색식 부탁드려요 오늘의종가(주가의 현재값)이 어제까지 42일동안의 평균값을 돌파하는 검색식부탁드려요 어제까지 20일동안 주가의 종가의 위치는 일목기준선의 42일선 밑에 주가가 위치해 있어야합니다 감사합니다
프로필 이미지
정번개비
2023-09-11
888
글번호 172344
종목검색
답변완료

수식 부탁드립니다.

RSI의 기준선을 하향이탈하거나 상향돌파할시의 라인설정과 그 라인 돌파하는 수식 신호수식을 의뢰합니다 A=RSI(14); B=CrossDown(A,23); BB=Valuewhen(1,B,(O+C)/2); D=CrossUp(A,25); DD=Valuewhen(1,D,(O+C)/2) 1. 매수신호1 가. BB가 3번이상 하락변동하고, 하락한 마지막 BB라인을 시가종가로 상향돌파할 때 나. DD가 3번이상 하락변동하고, 하락한 마지막 DD라인을 시가종가로 상향돌파할 때 - 가 또는 나의 조건이 만족할 때의 매수신호수식 여기서 하락이라 함은 BB나 DD라인을 지표수식으로 표시해보면 계단식으로 변화가 있는데 이 변화가 계단식 하락으로 연속 세번이상 변화가 있을 때를 말함. 단 하락하다가 상승변화가 있으면 카운팅은 다시 계산되어야 한다 2. 매수신호2 BB가 하락한 것이 5봉이내에 발생한 적이 있으면서 DD가 하락발생하고, 하락변동한 DD라인을 시가종가로 돌파할 경우의 신호수식 시가종가돌파 한다는 것은 O<DD && C>DD 인 경우임, CrossUp이 아님 보통 BB나 DD가 하락시에, 그봉에서 양봉이 나오는 경우가 많은데 이봉의 중심가를 시종가로 돌파하는 경우도 포함되어야 한다. 3. 위의 경우와 별개의 질문입니다 A=AVG(C,20): A라인의 후행라인 설정시에는 A[-10], 선행라인 설정시에는 A[10]으로 하면 되는데 선행시킨 A[10] 이평선의 추세를 표현하고자 한다면 어떤 수식으로 해야하나요? 예를들어 선행시킨 라인의 하향추세를 표현하기 위해 A[10][1] > A[10] 로 하니까 수식오류라고 나와서 어케해야하는지 알려주세요.
프로필 이미지
해피오
2023-09-11
825
글번호 172337
지표