커뮤니티

예스랭귀지 Q&A

글쓰기
답변완료

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

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

문의 드립니다.

안녕하세요 항상 감사드립니다. 아래의 서식에서 추가 사항 부탁드립니다. *손절 조건 추가 1. 손절: 10pt 하락시 손절 2. 당일 손절 발생시 더 이상의 진입 금지 **조건 추가사항은 최적화를 할 수 있도록 input에 넣어주시기 바랍니다. # KOSPI 선물 5분봉 input: 당일진입횟수(3); Input: chkP(5), reChkP(10), stopChk(25); var: HH(0), LL(0), BS(0), SS(0); var: dayChk(0); var : TotalCount(0),PreDay(0),DayEntry(0); TotalCount = TotalTrades; if Bdate != Bdate[1] Then PreDay = TotalCount[1]; DayEntry = (TotalCount-PreDay)+IFF(MarketPosition != 0,1,0); if BarIndex == 0 then ClearDebug(); if dayindex == chkP then { HH = Highest(Max(C,O), chkP+1); LL = Lowest(Min(C,O), chkP+1); #if date == 20240612 then messageLog("--HH %.2f, LL: %.2f", HH, LL); } #if High >= HH and MarketPosition == 0 and ExitDate(1) < Date and time > 93000 then messageLog("HH %.2f, High: %.2f", HH, High); if DayIndex >= chkP # and Time < 95000 and sDate == NextBarSdate and EntryDate(0) < Date and EntryDate(1) < Date and DayEntry < 당일진입횟수 Then { Buy("B1", AtStop, HH); Sell("S1", AtStop, LL); } //if dayChk == 0 and High >= HH and MarketPosition == 0 and ExitDate(1) < Date and time > 93000 then { // messageLog("HH %.2f, High: %.2f", HH, High); // dayChk = 1; //} if ExitDate(1) == Date and Time < 150000 // and LatestEntryName(1) != "B2" // and LatestEntryName(1) != "S2" // and LatestEntryName(0) != "B2" // and LatestEntryName(0) != "S2" Then { if DayIndex < reChkP Then { HH = Highest(Max(C,O), DayIndex+1); LL = Lowest(Min(C,O), DayIndex+1); } Else { HH = Highest(Max(C,O), reChkP); LL = Lowest(Min(C,O), reChkP); } if DayEntry < 당일진입횟수 Then { Buy("B2", AtStop, HH); Sell("S2", AtStop, LL); } } if (MarketPosition == 1) Then { if DayIndex < stopChk Then { BS = Lowest(Min(C,O), DayIndex+1); } Else { BS = Lowest(Min(C,O), stopChk); } ExitLong("EL", AtStop, BS); } if (MarketPosition == -1) Then { if DayIndex < stopChk Then { SS = Highest(Max(C,O), DayIndex+1); } Else { SS = Highest(Max(C,O), stopChk); } #messageLog(" SS %.2f", SS); ExitShort("ES", AtStop, SS); } var : month(0),nday(0),week(0),X(False); month = int(date/100)-int(date/10000)*100; nday = date - int(date/100)*100; Week = DayOfWeek(date); #만기일 if (month%3 == 0 and nday >= 8 and nday <= 14 and week == 4) then { X = true; SetStopEndofday(151500); } Else#만기일아닐때 { X = False; SetStopEndofday(152000); }
프로필 이미지
가자아이
2025-05-29
314
글번호 191263
지표
답변완료

질문 부탁드립니다

