커뮤니티

예스랭귀지 Q&A

글쓰기
답변완료

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

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

비정성시 님에 의해서 삭제되었습니다.

프로필 이미지
비정성시
2023-06-22
5
글번호 169995
시스템

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

프로필 이미지
ds2335
2023-06-22
1
글번호 169994
사용자 함수
답변완료

잘 부탁드립니다

안녕하세요. 코드 실행결과 강제청산과 추가매수가 한봉에 같이 나옵니다. 1. 매도가 추가매수보다 먼저 작동해서 추가매수를 진행하지 못하게 하고 싶습니다. 캔들 하나에 매도와 매수는 한번만 이루어지게 부탁드려요 2. 그리고 코드상에서 추가매수는 0이 나올 수 없는데 0이 나오네요.. 왜그런가요? 감사합니다 input : nDate(20200101), 보유기간(14); var : hh(0), MID(0), varl(0), vol(0); #첫 매수조건 if MarketPosition == 0 and sDate >= nDate and V > 4 * V[1] and C >= O and Average(C, 120)[1] < Average(C,120) and L <= Average(C,5) and C >= Average(C, 120) Then Buy("첫 매수", OnClose,Def,1); if MarketPosition ==1 and LatestEntryName(0) == "첫 매수" Then MID = (C[BarsSinceEntry] + O[BarsSinceEntry])/2; #추가매수조건 if MarketPosition ==1 Then{ varl = (L-C[1])/C[1]*100; vol = floor(abs(varl)); if vol > 1 and DateToJulian(sDate) < DateToJulian(EntryDate) + 보유기간 Then Buy("추가매수",OnClose,Def,vol); if CurrentContracts > CurrentContracts[1] Then hh = h; if h > hh Then hh = h; #매도(익절,청산 조건) if DateToJulian(sDate) >= DateToJulian(EntryDate) + 보유기간 Then ExitLong("기간이탈", OnClose); if C <= Average(C,120) Then ExitLong("이평이탈", OnClose); if C < MID or O < MID Then ExitLong("중심봉이탈",OnClose); if L <= 0.98 * Average(C, 5) Then ExitLong("강제청산",OnClose); if hh >= AvgEntryPrice * 1.06 Then ExitLong("매도",AtStop,hh*0.97); }
프로필 이미지
현우르곳
2023-06-22
1553
글번호 169993
시스템

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

프로필 이미지
ds2335
2023-06-22
0
글번호 169992
사용자 함수
답변완료

수식 문의 드립니다

안녕하세요. 중앙선 수식 문의 드립니다. 1. 일봉 개수별 중앙선을 차트에 표시할 수 있습니까? ex) 일봉 2개, 3개 ... 등 2. 월, 주봉 중앙선을 차트에 표시할 수 있습니까? -표시되면 일봉 처럼 개수별로 표시하는 방법도 알려주세요 3. 월, 주봉 시가와 종가를 표시할 수 있습니까?
프로필 이미지
부활
2023-06-22
1315
글번호 169991
지표
답변완료

문의

아래수식에 입력시간부터 발생한 봉부터 계산한다는 내용을 추가하여 주십시요. input : 입력시간(103000); ***************************************************************** var : v1(0,data1),v2(0,data1); var : SS(0),SS1(0),HH(0),HH1(0); v1 = ma(c,5); v2 = ma(c,20); if CrossDown(v1,v2) Then { SS = C; HH = H; SS1 = SS[1]; HH1 = HH[1]; if SS1 > 0 and HH1 >= SS1+1 Then Sell(); } Else { if HH > 0 and H > HH Then HH = H; }
프로필 이미지
좌오비우오비
2023-06-22
1199
글번호 169989
시스템
답변완료

3

안녕하세요 1.선물에서1분에서데이터가 들어올때 외국인 매수이면은 매수로진입 매도는반대로진입하는수식부탁합니다 앞에문의한수식은 아닌것같읍니다 2.위에수식에서 예을들어 매수에서 매도로바뀌면은 스위칭되는 수식도부탁합니다 감사합니다
프로필 이미지
질갱이
2023-06-22
1282
글번호 169981
시스템
답변완료

추세선박스 중간선

