커뮤니티

예스랭귀지 Q&A

글쓰기

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

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

수정 부탁드립니다.

mvar1 = Sarv+(AF_value)*(EP-SAR_Value); mvar2 = Max(mvar1,EntryPrice-EntryATR*ATr1);#최대손실폭이 약100p줄어듬 mvar3 = Min(mvar1,EntryPrice+ EntryATR*ATr2);#최대손실폭이 약100p줄어듬#매수진입후 파라볼릭 매도구간에 들어가면 즉시 청산 if marketPosition == 1 and Direction == 1 Then { Exitlong("bx1",AtStop,mvar2); 이식이 파라볼릭과 atr을 이용한 손절도 되지만 익절도 하는 식인가요?
프로필 이미지
산수유
2026-01-23
105
글번호 230008
시스템
답변완료

시스템 수식 검증

아래 수식 들을 검증 부탁 드립니다.특히 중괄호 부분들이 잘 되어 있는지 검토 부탁드립니다.[수식1]input : 시작일(20260101),시작시간(090000);input : 이평1(180),이평2(15);input : 윌리엄스R기간값(14);input : 손절틱수(100),목표틱수(200),트레일링스탑틱수(100);var : mav1(0),WR(0);if sdate >= 시작일 and sTime >= 시작시간 Then{Condition1 = true;Condition2 = true;}MAV1 = MA(c,이평1);WR = WILLR(윌리엄스R기간값);if TotalTrades > TotalTrades and IsExitName("StopLoss",1) ==true ThenCondition2 = False;if Condition1 == true and Condition2 == true Then{if MarketPosition == 0 and c < mav1 and CrossDown(WR, -20) ThenSell("s");if MarketPosition == -1 Then{if lowest(L,BarsSinceEntry) <= EntryPrice-PriceScale*목표틱수 ThenExitShort("str",AtStop,EntryPrice-PriceScale*트레일링스탑틱수);}SetStopLoss(PriceScale*손절틱수,PointStop);}[수식2]input : 시작일(20260101),시작시간(090000);input : 이평1(180),이평2(15);input : 윌리엄스R기간값(14);input : 손절틱수(100),목표틱수(200),트레일링스탑틱수(100);var : mav1(0),WR(0);if sdate >= 시작일 and sTime >= 시작시간 Then{Condition1 = true;Condition2 = true;}MAV1 = MA(c,이평1);WR = WILLR(윌리엄스R기간값);if TotalTrades > TotalTrades and IsExitName("StopLoss",1) ==true ThenCondition2 = False;if Condition1 == true and Condition2 == true Then{if MarketPosition == 0 and c > mav1 and CrossUP(WR, -80) ThenBuy("b");if MarketPosition == 1 Then{if highest(H,BarsSinceEntry) >= EntryPrice+PriceScale*목표틱수 Then ExitLong("btr",AtStop,EntryPrice+PriceScale*트레일링스탑틱수); }SetStopLoss(PriceScale*손절틱수,PointStop);}[수식3]input : 시작일(20260101),시작시간(090000);input : 이평1(30);input : 윌리엄스R기간값(90);input : 손절틱수(140),청산틱수(240);var : mav1(0),WR(0);if sdate >= 시작일 and sTime >= 시작시간 Then{ Condition1 = true; Condition2 = true;}MAV1 = MA(c,이평1);WR = WILLR(윌리엄스R기간값);if TotalTrades > TotalTrades and IsExitName("StopLoss",1) ==true Then Condition2 = False;if Condition1 == true and Condition2 == true Then{ if MarketPosition == 0 and CrossUP(WR, -80) Then Buy("b"); if MarketPosition == 1 Then { if highest(H,BarsSinceEntry) >= EntryPrice+PriceScale*청산틱수 Then if CrossDown(C,mav1) Then ExitLong("bx"); } SetStopLoss(PriceScale*손절틱수,PointStop);}[수식4]input : 시작일(20260101),시작시간(090000);input : 이평1(30);input : 윌리엄스R기간값(90);input : 손절틱수(140),청산틱수(240);var : mav1(0),WR(0);if sdate >= 시작일 and sTime >= 시작시간 Then{ Condition1 = true; Condition2 = true;}MAV1 = MA(c,이평1);WR = WILLR(윌리엄스R기간값);if TotalTrades > TotalTrades and IsExitName("StopLoss",1) ==true Then Condition2 = False;if Condition1 == true and Condition2 == true Then{ if MarketPosition == 0 and CrossDown(WR, -20) Then Sell("s");}if MarketPosition == -1 Then{ if lowest(L,BarsSinceEntry) <= EntryPrice-PriceScale*청산틱수 Then if CrossUp(C,mav1) Then ExitShort("sx"); }SetStopLoss(PriceScale*손절틱수,PointStop);[수식5]input : 시작일(20251101),시작시간(090000);input : 이평1(30),이평2(240);input : 손절틱수(150),청산틱수(300);var : mav1(0),mav2(0);if sdate >= 시작일 and sTime >= 시작시간 Then{Condition1 = true;Condition2 = true;}MAV1 = MA(c,이평1);MAV2 = MA(c,이평2);if TotalTrades > TotalTrades and IsExitName("StopLoss",1) ==true ThenCondition2 = False;if Condition1 == true and Condition2 == true Then{if MarketPosition == 0 and CrossDown(c, mav1) ThenSell("s");if MarketPosition == 1 Then{if highest(H,BarsSinceEntry) <= EntryPrice+PriceScale*청산틱수 Thenif CrossDown(C,mav2) ThenExitLong("sx"); } SetStopLoss(PriceScale*손절틱수,PointStop);}[수식6]input : 시작일(20251101),시작시간(090000);input : 이평1(30),이평2(240);input : 손절틱수(150),청산틱수(300);var : mav1(0),mav2(0);if sdate >= 시작일 and sTime >= 시작시간 Then{Condition1 = true;Condition2 = true;}MAV1 = MA(c,이평1);MAV2 = MA(c,이평2);if TotalTrades > TotalTrades and IsExitName("StopLoss",1) ==true ThenCondition2 = False;if Condition1 == true and Condition2 == true Then{if MarketPosition == 0 and CrossUp(c, mav1) ThenBuy("b");if MarketPosition == 1 Then{if highest(H,BarsSinceEntry) >= EntryPrice+PriceScale*청산틱수 Thenif CrossDown(C,mav2) ThenExitLong("bx"); } SetStopLoss(PriceScale*손절틱수,PointStop);}[수식7]input : 시작일(20260101),시작시간(090000);input : 이평1(180),이평2(15);input : 윌리엄스R기간값(14);input : 손절틱수(100),목표틱수(200),트레일링스탑틱수(100);var : mav1(0),WR(0);if sdate >= 시작일 and sTime >= 시작시간 Then{Condition1 = true;Condition2 = true;}MAV1 = MA(c,이평1);WR = WILLR(윌리엄스R기간값);if TotalTrades > TotalTrades and IsExitName("StopLoss",1) ==true ThenCondition2 = False;if Condition1 == true and Condition2 == true Then{if MarketPosition == 0 and c < mav1 and CrossDown(WR, -20) ThenSell("s");if MarketPosition == -1 Then{if lowest(L,BarsSinceEntry) <= EntryPrice-PriceScale*목표틱수 ThenExitShort("str",AtStop,EntryPrice-PriceScale*트레일링스탑틱수);}SetStopLoss(PriceScale*손절틱수,PointStop);}[수식8]input : 시작일(20260101),시작시간(090000);input : 이평1(180),이평2(15);input : 윌리엄스R기간값(14);input : 손절틱수(100),목표틱수(200),트레일링스탑틱수(100);var : mav1(0),WR(0);if sdate >= 시작일 and sTime >= 시작시간 Then{Condition1 = true;Condition2 = true;}MAV1 = MA(c,이평1);WR = WILLR(윌리엄스R기간값);if TotalTrades > TotalTrades and IsExitName("StopLoss",1) ==true ThenCondition2 = False;if Condition1 == true and Condition2 == true Then{if MarketPosition == 0 and c > mav1 and CrossUP(WR, -80) ThenBuy("b");if MarketPosition == 1 Then{if highest(H,BarsSinceEntry) >= EntryPrice+PriceScale*목표틱수 Then ExitLong("btr",AtStop,EntryPrice+PriceScale*트레일링스탑틱수); }SetStopLoss(PriceScale*손절틱수,PointStop);}이상입니다.수고하세요..
프로필 이미지
블루3
2026-01-23
359
글번호 230007
시스템
답변완료

