커뮤니티
예스랭귀지 Q&A
답변완료
[공지] 예스랭귀지 AI 어시스턴트, '예스나 AI' 출시 및 무료 체험 안내
안녕하세요, 예스스탁 입니다.복잡한 수식 공부 없이 여러분의 아이디어를 말하면 시스템 트레이딩 언어 예스랭귀지로 작성해주는 서비스예스나 AI(YesNa AI)가 출시되었습니다.지금 예스나 AI를 직접 경험해 보실 수 있도록 20크레딧(질문권 20회)를 무료로 증정해 드리고 있습니다.바로 여러분의 아이디어를 코드로 변환해보세요.--------------------------------------------------🚀 YesNa AI 핵심 기능- 지표식/전략식/종목검색식 생성: 자연어로 요청하면 예스랭귀지 문법에 맞는 코드를 작성합니다.- 종목검색식 변환 지원: K증권의 종목 검색식을 예스랭귀지로 변환 지원합니다.- 컴파일 검증: 작성된 코드가 실행 가능한지 컴파일러를 통해 문법 검증을 거쳐 결과물을 제공합니다.상세한 서비스 개요 및 활용 방법은 [서비스 소개 페이지]에서 확인하실 수 있습니다.▶ 서비스 소개 페이지: 바로가기서비스 사용 유의사항 및 결제 환불정책은 [이용약관]을 참고 부탁드립니다.▶ 서비스 이용약관: 바로가기💬 이용 문의사용 중 문의사항은 [프로그램 사용법 Q&A] 게시판에서 [예스나 AI] 카테고리를 설정 후 문의해 주시면 상세히 안내해 드리겠습니다.--------------------------------------------------앞으로도 AI를 활용한 다양한 트레이딩 기능들을 지속적으로 선보일 예정입니다.많은 관심과 기대 부탁드립니다.
2026-02-27
1514
글번호 230811
답변완료
트레이딩뷰 linear regression channel 변환 부탁드립니다.
//@version=5indicator('Linear Regression Channel', overlay = true, max_lines_count = 3)// ---------------------------------------------------------------------------------------------------------------------}// 𝙐𝙎𝙀𝙍 𝙄𝙉𝙋𝙐𝙏𝙎// ---------------------------------------------------------------------------------------------------------------------{bool bands = input.bool(true, "Plot Linear Regression Bands", group = "Settings Bands")int window = input.int(150, "Length", group = "Settings Bands")float devlen_b = input.float(3., "Deviation Linear Regression Bands",step=0.1, group = "Settings Bands")bool channel = input.bool(false, "Plot Linear Regression Channel", group = "Settings Channel")int window1 = input.int(150, "Channel Length", group = "Settings Channel")float devlen1 = input.float(1., "Deviation Linear Regression Channel",step=0.1, group = "Settings Channel")bool channel1 = input.bool(false, "Plot Future Projection of linear regression", group = "Future Projection Channel")bool arr_dirc = input.bool(false, "Plot Arrow Direction", group = "Future Projection Channel")int window2 = input.int(50, "Length", group = "Future Projection Channel")float devlen2 = input.float(1., "Deviation Future Projection Regression Channel",step=0.1, group = "Future Projection Channel")// Define colors for up, down, and mid linescolor col_dn = #f01313color col_up = color.aquacolor col_mid = color.yellowcolor gray = color.graycolor fg_col = chart.fg_color// Regression Channel Arrays Linevar reglines = array.new_line(3)var reglines_ = array.new_line(3)// ---------------------------------------------------------------------------------------------------------------------}// 𝙄𝙉𝘿𝙄𝘾𝘼𝙏𝙊𝙍 𝘾𝘼𝙇𝘾𝙐𝙇𝘼𝙏𝙄𝙊𝙉𝙎// ---------------------------------------------------------------------------------------------------------------------{//@function linear_regression//@description Calculates linear regression coefficients for a given source and window.//@param src (series float) The data series on which linear regression is calculated.//@param window (int) The number of bars to use in the calculation.//@returns the intercept slope, Deviation, end of the channel.linear_regression(src, window) => sum_x = 0.0 sum_y = 0.0 sum_xy = 0.0 sum_x_sq = 0.0 // Calculate sums for i = 0 to window - 1 by 1 sum_x += i + 1 sum_y += src[i] sum_xy += (i + 1) * src[i] sum_x_sq += math.pow(i + 1, 2) // Calculate linear regression coefficients slope = (window * sum_xy - sum_x * sum_y) / (window * sum_x_sq - math.pow(sum_x, 2)) intercept = (sum_y - slope * sum_x) / window y1 = intercept + slope * (window - 1) dev = 0.0 for i = 0 to window - 1 dev := dev + math.pow(src[i] - (slope * (window - i) + intercept), 2) dev := math.sqrt(dev/window) [intercept, y1, dev, slope][y2, y1, dev, slope] = linear_regression(close, window)[y2_, y1_, dev_, slope_] = linear_regression(close, window1)[y2__, y1__, dev__, slope__] = linear_regression(close, window2)// Linear Regression Channel Linesseries float mid = y2 + slopeseries float upper = mid + ta.rma(high - low, window) * devlen_bseries float lower = mid - ta.rma(high - low, window) * devlen_b// Returns True for window length periodisAllowed = (last_bar_index - bar_index < window1)// ---------------------------------------------------------------------------------------------------------------------}// 𝙑𝙄𝙎𝙐𝘼𝙇𝙄𝙕𝘼𝙏𝙄𝙊𝙉// ---------------------------------------------------------------------------------------------------------------------{// Plot upper, lower, and mid lines if channel is not enabledp_u = plot(upper, color = bands and channel ? na : bands ? gray : na, linewidth = 2)p_l = plot(lower, color = bands and channel ? na : bands ? gray : na, linewidth = 2)p_m = plot(mid, color = bands and channel ? na : bands ? gray : na)// Fill areas between upper/mid and lower/mid linesfill(p_u, p_m, mid, upper, na, bands and channel ? na : bands ? color.new(col_up, 80) : na)fill(p_m, p_l, lower, mid, bands and channel ? na : bands ? color.new(col_dn, 80) : na, na)if barstate.islast and channel for i = 0 to 2 array.set(reglines, i, line.new(x1 = bar_index - (window1 - 1), y1 = y1_ + dev_ * devlen1 * (i - 1), x2 = bar_index, y2 = y2_ + dev_ * devlen1 * (i - 1), color = color.gray, style = i % 2 == 1 ? line.style_dashed : line.style_solid, width = 2, extend = extend.none) ) linefill.new(array.get(reglines, 1), array.get(reglines, 2), color = color.new(col_up, 90)) linefill.new(array.get(reglines, 1), array.get(reglines, 0), color = color.new(col_dn, 90))if barstate.islast and channel1 for i = 0 to 2 array.set(reglines_, i, line.new(x1 = bar_index - (window2 - 1), y1 = y1__ + dev__ * devlen2 * (i - 1), x2 = bar_index, y2 = y2__ + dev__ * devlen2 * (i - 1), color = color.gray, style = i % 2 == 1 ? line.style_dotted : line.style_dashed, width = 1, extend = extend.right) ) linefill.new(array.get(reglines_, 1), array.get(reglines_, 2), color = color.new(col_up, 95)) linefill.new(array.get(reglines_, 1), array.get(reglines_, 0), color = color.new(col_dn, 95))if arr_dirc l1 = label.new(chart.point.from_index(bar_index, hl2 > y2__ ? high : low), text = hl2 > y2__ ? "⇗" : hl2 < y2__ ? "⇘" : "⇒", textcolor = hl2 > y2__ ? col_up : hl2 < y2__ ? col_dn : gray, color = color(na), size = size.huge, style = label.style_label_left ) label.delete(l1[1])// Bar Heat Mapb_c = (close - lower) / (upper - lower)b_c := b_c > 1 ? 1 : b_c < 0 ? 0 : b_cbar_color = channel ? (isAllowed ? (b_c <= 0.5 ? color.from_gradient(b_c, 0, 0.5, col_up, col_mid) : color.from_gradient(b_c, 0.5, 1, col_mid, col_dn)) : na) : (b_c >= 0.5 ? color.from_gradient(b_c, 0.5, 1, col_mid, col_up) : color.from_gradient(b_c, 0, 0.5, col_dn, col_mid))plotcandle(open, high, low, close, title = "Bar HeatMap", color = bar_color, wickcolor = bar_color, bordercolor = bar_color )barcolor(bar_color)// Conditions for crossoverscondition1 = bands and channel ? na : bands ? ta.pivotlow(3, 3) and close < lower : nacondition2 = bands and channel ? na : bands ? ta.pivothigh(3, 3) and close > upper: na// Plot markers for channel break outsplotchar(condition1, "", "◆", size=size.tiny, location=location.belowbar, color = col_up)plotchar(condition2, "", "◆", size=size.tiny, location=location.abovebar, color = col_dn)// ---------------------------------------------------------------------------------------------------------------------}
2025-11-24
378
글번호 228352
haenoori 님에 의해서 삭제되었습니다.
2025-11-24
7
글번호 228348
답변완료
트레이딩뷰의 B-Xtrender 수식을 예스랭귀지로 변환 정중히 부탁드립니다. 감사합니다
//@version=4study("B-Xtrender @Puppytherapy")short_l1 = input(5 , title="Short - L1")short_l2 = input(20, title="Short - L2")short_l3 = input(15, title="Short - L3")long_l1 = input(20, title="Long - L1")long_l2 = input(15, title="Long - L2")shortTermXtrender = rsi(ema(close, short_l1) - ema(close, short_l2), short_l3 ) - 50longTermXtrender = rsi( ema(close, long_l1), long_l2 ) - 50shortXtrenderCol = shortTermXtrender > 0 ? shortTermXtrender > shortTermXtrender[1] ? color.lime : #228B22 : shortTermXtrender > shortTermXtrender[1] ? color.red : #8B0000plot(shortTermXtrender, color=shortXtrenderCol, style=plot.style_columns, linewidth=1, title="B-Xtrender Osc. - Histogram", transp = 50)t3(src, len)=> xe1_1 = ema(src, len) xe2_1 = ema(xe1_1, len) xe3_1 = ema(xe2_1, len) xe4_1 = ema(xe3_1, len) xe5_1 = ema(xe4_1, len) xe6_1 = ema(xe5_1, len) b_1 = 0.7 c1_1 = -b_1*b_1*b_1 c2_1 = 3*b_1*b_1+3*b_1*b_1*b_1 c3_1 = -6*b_1*b_1-3*b_1-3*b_1*b_1*b_1 c4_1 = 1+3*b_1+b_1*b_1*b_1+3*b_1*b_1 nT3Average_1 = c1_1 * xe6_1 + c2_1 * xe5_1 + c3_1 * xe4_1 + c4_1 * xe3_1 maShortTermXtrender = t3( shortTermXtrender , 5 )colShortTermXtrender = maShortTermXtrender > maShortTermXtrender[1] ? color.lime : color.redplot(maShortTermXtrender, color=#000000 , style=plot.style_line, linewidth=5, title="B-Xtrender Shadow")plot(maShortTermXtrender, color=colShortTermXtrender, style=plot.style_line, linewidth=3, title="B-Xtrender Color ")plotshape(maShortTermXtrender > maShortTermXtrender[1] and maShortTermXtrender[1] < maShortTermXtrender[2] ? maShortTermXtrender : na, location=location.absolute, style=shape.circle, color=color.lime, size=size.tiny, transp=10)plotshape(maShortTermXtrender < maShortTermXtrender[1] and maShortTermXtrender[1] > maShortTermXtrender[2] ? maShortTermXtrender : na, location=location.absolute, style=shape.circle, color=color.red , size=size.tiny, transp=10)longXtrenderCol = longTermXtrender> 0 ? longTermXtrender > longTermXtrender[1] ? color.lime : #228B22 : longTermXtrender > longTermXtrender[1] ? color.red : #8B0000macollongXtrenderCol = longTermXtrender > longTermXtrender[1] ? color.lime : color.redplot(longTermXtrender , color=longXtrenderCol, style=plot.style_histogram, linewidth=2, title="B-Xtrender Trend - Histogram", transp = 80)plot(longTermXtrender , color=#000000 , style=plot.style_line, linewidth=5, title="B-Xtrender Trend - Line", transp = 80)plot(longTermXtrender , color=macollongXtrenderCol, style=plot.style_line, linewidth=3, title="B-Xtrender Trend - Line", transp = 80)
2025-11-24
310
글번호 228347
haenoori 님에 의해서 삭제되었습니다.
2025-11-24
2
글번호 228346
답변완료
문의
이 식을 해석좀 해주셔요 전체적으로 다 궁금한데 특히 저항선과 지지선이 언제쯤 차트안에 그려지는지 궁금합니다. 마지막으로 지지저항선을 두껍게 하고 싶고, 저항선과지지선 종목검색식 부탁합니다.var : Period(20),Period1(60),Per(25),소수점자리(1),DARTno(7); var : T(0),HTL(0),HTL1(0),LTL(0),LTL1(0),cnt(0); var : tx1(0),tx2(0),HHTL(0),LLTL(0),TL(0); Array : HD[20](0),HT[20](0),HH[20](0); Array : LD[20](0),LT[20](0),LL[20](0); var : txx(0),txx1(0),tx(""); var1 = ma(C,Period); var2 = ma(C,Period1); if T <= 0 and CrossUp(var1,var2) Then { T = 1; For cnt = 19 DownTo 1 { HD[cnt] = HD[cnt-1]; HT[cnt] = HT[cnt-1]; HH[cnt] = HH[cnt-1]; } HD[0] = sDate; HT[0] = stime; HH[0] = H; TL_SetExtRight(HTL,False); HTL = TL_New(HD[0],HT[0],HH[0],NextBarSdate,NextBarStime,HH[0]); TL_SetColor(HTL,Red); TL_SetSize(HTL, 0); TL_SetStyle(HTL, 1); TL_SetExtRight(HTL,true); TL_SetDrawMode(HTL,0); HTL1 = HTL[1]; TL_SetEnd(HTL1,sDate[1],sTime[1],HH[1]); if hh[0] <= hh[1] Then tx = "▽ "+NumToStr(hh[0],2); Else tx = NumToStr(hh[0],2); txx = Text_New(sDate,sTime,hh[0],tx); Text_SetStyle(txx,2,1); txx1 = txx[1]; Text_SetLocation(txx1,sDate[1],sTime[1],HH[1]); } if T >= 0 and CrossDown(var1,var2) Then { T = -1; For cnt = 19 DownTo 1 { LD[cnt] = LD[cnt-1]; LT[cnt] = LT[cnt-1]; LL[cnt] = LL[cnt-1]; } LD[0] = sDate; LT[0] = stime; LL[0] = L; TL_SetExtRight(LTL,False); LTL = TL_New(LD[0],LT[0],LL[0],NextBarSdate,NextBarStime,LL[0]); TL_SetColor(LTL,Blue); TL_SetSize(LTL, 0); TL_SetStyle(LTL, 1); TL_SetExtRight(LTL,true); TL_SetDrawMode(LTL,0); LTL1 = LTL[1]; TL_SetEnd(LTL1,sDate[1],sTime[1],LL[1]); } if T == 1 Then { if HH[0] > 0 and H > HH[0] Then { HD[0] = sdate; HT[0] = sTime; HH[0] = H; TL_SetBegin(HTL,HD[0],HT[0],HH[0]); TL_SetEnd(HTL1,sDate[1],sTime[1],HH[1]); Text_SetLocation(txx1,sDate[1],sTime[1],HH[1]); } if hh[0] <= hh[1] Then tx = "▽ "+NumToStr(hh[0],2); Else tx = NumToStr(hh[0],2); Text_SetString(txx,tx); Text_SetLocation(txx,sDate,sTime,hh[0]); } TL_SetEnd(HTL,NextBarSdate,NextBarStime,HH[0]); if T == -1 Then { if LL[0] > 0 and L < LL[0] Then { LD[0] = sdate; LT[0] = sTime; LL[0] = L; TL_SetBegin(LTL,LD[0],LT[0],LL[0]); TL_SetEnd(LTL1,sDate[1],sTime[1],LL[1]); } } TL_SetEnd(LTL,NextBarSdate,NextBarStime,LL[0]); Plot1(var1,"이동평균선1"); Plot2(var2,"이동평균선2");
2025-11-24
157
글번호 228343
답변완료
부탁드립니다
무참조 60분봉의 5일선을 1분봉에 적용할때60분 마다 계단식으로 높낮이가 달라지는데요 그때 마다 수치표시좀 부탁드립니다
2025-11-24
107
글번호 228342
답변완료
문의
//@version=4study("Highest High, Lowest Low", shorttitle="HHLL", overlay=true)topPer = input(20, "Top Band Lookback Period")botPer = input(20, "Bot Band Lookback Period")maPer = input(20, "Moving Average Pereiod")topSrc = input(high)botSrc = input(low)top = highest(topSrc, topPer)bot = lowest(botSrc, botPer)plot(top, "Highest Band", #00ff00)plot(bot, "Lowest Band", #ff0000)plot(sma(close, maPer), "Moving Average", #00ffff)if close > top alert("Price Crossing Highest High")if close < bot alert("Price Crossing Lowest Low")예스로 부탁드립니다
2025-11-24
137
글번호 228338
답변완료
잘못을 찾아주세요 종목 검색시 누락이나 잘못된 결과가 나옵니다.
안녕하세요? 고생이 많으십니다. 조건 정하고 종목검색을 할 때, 조건이 과거 15봉 전에 만족한 것 까지 검색하고 싶습니다. 결과에는 만족한 이전 날짜를 붙이구요. 그래서 아래와 같이 검색을 했는데, 제가 원하는 상태의 조건이 검색되지 않습니다. 누락이 되기도 하고 엉뚱한 종목이 나오기도 합니다. 제가 뭘 잘못 했을까요? 해결을 부탁드립니다. Var : cond(false); cond = 조건1 ; /* ========= 0~15일 전 조건 출력 ========= */ If cond then Find(0); If cond[1] then Find(1); If cond[2] then Find(2); If cond[3] then Find(3); If cond[4] then Find(4); If cond[5] then Find(5); If cond[6] then Find(6); If cond[7] then Find(7); If cond[8] then Find(8); If cond[9] then Find(9); If cond[10] then Find(10); If cond[11] then Find(11); If cond[12] then Find(12); If cond[13] then Find(13); If cond[14] then Find(14); If cond[15] then Find(15);
2025-11-24
145
글번호 228337
답변완료
수식 부탁드립니다
항상 수고많으십니다 다음식 변환 부탁드립니다#############################M1=MA(C,기간1); //20M2=MA(C,기간2); //60LL=Lowestsince(1,crossdown(M1,M2),M1);M10<M240 && CROSSUP(C,LL)감사합니다
2025-11-24
136
글번호 228336