input : Period(250); Var:j(0),T(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); var : TL(0),TL1(0),TX(0),tl4(0),tl5(0),tl9(0); var : box(0),box1(0),txx(0); Array:HiVal[20](0),LoVal[20](0),HiBar[20](0),LoBar[20](0); Plot1(value12); 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]; date21 = date[HiBar[0]]; time21 = stime[HiBar[0]]; date22 = date[0]; time22 = stime[0]; box = box_new(date11,time11,Value11,date12,time12,Value12); tl = tl_new(date11,time11,(Value11+value12)/2,date12,time12,(Value11+value12)/2); } If LoVal[0] > L Then { LoVal[0] = L; LoBar[0] = 0; date12 = date[LoBar[0]]; time12 = stime[LoBar[0]]; Value12 = LoVal[0]; date22 = date[0]; time22 = stime[0]; Box_SetEnd(box,date12,time12,Value12); } TL_SetBegin(tl,date11,time11,(Value11+value12)/2); TL_SetEnd(tl,date12,time12,(Value11+value12)/2); if value12 > value11-0.7 Then { Box_SetColor(box,LCyan); Box_SetFill(box,true,20); } else if value12 <= value11-0.7 and value12 > value11-1 Then { Box_SetColor(box,Cyan); Box_SetFill(box,true,50); } else if value12 <= value11-1 and value12 > value11-1.7 Then { Box_SetColor(box,Cyan); Box_SetFill(box,true,40); } else { Box_SetColor(box,Yellow); Box_SetFill(box,true,30); } } 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]; date31 = date[LoBar[0]]; time31 = stime[LoBar[0]]; date32 = date[0]; time32 = stime[0]; box = box_new(date11,time11,Value11,date12,time12,Value12); tl = tl_new(date11,time11,(Value11+value12)/2,date12,time12,(Value11+value12)/2); } If HiVal[0] < H Then { HiVal[0] = H; HiBar[0] = 0; date12 = date[HiBar[0]]; time12 = stime[HiBar[0]]; Value12 = HiVal[0]; date32 = date[0]; time32 = stime[0]; Box_SetEnd(box,date12,time12,Value12); } TL_SetBegin(tl,date11,time11,(Value11+value12)/2); TL_SetEnd(tl,date12,time12,(Value11+value12)/2); if Value12 >= value11+1 Then { Box_SetColor(box,Magenta); Box_SetFill(box,true,20); } Else { Box_SetColor(box,Orange); Box_SetFill(box,true,20); } } 박스의 중앙선(50%) 라인에 추가로, 하락 박스는 아래로 61.8% 지점에, 상승 박스는 위로 61.8% 지점에 라인 추가 부탁드립니다.
프로필 이미지
고성
2023-06-22
1119
글번호 169980
지표
답변완료

잘 부탁드립니다