수고하십니다

항상 좋은 일만 있으시기 바랍니다psar지표를 연결psar로 색상을변경 요청 합니다현재는 음구간청색 양구간적색인데직전구간고가첫점을 돌파 하지 않으면 음구간 청색유지직전구간저가첫점을 이탈 하지 않으면 양구간 적색유지하게 색상을 변경 요청 합니다
프로필 이미지
2wnwn
2026-01-23
106
글번호 230006
지표
답변완료

경과봉 조정

아래수식은 국내지수선물데이트레이딩 수식입니다.진입명 b1,b2로 2회 거래합니다.요청사항b2진입시 경과봉 필터가 있습니다.이 경과봉에 조건을 하나 추가하고 싶습니다.기존 경과봉은 그대로 수행됩니다.단, b1이 트레일링스탑으로 포지션이 청산되었을 경우b2의 기존 경과봉이 새로운 경과봉으로 조정되는 수식입니다.ex)input : 경과봉(150), 조정경과봉(200),b2(1),진입눌림2(0),진입돌파2(0);항상 고맙습니다.****************************************************************************************************************************input : 진입시간(084500),진입제한시간(150000);input : 거래횟수(2),누적패수(2),연속패수(2),누적패수조정(2);input : b1(1),진입눌림1(0),진입돌파1(0);input : 경과봉(150),b2(1),진입눌림2(0),진입돌파2(0);input : als(21),atr1(0),atr2(999999);input : bls(40),btr1(0),btr2(999999);var : T1(0),entry(0),LL(0),EH(0),E1(0),H1(0),i1(0),S1(0),L1(0),V1(0);var : Tcond(false);var : loss(0),consecLoss(0),패수(0);//영업일변경if bdate != bdate[1] Then{//손실횟수 초기화 0loss = 0;//연속손실횟수 초기화 0consecLoss = 0;//패수는 누적패수패수 = 누적패수;}//청산발생if TotalTrades > TotalTrades[1] Then{//손실이면if PositionProfit(1) < 0 Then{//loss 1씩 증가loss = loss+1;//consecLoss 1씩 증가consecLoss = consecLoss+1;//consecLoss이 3이면 패수를 누적패수에서 누적패수조정으로 변경if consecLoss == 연속패수 Then{패수 = 누적패수조정;}}Else //손실이 아니면 consecLoss으로 초기화consecLoss = 0;}if (sdate != sdate[1] and stime >= 진입시간) or (sdate == sdate[1] and stime >= 진입시간 and stime[1] < 진입시간) Then Tcond = true; if (sdate != sdate[1] and stime >= 진입제한시간) or (sdate == sdate[1] and stime >= 진입제한시간 and stime[1] < 진입제한시간) Then Tcond = false; if (sdate != sdate[1] and stime >= 진입시간) or (sdate == sdate[1] and stime >= 진입시간 and stime[1] < 진입시간) Then{ T1 = TotalTrades; E1 = 0; LL = L;}if stime >= 진입시간 then{ if L < LL Then LL = L; if MarketPosition == 0 Then entry = TotalTrades-T1; Else entry = (TotalTrades-T1)+1; if MarketPosition == 0 and entry == 0 Then{ if E1 == 0 and C >= LL+PriceScale*B1 Then{ E1 = 1; H1 = H; i1 = index; V1 = LL; //시작점 종가 } if E1 == 1 and index > i1 then{ if H > H1 Then H1 = H; #저가가 시작봉종가보다 클때만 눌림체크 if L >= V1 and L <= H1-PriceScale*진입눌림1 Then{ E1 = 2; i1 = index; S1 = H1; } } //시작점 종가보다 낮은 가격이 발생하면 초기화 if E1 >= 1 and L < V1 Then{ E1 = 0; LL = L; } if loss < 패수 and E1 == 2 and index > i1 and C >= S1+PriceScale*진입돌파1 and Tcond == true Then{ buy("b1"); } } if TotalTrades > TotalTrades[1] Then{ E1 = 0; LL = L; } if L < LL Then LL = L; if MarketPosition == 0 and entry >= 1 and entry < 거래횟수 Then{ if E1 == 0 and C >= LL+PriceScale*B2 Then{ E1 = 1; H1 = H; i1 = index; V1 = LL; //시작점 종가 } if E1 == 1 and index > i1 then{ if H > H1 Then H1 = H; #저가가 시작봉종가보다 클때만 눌림체크 if L >= V1 and L <= H1-PriceScale*진입눌림2 Then{ E1 = 2; i1 = index; S1 = H1; } } //시작점 종가보다 낮은 가격이 발생하면 초기화 if E1 >= 1 and L < V1 Then{ E1 = 0; LL = L; } if loss < 패수 and (TotalTrades == 0 or (TotalTrades >= 1 and BarsSinceExit(1) > 경과봉)) and loss < 누적패수 and E1 == 2 and index > i1 and C >= S1+PriceScale*진입돌파2 and Tcond == true Then{ buy("b2"); } }}if MarketPosition== 1 Then{ if IsEntryName("b1") == true Then { SetStopLoss(PriceScale*als,PointStop); SetStopTrailing(PriceScale*atr2,PriceScale*atr1,PointStop,1); } Else if IsEntryName("b2") == true Then { SetStopLoss(PriceScale*bls,PointStop); SetStopTrailing(PriceScale*btr2,PriceScale*btr1,PointStop,1); } Else { SetStopLoss(0);SetStopTrailing(0,0); }}
프로필 이미지
목마와숙녀
2026-01-23
278
글번호 230004
시스템
답변완료