추세선과 for 문 관련해서 부탁드립니다 첨부된 식 else 문에서 h>var25 인 경우가 하나도 없을 때 (ii==0) tr[0] 추세선의 시작점, 끝점, 가격값을 기존 값에서 (기존값: sd[6],st[6],aa[6],sd[3],st[3],aa[3]) 각각 +1 씩 변경한 식을 작성했는데요, (설명을 위한 예시로 작성한것 입니다) ii==0 인 상태에서 추세선 위치를 변경했을때 ii >1 이 될때까지 시작점,시작값은 기존값 +2로, 끝점,끝값은 기존값 +1로 변경하는 수식을 작성하고자 합니다. if문의 기존 추세선 값을 바꾸면 연동돼서 바뀌게 할 수 있을까요? 범위는 뒤로 3 회 까지(즉 3번째 변경 했을때의 시작점은 +6, 끝점은 +3) 로 부탁드립니다 (3회까지 했으나 ii>1 이 아니라면 원래값을 유지) 항상 감사드립니다 var : cnt(0), sum1(0), sumi1(0),summ(0),tt(0),hh(0),ll(0),tll(0),n(0),ae(0); var: sum2(0),sumi2(0),count(0),sumaa(0),sumai(0),avgaa(0); var : t(0),StartBarIndex(0),dd(0),d1(0),d2(0),e1(0),e2(0),ii(0); Array : aa[50](0),cc[50](0),ee[50](0),txt[40](0),txt1[20](0), tr[40](0),sd[45](0),st[45](0),ad[50](0),at[50](0); if Bdate != Bdate[1] Then { DD = DD+1; } if (h>l*1.08) and (d1 == 0 or (d1 > 0 and dd >= d1+5)) Then { d1 = dd; hh = h; var1 = Index; Var2 = var1[1]; Var3 = Var2[1]; sum1=0; sumi1=0; sum2=0; sumi2=0; tll=TL_NEW(sDate,sTime,100,sDate,sTime,999999); TL_SetSize(tll,0); TL_SetColor(tll,Gray); For cnt = 1 to (var1-Var2) { sum1=sum1+l[cnt]; sumi1=sumi1+1; } value1=sum1/sumi1; For cnt = 49 DownTo 1 { aa[cnt] = aa[cnt-1];sd[cnt] =sd[cnt-1];st[cnt] =st[cnt-1]; txt[cnt] = txt[cnt-1]; tr[cnt]=tr[cnt-1]; } aa[0] = value1; sd[0] = sDate; st[0] = sTime; TL_SetExtRight(tr[3],False); tr[0] = TL_New(sd[6],st[6],aa[6],sd[3],st[3],aa[3]);TL_SetDrawMode(tr[0],0); TL_Delete( tr[3]); TL_SetExtRight( tr[0],true); TL_SetColor(tr[0],DarkGreen); TL_SetColor(tr[4],Green); TL_SetColor(tr[5],LightGreen);TL_SetSize( tr[0],1); ii=0; } Else { Var25=TL_GetValue(tr[0],sDate,sTime); if h>=Var25 then { ii=ii+1; #plot24(ii,"test1",Orange,Def,1); } if ii==0 Then { TL_SetBegin(tr[0],sd[7],st[7],aa[7]); TL_SetEnd(tr[0],sd[4],st[4],aa[4]); } }
프로필 이미지
yamu
2025-05-29
344
글번호 191262
지표
답변완료

수식질문

아래 수식1, 수식2, 수식3을 논리합(or)조건으로 결합하여 하나의 조건식으로 만들어 주시기 바랍니다 수식1. var : A(0),value(0),Sum(0),ii(0),avgif(0),cnt(0), SumSqrt(0),Stdevif(0),B(0); Array : diff[500](0); A= ma(C,5); value=C-A; if IsNan(value) == False Then { if value < 0 Then {ii = ii + 1; diff[ii] = value; Sum = Sum + value; avgif = Sum/ii; } if ii >= 1 Then {SumSqrt = 0; For cnt = 1 To ii {SumSqrt=SumSqrt+(diff[cnt]-avgif)^2;} Stdevif=SquareRoot(SumSqrt/ii); B=A+avgif-2*Stdevif; if CrossDown(C,B) && C < O Then Find(1); }} 수식2. var : A(0),value(0),Sum(0),ii(0),avgif(0),cnt(0), SumSqrt(0),Stdevif(0),B(0); Array : diff[500](0); A= ma(C,10); value=C-A; if IsNan(value) == False Then { if value < 0 Then {ii = ii + 1; diff[ii] = value; Sum = Sum + value; avgif = Sum/ii; } if ii >= 1 Then {SumSqrt = 0; For cnt = 1 To ii {SumSqrt=SumSqrt+(diff[cnt]-avgif)^2;} Stdevif=SquareRoot(SumSqrt/ii); B=A+avgif-2*Stdevif; if CrossDown(C,B) && C < O Then Find(1); }} 수식3. var : A(0),value(0),Sum(0),ii(0),avgif(0),cnt(0), SumSqrt(0),Stdevif(0),B(0); Array : diff[500](0); A= ma(C,20); value=C-A; if IsNan(value) == False Then { if value < 0 Then {ii = ii + 1; diff[ii] = value; Sum = Sum + value; avgif = Sum/ii; } if ii >= 1 Then {SumSqrt = 0; For cnt = 1 To ii {SumSqrt=SumSqrt+(diff[cnt]-avgif)^2;} Stdevif=SquareRoot(SumSqrt/ii); B=A+avgif-2*Stdevif; if CrossDown(C,B) Then Find(1); }}
프로필 이미지
파크에버뉴
2025-05-29
324
글번호 191261
종목검색

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

프로필 이미지
yamu
2025-05-29
3
글번호 191260
지표
답변완료

감사합니다 지표 변환 부탁드립니다

// Settings //---------------------------------------------------------------------------------------------------------------------{ sp='&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;' res = input.timeframe ( '' , 'Period&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;' ) i1 = input.bool ( true , '' , inline='1', group='Swing Length') i2 = input.bool ( true , '' , inline='2', group='Swing Length') i3 = input.bool ( true , '' , inline='3', group='Swing Length') l1 = input.int (60, 'Long&#160;&#160;&#160;&#160;&#160;', minval=1, inline='1', group='Swing Length') l2 = input.int (30, 'Medium' , minval=1, inline='2', group='Swing Length') l3 = input.int (10, 'Short&#160;&#160;&#160;&#160;', minval=1, inline='3', group='Swing Length') cBull = input.color (#089981, 'Trendline'+sp, inline='d', group='Style' ) cBear = input.color (#f23645, '' , inline='d', group='Style' , tooltip = 'Bullish/Bearish Trendline' ) cWickBull = input.color (#085def, 'Wick Dot' +sp, inline='w', group='Style' ) cWickBear = input.color (#ff5d00, '' , inline='w', group='Style' , tooltip = 'Bullish/Bearish Wick' ) term = input.string('Long' , 'Term' , options =['Long' , 'Medium', 'Short' ] ) HHLL = input.string('None' , 'HH/LL' , options =['None','Only HH/LL','HH/LL & previous H/L']) bg = input.bool ( false , 'Background Color' ) cc = input.bool ( false , 'Bar Color' ) //---------------------------------------------------------------------------------------------------------------------} //LuxAlgo Defined Type //---------------------------------------------------------------------------------------------------------------------{ type bin line lin float slope bool active chart.point cp //---------------------------------------------------------------------------------------------------------------------} //Variables //---------------------------------------------------------------------------------------------------------------------{ lbi = last_bar_index n = bar_index INV = color(na) //---------------------------------------------------------------------------------------------------------------------} //Function //---------------------------------------------------------------------------------------------------------------------{ draw(toggle, res, left, right, pos) => ps = term == 'Long' ? 1 : term == 'Medium' ? 2 : 3 var int trend = 0 var chart.point prevPh = chart.point.from_index(na, na) var chart.point prevPl = chart.point.from_index(na, na) var bn = bin.new(line(na), 0, false) ph_ = ta.pivothigh(left, right), [tH, ph] = request.security(syminfo.tickerid, res, [time[2], ph_]) pl_ = ta.pivotlow (left, right), [tL, pl] = request.security(syminfo.tickerid, res, [time[2], pl_]) cH = ta.change(fixnan(ph)) cL = ta.change(fixnan(pl)) chH = cH != 0 and cL == 0 chL = cL != 0 and cH == 0 if toggle if bn.active if bn.lin.get_x2() - bn.lin.get_x1() > 5000 bn.active := false bn.lin.delete() else bn.lin.set_xy2(n, bn.lin.get_y2() + bn.slope) if chH v = 0. idx = 0 for i = 0 to 5000 Ti = time[i] if high[i] > v v := high[i] idx := i if Ti < tH break x = n - idx c = close[idx] if trend < 1 //HH if v > prevPh.price and x - prevPh.index > 5 and n - prevPl.index < 5000 if pos == ps and HHLL != 'None' label.new(x, v, color=color(na), text='HH₩n', size=size.tiny, textcolor=chart.fg_color) if HHLL == 'HH/LL & previous H/L' label.new(prevPh.index, prevPh.price, color=color(na), size=size.tiny, text='●', textcolor=chart.fg_color) trend := 1 bn := bin.new(line.new(prevPl.index, prevPl.price, n, prevPl.price, color=cBull , style= pos == 1 ? line.style_solid : pos == 2 ? line.style_dashed : line.style_dotted, width=pos == 1 ? 2 : 1) , 0, true, chart.point.from_index(prevPl.index, prevPl.price)) else //if bearish TL if bn.active slope = (v - bn.cp.price) / (x - bn.cp.index) //if line direction is down and wick breaks line or first LH if v < bn.lin.get_y1() + slope and (v > bn.lin.get_y2() + slope or bn.slope == 0) priceLin = bn.lin.get_price(n-idx) if c < priceLin //where wick breaks last line price if bn.slope != 0 label.new(n-idx, priceLin, style=label.style_label_center, text='●', color=color(na), textcolor=cWickBear) //First 업데이트 line bn.lin.set_xy2(n, v + slope*idx) //if first Swing after line conception if bn.slope == 0 //repeat until all close prices are below the line stop = false while not stop arr = array.new<float>() //check for inner-line breaks with close for i = 0 to n - bn.lin.get_x1() arr.push(close[i] - bn.lin.get_price(n-i)) highest_point = arr.max() //if yes, 업데이트 first point to highest point if highest_point > 0 ix = arr.indexof(highest_point) x1 = n-ix, y1 = high[ix] //label.new(x1, y1) bn.cp.index := x1 bn.cp.price := y1 slope := (v - y1) / (x - x1) bn.lin.set_xy2(n, v + slope*idx) bn.lin.set_xy1(x1, y1) bn.slope := slope else bn.lin.set_xy2(n, v + slope*idx) bn.slope := slope stop := true else bn.slope := slope else //if close price at Swing point breaks line bn.active := false prevPh.index := x prevPh.price := v else if trend < 1 if close > bn.lin.get_y2() bn.active := false if chL v = 10e6 idx = 0 for i = 0 to 5000 Ti = time[i] if low[i] < v v := low[i] idx := i if Ti < tL break x = n - idx c = close[idx] if trend >-1 //LL if v < prevPl.price and x - prevPl.index > 5 and n - prevPh.index < 5000 if pos == ps and HHLL != 'None' label.new(x, v, color=color(na), text='₩nLL', size=size.tiny, textcolor=chart.fg_color, style=label.style_label_up) if HHLL == 'HH/LL & previous H/L' label.new(prevPl.index, prevPl.price, color=color(na), size=size.tiny, text='●', textcolor=chart.fg_color, style=label.style_label_up) trend :=-1 bn := bin.new(line.new(prevPh.index, prevPh.price, n, prevPh.price, color=cBear , style= pos == 1 ? line.style_solid : pos == 2 ? line.style_dashed : line.style_dotted, width=pos == 1 ? 2 : 1) , 0, true, chart.point.from_index(prevPh.index, prevPh.price)) else //if bullish TL if bn.active slope = (v - bn.cp.price) / (x - bn.cp.index) //if line direction is up and wick breaks line or first HL if v > bn.lin.get_y1() + slope and (v < bn.lin.get_y2() + slope or bn.slope == 0) priceLin = bn.lin.get_price(n-idx) if c > priceLin //where wick breaks last line price if bn.slope != 0 label.new(n-idx, priceLin, style=label.style_label_center, text='●', color=color(na), textcolor=cWickBull) //First 업데이트 line bn.lin.set_xy2(n, v + slope*idx) //if first Swing after line conception if bn.slope == 0 //repeat until all close prices are above the line stop = false while not stop arr = array.new<float>() //check for inner-line breaks with close for i = 0 to n - bn.lin.get_x1() arr.push(bn.lin.get_price(n-i)-close[i]) deepest_point = arr.max() //if yes, 업데이트 first point to deepest point if deepest_point > 0 ix = arr.indexof(deepest_point) x1 = n-ix, y1 = low[ix] bn.cp.index := x1 bn.cp.price := y1 slope := (v - y1) / (x - x1) bn.lin.set_xy2(n, v + slope*idx) bn.lin.set_xy1(x1, y1) bn.slope := slope else bn.lin.set_xy2(n, v + slope*idx) bn.slope := slope stop := true else bn.slope := slope else //if close price at Swing point breaks line bn.active := false prevPl.index := x prevPl.price := v else if trend >-1 if close < bn.lin.get_y2() bn.active := false [trend, bn.lin.get_y2()] //---------------------------------------------------------------------------------------------------------------------} //실행 //---------------------------------------------------------------------------------------------------------------------{ [trend1, value1] = draw(i1, res, l1, 1, 1) [trend2, value2] = draw(i2, res, l2, 1, 2) [trend3, value3] = draw(i3, res, l3, 1, 3) col = color(na) if cc col := switch close > value1 true => switch close > value2 true => if close > value3 color.new(cBull, 20) else color.new(cBull, 43) => if close > value3 color.new(cBull, 66) else color.new(cBull, 89) => switch close < value2 true => if close < value3 color.new(cBear, 20) else color.new(cBear, 43) => if close < value3 color.new(cBear, 66) else color.new(cBear, 89) //---------------------------------------------------------------------------------------------------------------------} //Plot - Bar/Background Color //---------------------------------------------------------------------------------------------------------------------{ plot(value1, display=display.none) plot(value2, display=display.none) plot(value3, display=display.none) plot(trend1, display=display.none) barcolor(cc ? col : na) //Background color - close above/below value1-2-3 isValid = bg and (term == 'Long' ? i1 : term == 'Medium' ? i2 : i3) bgcolor(isValid ? color.new(close > (term == 'Long' ? value1 : term == 'Medium' ? value2 : value3) ? cBull : cBear, 97) : na)
프로필 이미지
갈랑교
2025-05-28
552
글번호 191259
지표
답변완료

수식변환요청

다음수식 변환 부탁드립니다 A=(C-C(1))/C(1)*100>=10; B=V>=Highest(V,기간); S1=A && B; M1=ma(C,period); SS=ValueWhen(1,S1,M1); C>SS && O< SS 감사합니다
프로필 이미지
김승빈
2025-05-28
306
글번호 191258
종목검색
답변완료

도움 부탁드립니다

안녕하세요 분봉이나 틱봉에 적용하고자 합니다. 2가지 방식의 검색식 부탁드립니다. 1. 15분 시가선이 있고 시가선위에 캔들이 있을때 빨강색 원표시 15분 시가선이 있고 시가선아래에 캔들이 있을때 파랑색 원표시 2. 15분 시가선이 있고 5이평선이 시가선을 크로스업 했을때 빨강색 원표시 15분 시가선이 있고 5이평선이 시가선을 크로스다운 했을때 파랑색 원표시 * 15분과 이평은 변수로 부탁드립니다.
프로필 이미지
라몬
2025-05-28
287
글번호 191257
검색
답변완료

수식 부탁 드립니다

볼린져 밴드 하단 터치후 양봉 발생시 매수 중심선 터치후 음봉 발생시 매수청산 또는 볼린져밴드 상단터치후 음봉 발생시 매수청산 볼린져 밴드 상단 터치후 음봉발생시 매도 중심선 터치후 양봉 발생시 매도청산 또는 볼린져 밴드 하단터치후 양봉 발생시 매도청산 첨부파일 변수값으로 작성 부탁 드립니다
프로필 이미지
kortp119
2025-05-28
281
글번호 191256
시스템
답변완료

검색식 문의 드립니다!

트레이딩뷰에서 사용되던 알파트렌드라는 지표를 검색하는 검색식인데요. 이 식은 사진처럼 파란선이 빨간선 위로 골든 나올때 검색하는 식입니다. 일단 식을 올리자면 input : coeff(1); input : AP(14); input : novolumedata(1);#1:true, 0:False var : atrv(0),src(0),upt(0),downt(0),AlphaTrend(0); var : buySignalk(False),sellSignalk(False),조건(False); ATRv = ma(TrueRange, AP); src = close; upT = low - ATRv * coeff; downT = high + ATRv * coeff; Condition1 = False; if novolumedata == 1 and rsi(AP) >= 50 Then Condition1 = true; if novolumedata == 0 and MFI(AP) >= 50 Then Condition1 = true; AlphaTrend = iff(Condition1 , IFf(upT < iff(isnan(AlphaTrend[1])==true,0,AlphaTrend[1]), iff(isnan(AlphaTrend[1])==true,0,AlphaTrend[1]) , upT),IFf(downT > iff(isnan(AlphaTrend[1])==true,0,AlphaTrend[1]) , iff(isnan(AlphaTrend[1])==true,0,AlphaTrend[1]) , downT)); 조건=AlphaTrend>AlphaTrend[2]; IF 조건 && !조건[1] && C>AlphaTrend && RSI(AP)>50 TheN Find(1); 여거 이구요 제가 변경하고픈 방식의 검색식은 다른 사진처럼 파란선이 계속 상승이면서 차트상 캔들이 음봉일때를 검색하고픈데 가능할까요? 바쁘신데 항상 감사합니다!
프로필 이미지
수지성
2025-05-28
312
글번호 191253
검색