####1번지표 2번지표 하나의 지표로 부탁드립니다 ### 1번 input : n1(10),n2(21),obLevel1(60),obLevel2(53),osLevel1(-60),osLevel2(-53); var : ap(0),esa(0),dd(0),ci(0),tci(0),wt1(0),wt2(0),tx(0); ap = (h+l+c)/3 ; esa = ema(ap, n1); dd = ema(abs(ap - esa), n1); ci = (ap - esa) / (0.015 * dd); tci = ema(ci, n2); wt1 = tci; wt2 = ma(wt1,4); plot1(0,"0",GRAY); plot2(obLevel1,"obLevel1",red); plot3(osLevel1,"osLevel1",green); plot4(obLevel2,"obLevel2",red); plot5(osLevel2,"osLevel2",green); plot6(wt1,"wt1",green); plot7(wt2,"wt2",red); plot8(wt1-wt2,"wt1-wt2",blue); # 0선 아래 골드시 매수 if CrossUp(wt1,wt2) and wt1 < 0 Then { tx = text_new(sDate,sTime,L,"▲"); Text_SetStyle(tx,2,0); Text_SetColor(tx,Red); } 2번 input : RSI_Period(6),SF(5),QQE(3),ThreshHold(3); var : src(0),Wilders_Period(0),rsiv(0),rsima(0); var : AtrRsi(0),MaAtrRsi(0),dar(0); var : longband(0),shortband(0),trend(0); var : DeltaFastAtrRsi(0),RSIndex(0),newshortband(0),newlongband(0); var : cross_1(False),FastAtrRsiTL(0); src = close; Wilders_Period = RSI_Period * 2 - 1; Rsiv = rsi(RSI_Period); RsiMa = ema(Rsiv, SF); AtrRsi = abs(RsiMa[1] - RsiMa); MaAtrRsi = ema(AtrRsi, Wilders_Period); dar = ema(MaAtrRsi, Wilders_Period) * QQE; longband = 0.0; shortband = 0.0; trend = 0; DeltaFastAtrRsi = dar; RSIndex = RsiMa; newshortband = RSIndex + DeltaFastAtrRsi; newlongband = RSIndex - DeltaFastAtrRsi; longband = iff(RSIndex[1] > longband[1] and RSIndex > longband[1], max(longband[1], newlongband) , newlongband); shortband = iff(RSIndex[1] < shortband[1] and RSIndex < shortband[1], min(shortband[1], newshortband) , newshortband); cross_1 = crossup(longband[1], RSIndex) or CrossDown(longband[1], RSIndex); trend = iff(CrossUp(RSIndex, shortband[1]) or CrossDown(RSIndex, shortband[1]) , 1 , IFf(cross_1 , -1 , iff(isnan(trend[1]) == true, 1,trend[1]))); FastAtrRsiTL = iff(trend == 1 , longband , shortband); //////////////////// input : length(50),mult(0.35); var : basis(0),dev(0),upper(0),lower(0),color_bar(0); var : QQEzlong(0),QQEzshort(0); basis = ma(FastAtrRsiTL - 50, length); dev = mult * std(FastAtrRsiTL - 50, length); upper = basis + dev; lower = basis - dev; color_bar = iff(RsiMa - 50 > upper , Blue, IFf(RsiMa - 50 < lower , Red , gray)); // // Zero cross QQEzlong = 0; QQEzlong = iff(IsNan(QQEzlong[1]) == true,0,QQEzlong[1]); QQEzshort = 0; QQEzshort = iff(isnan(QQEzshort[1]) == true,0,QQEzshort[1]); QQEzlong = iff(RSIndex >= 50 , QQEzlong + 1 , 0); QQEzshort = iff(RSIndex < 50 , QQEzshort + 1 , 0); // PlotBaseLine1(0,"Zero",white); //////////////////////////////////////////////////////////////// input : RSI_Period2(6),SF2(5),QQE2(1.61),ThreshHold2(3); var : src2(0),Wilders_Period2(0),rsi2(0),rsima2(0); var : AtrRsi2(0),MaAtrRsi2(0),dar2(0); var : longband2(0),shortband2(0),trend2(0); var : DeltaFastAtrRsi2(0),RSIndex2(0),newshortband2(0),newlongband2(0); var : cross_2(False),FastAtrRsi2TL(0); var : QQE2zlong(0),QQE2zshort(0); var : hcolor2(0),Greenbar1(FalsE),Greenbar2(FalsE),Redbar1(False),Redbar2(False); src2 = close; Wilders_Period2 = RSI_Period2 * 2 - 1; Rsi2 = rsi(RSI_Period2); RsiMa2 = ema(Rsi2, SF2); AtrRsi2 = abs(RsiMa2[1] - RsiMa2); MaAtrRsi2 = ema(AtrRsi2, Wilders_Period2); dar2 = ema(MaAtrRsi2, Wilders_Period2) * QQE2; longband2 = 0.0; shortband2 = 0.0; trend2 = 0; DeltaFastAtrRsi2 = dar2; RSIndex2 = RsiMa2; newshortband2 = RSIndex2 + DeltaFastAtrRsi2; newlongband2 = RSIndex2 - DeltaFastAtrRsi2; longband2 = iff(RSIndex2[1] > longband2[1] and RSIndex2 > longband2[1] ,max(longband2[1], newlongband2) , newlongband2); shortband2 = iff(RSIndex2[1] < shortband2[1] and RSIndex2 < shortband2[1],min(shortband2[1], newshortband2), newshortband2); cross_2 = CrossUp(longband2[1], RSIndex2) or CrossDown(longband2[1], RSIndex2); trend2 = iff(CrossUp(RSIndex2, shortband2[1]) or CrossDown(RSIndex2, shortband2[1]) , 1 , iff(cross_2 , -1 , iff(isnan(trend2[1]) == False, 1,trend2[1]))); FastAtrRsi2TL = iff(trend2 == 1 , longband2 , shortband2); // Zero cross QQE2zlong = 0; QQE2zlong = iff(IsNan(QQE2zlong[1])==true,0,QQE2zlong[1]); QQE2zshort = 0; QQE2zshort = iff(isnan(QQE2zshort[1]),0,QQE2zshort[1]); QQE2zlong = iff(RSIndex2 >= 50 , QQE2zlong + 1 , 0); QQE2zshort = iff(RSIndex2 < 50 , QQE2zshort + 1 , 0); // hcolor2 = iff(RsiMa2 - 50 > ThreshHold2 ,silver ,IFf( RsiMa2 - 50 < 0 - ThreshHold2 , silver , White)); plot1(FastAtrRsi2TL - 50, "QQE Line", white); plot2(RsiMa2 - 50, "Histo2", hcolor2); Greenbar1 = RsiMa2 - 50 > ThreshHold2; Greenbar2 = RsiMa - 50 > upper; Redbar1 = RsiMa2 - 50 < 0 - ThreshHold2; Redbar2 = RsiMa - 50 < lower; if Greenbar1 and Greenbar2 == true Then plot3(RsiMa2 - 50, "QQE Up",ReD); else NoPlot(3); if Redbar1 and Redbar2 == true Then plot4(RsiMa2 - 50, "QQE Down",BluE); Else NoPlot(4);
프로필 이미지
매치다2
2023-06-22
771
글번호 169975
지표