수정을 부탁드립니다.

안녕하세요?아래 수식중 Plot1, Plot17 "당일매수거래량을 0을 기준으로 RGB를 표기하도록 되어있는데요이것을 피보나티비울 50% 기준으로 추가하거나 수정해 주세요늘 도와주심에 감사드립니다.오늘 남은시간도 즐거운시간되세요===========================input : Change(500), 캔들수(-12);var : HH(0),LL(0);var : HD(0),HT(0),HV(0);var : LD(0),LT(0),LV(0);var : UpTrend(false),DownTrend(False),Trend(0);var : TX1(0),TX2(0),TX3(0),TX4(0);if Bdate != Bdate[1] Then{ var1 = 0; Var2 = Upvol-DownVol;}var1 = var1 + (Upvol-DownVol);if Bdate != Bdate[1] Then{ HD = sDate; HT = sTime; HV = var1; LD = sDate; LT = sTime; LV = var1; trend = 0; if CurrentDate == sDate Then { tx1 = Text_New_Self(HD,HT,HV,"----------------"); Text_SetStyle(tx1,2,0); Text_SetColor(tx1,Magenta); tx3 = Text_New(HD,HT,H,"고----------------"); Text_SetStyle(tx3,2,0); Text_SetColor(tx3,Magenta); tx2 = Text_New_Self(LD,LT,LV,"----------------"); Text_SetStyle(tx2,2,0); Text_SetColor(tx2,blue); tx4 = Text_New(LD,LT,L,"저----------------"); Text_SetStyle(tx4,2,0); Text_SetColor(tx4,blue); } hh = var1; ll = var1;}Else{ if var1 > hh Then hh = var1; if var1 < ll Then ll = var1; UpTrend = var1 >= LV[0]+Change; DownTrend = var1 <= HV[0]-Change; if trend <= 0 and UpTrend == true Then { trend = 1; HD = sDate; HT = sTime; HV = var1; if CurrentDate == sDate Then { tx1 = Text_New_Self(HD,HT,HV,"----------------"); Text_SetStyle(tx1,2,0); Text_SetColor(tx1,Magenta); tx3 = Text_New(HD,HT,H,"----------------"); Text_SetStyle(tx3,2,0); Text_SetColor(tx3,Magenta); } } Else if trend >= 0 and DownTrend Then { trend = -1; LD = sDate; LT = sTime; LV = var1; if CurrentDate == sDate Then { tx2 = Text_New_Self(LD,LT,LV,"----------------"); Text_SetStyle(tx2,2,0); Text_SetColor(tx2,blue); tx4 = Text_New(LD,LT,L,"----------------"); Text_SetStyle(tx4,2,0); Text_SetColor(tx4,blue); } } Else { if trend == 1 Then { if var1 > HV Then { HD = sDate; HT = sTime; HV = var1; if CurrentDate == sDate Then { Text_SetLocation(TX1,HD,HT,HV); Text_SetLocation(TX3,HD,HT,H); } } } if trend == -1 Then { if var1 < LV Then { LD = sDate; LT = sTime; LV = var1; if CurrentDate == sDate Then { Text_SetLocation(TX2,LD,LT,LV); Text_SetLocation(TX4,LD,LT,L); } } } if trend == 0 Then { if var1 > HV Then { HD = sDate; HT = sTime; HV = var1; if CurrentDate == sDate Then { Text_SetLocation(TX1,HD,HT,HV); Text_SetLocation(TX3,HD,HT,H); } } if var1 < LV Then { LD = sDate; LT = sTime; LV = var1; if CurrentDate == sDate Then { Text_SetLocation(TX2,LD,LT,LV); Text_SetLocation(TX4,LD,LT,L); } } } }} if CurrentDate == sDate Then{ Plot1(var1,"당일실매수거래량",iff(var1 > 0,RGB(200,0,0),RGB(0,0,0))); FixPlotShift(1,캔들수); Plot17(var1,"당일실매수거래량2",iff(var1 > 0,RGB(255,0,0),RGB(0,0,255))); Plot3(hh,"최고"); plot4(ll,"최저"); plot5(ll+(hh-ll)*0.25,"25.0%"); plot6(ll+(hh-ll)*0.382,"38.2%"); plot7(ll+(hh-ll)*0.500,"50.0%"); plot8(ll+(hh-ll)*0.505,"50.05%"); plot9(ll+(hh-ll)*0.515,"51.5%"); plot10(ll+(hh-ll)*0.495,"49.5%"); plot13(ll+(hh-ll)*0.485,"48.5%"); plot14(ll+(hh-ll)*0.618,"61.8%"); plot15(ll+(hh-ll)*0.75,"75.0%"); plot18(ll+(hh-ll)*0.125,"12.5%"); plot19(ll+(hh-ll)*0.875,"87.5%"); plot20(ll+(hh-ll)*0.127,"12.7%"); plot21(ll+(hh-ll)*0.877,"87.7%"); plot22(ll+(hh-ll)*0.755,"75.5%"); plot23(ll+(hh-ll)*0.255,"25.5%"); plot40((Var2/2),"첫봉종가50%");} if CurrentDate == sDate Then{ PlotBaseLine2(1000); PlotBaseLine3(500); PlotBaseLine4(100); } PlotBaseLine1(0);
프로필 이미지
포보스
2026-01-22
281
글번호 230002
지표
답변완료

종목 검색식 부탁드립니다.

항상 고맙고 감사 드립니다.양봉캔들이 1.Envelope저항선 돌파 2.캔들이동평균선 5일선 돌파-3.캔들볼린저 상단선돌파 정배열종목 검색 수식어 부탁드립니다.1.볼린저 상단선 수식-BBandsUp(Period,D1)지표조건설정-Period 30 D1-1.52.가격이동평균선 5일선3.Envelope 수식-저항선 EnvelopeUp(Period,Percent)지표조건설정-Period 20 Percent 5
프로필 이미지
치치야
2026-01-22
143
글번호 230001
종목검색
답변완료

수식 요청드립니다.

안녕하세요. 피라미딩으로 누적 5계약까지 매수 또는 매도 진입 후 청산조건이 달성되면 한번에 청산이 되는 시스템을 운용하고 있습니다.위와 같은 시스템에다가 청산 후 20분간은 재진입되지 않도록 하는 조건식을 추가하고자 합니다.청산 후 20분간은 재진입되지 않도록 하는 수식을 부탁드립니다. 감사합니다.
프로필 이미지
트레이더365
2026-01-22
97
글번호 230000
시스템
답변완료

수식추가

안녕하세요, 전일봉의 영향을 배제(즉 당일봉)으로 아래의 조건을 유지하려면 어떤 수식을 추가해야하나요?var : HH(0),HL(0);if Data1(DayOpen) >= Data2(DayOpen) Then HH=(Data1(-DayOpen+C)+Data2(-DayOpen+C)*Data1(dayopen)/Data2(DayOpen)) ;Else HL= (Data1(-DayOpen+C)*Data2(DayOpen)/Data1(DayOpen)+Data2(-DayOpen+C))=HL ;If ( HH<0 or HL<0) then buy("P1",onclose);감사합니다.
프로필 이미지
huhboo99
2026-01-22
108
글번호 229999
시스템
답변완료

조건검색 문의

//@version=5indicator("신호 변환: 고가 돌파 시스템", overlay=true)// 1. 변수 설정shin = high - lowho = math.max(close, open) - low// 2. 조건 설정 (분모가 0이 되는 것을 방지하기 위해 ho > 0 체크 추가)// 조건: (전체길이/몸통상단-저가 > 2) AND (당일 고가가 전일 종가 대비 15% 이상 상승)cond = (ho > 0 ? (shin / ho > 2) : false) and (high / close[1] > 1.15)// 3. 기준선 설정 (valuewhen 구현)var float base_line = naif cond base_line := high// 4. 신호 발생 (종가가 기준선을 상향 돌파할 때)signal = ta.crossover(close, base_line)// --- 시각화 ---// 기준선 그리기 (조건이 발생한 적이 있을 때만 표시)plot(base_line, title="기준선", color=color.new(color.gray, 50), style=plot.style_linebr, linewidth=2)// 돌파 신호 표시plotshape(series=signal, title="신호 발생", style=shape.triangleup, location=location.belowbar, color=color.red, size=size.small, text="돌파")// (옵션) 조건이 만족된 캔들 강조 표시 (노란색)bgcolor(cond ? color.new(color.yellow, 80) : na)일봉상 위 신호가 발생한 모든 종목을 검출할 수 있도록 해주시면 감사드리겠습니다 (__)
프로필 이미지
사공하늘
2026-01-22
285
글번호 229990
검색