커뮤니티

예스랭귀지 Q&A

글쓰기
답변완료

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

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

잘 부탁드립니다

//@version=4 study(title="Equilibriums", shorttitle="Equilibrium", overlay=true) //----------[ First Step: create inputs for equilibrium line periods tenkanPeriods = input(9, minval=1, title="Tenkan-Sen Length") zandakaPeriods1 = input(17, minval=1, title="Zandaka Period 1") kijunPeriods = input(26, minval=1, title="Kijun-Sen Length") zandakaPeriods2 = input(33, minval=1, title="Zandaka Period 2") zandakaPeriods3 = input(42, minval=1, title="Zandaka Period 3") zandakaPeriods4 = input(52, minval=1, title="Zandaka Period 4") zandakaPeriods5 = input(65, minval=1, title="Zandaka Period 5") zandakaPeriods6 = input(76, minval=1, title="Zandaka Period 6") //----------[ Second Step: define the formula for calculating the equilibrium donchian(len) => avg(lowest(len), highest(len)) //----------[ Third Step: Link the inputs to the previously created formula tenkanSen = donchian(tenkanPeriods) zandakaSen1 = donchian(zandakaPeriods1) kijunSen = donchian(kijunPeriods) zandakaSen2 = donchian(zandakaPeriods2) zandakaSen3 = donchian(zandakaPeriods3) zandakaSen4 = donchian(zandakaPeriods4) zandakaSen5 = donchian(zandakaPeriods5) zandakaSen6 = donchian(zandakaPeriods6) //----------[ Last Step: Create the code for plotting (this step is of vital importance as no one likes ugly or unclear indicators) plot(zandakaSen6, linewidth=8, color=color.rgb(255,150,000,60), title="Zandaka-Sen 6") plot(zandakaSen5, linewidth=7, color=color.rgb(255,255,000,60), title="Zandaka-Sen 5") plot(zandakaSen4, linewidth=6, color=color.rgb(000,036,249,60), title="Zandaka-Sen 4") plot(zandakaSen3, linewidth=5, color=color.rgb(139,000,247,40), title="Zandaka-Sen 3") plot(zandakaSen2, linewidth=4, color=color.rgb(226,159,226,00), title="Zandaka-Sen 2") plot(kijunSen, linewidth=3, color=color.rgb(227,000,034,20), title="Kijun-Sen") plot(zandakaSen1, linewidth=1, color=color.rgb(038,186,030,40), title="Zandaka-Sen 1") plot(tenkanSen, linewidth=3, color=color.rgb(000,152,116,00), title="Tenkan-Sen")
프로필 이미지
매치다2
2023-06-21
1465
글번호 169948
지표
답변완료

잘 부탁드립니다

// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/ // &#169; LeafAlgo //@version=5 indicator("Moving Average Contrarian Indicator", overlay=false) length = input(40, "Moving Average Length") src = close // Calculate moving average ma = ta.sma(src, length) // Calculate distance from price to moving average distance = src - ma // Calculate normalized MACI distance_min = ta.lowest(distance, length) distance_max = ta.highest(distance, length) maci = ((distance - distance_min) / (distance_max - distance_min)) * 100 // Determine barcolor and background color conditions maci_sma = ta.sma(maci, length) barC = maci > maci_sma and maci > 30 ? color.lime : maci < maci_sma and maci < 70 ? color.fuchsia : color.yellow backC = maci > maci_sma and maci > 30 ? color.new(color.lime, 80) : maci < maci_sma and maci < 70 ? color.new(color.fuchsia, 80) : color.new(color.yellow, 80) // Color barcolor(barC) bgcolor(backC, transp=70) // Plotting plot(maci, title="MACI", color=barC, style=plot.style_histogram, linewidth=4) plot(maci_sma, title='MACI SMA', color=color.maroon, linewidth=2) // Overbought and oversold levels hline(70, "Overbought", color=color.fuchsia) hline(30, "Oversold", color=color.lime)
프로필 이미지
매치다2
2023-06-21
1918
글번호 169947
지표
답변완료

부탁드립니다

//@version=5 indicator("Super Secret 200 EMA", overlay=true) length = input(10, "Supertrend Length") multiplier = input.float(3.0, "Supertrend Multiplier") emaPeriod = input(200, "EMA Period") // Calculate Supertrend var float supertrend = na var float highestHigh = na var float lowestLow = na for i = length to 1 if ta.change(close[i]) > 0 highestHigh := math.max(highestHigh, high[i]) else lowestLow := math.min(lowestLow, low[i]) supertrend := ta.change(close) > 0 ? lowestLow + multiplier * ta.atr(length) : highestHigh - multiplier * ta.atr(length) supertrendColor = supertrend > ta.ema(close, emaPeriod) ? color.green : color.red // Calculate 200 EMA ema200 = ta.ema(close, emaPeriod) emaColor = close > ema200 ? color.green : color.red // Plot Supertrend and EMA plot(supertrend, color=supertrendColor, title="Supertrend") plot(ema200, color=emaColor, title="200 EMA") // Determine Buy and Sell Conditions buyCondition = ta.crossover(close, ema200) and close > supertrend sellCondition = ta.crossunder(close, ema200) and close < supertrend // Plot Buy and Sell Signals plotshape(buyCondition, title="Buy Signal", location=location.belowbar, color=color.green, style=shape.labelup, text="Buy") plotshape(sellCondition, title="Sell Signal", location=location.abovebar, color=color.red, style=shape.labeldown, text="Sell")
프로필 이미지
매치다2
2023-06-21
1403
글번호 169946
지표
답변완료

수식 점검 부탁드립니다.

# 질문 # 1분봉 주기에서는 종목검색식의 결과값과 지표식의 값이 틀리다. 무엇이 잘못된것인지요? # 2분봉 이상의 주기에서는 종목검색식의 결과값과 지표식의 값이 같다. #종목검색 속성 : 사용자 설정 검색기간 500봉 var : 단일가V(0), 단일가V비율_2일전(00.00) ; 단일가V = Dayvolume(1) - Dayvolume[1+DayIndex] ; 단일가V비율_2일전 = 단일가V / DayVolume(2) ; /* plot11(Dayvolume(2), "Dayvolume(2)"); plot12(Dayvolume(1), "Dayvolume(1)"); plot14(단일가V, "단일가V"); plot15(단일가V비율_2일전, "단일가V비율_2일전"); */ if 단일가V비율_2일전 >= 0.1 Then Find(단일가V비율_2일전) ;
프로필 이미지
목포댁
2023-06-21
1334
글번호 169943
종목검색
답변완료

잘 부탁드립니다

indicator(title="Trend Indicator", shorttitle="Trend Analyzer", overlay=true, max_bars_back=(2000)) //@version=5 // Created by @erossini.tr // Inputs string ccolortp = "Color candle based on volumetric pressure compared to non-volumetric averages, confluence of fast and slow period" mode = input.string(defval = "Ichimoku", title = "Indicator", options = ["Ichimoku", "Channel and Bands", "None"]) bandinput = input.bool(defval = false, title = "Enable extentions zone") ccolorinput = input.bool(defval = true, title = "Enable candle color", tooltip = ccolortp) string ichi = "Ichimoku" string bands = "Bands and Channel" flmode = input.string(defval = "Classic mode", title = "Fast lines mode", options = ["Volume averages", "Classic mode"], group = ichi) ssamode = input.string(defval = "Auto", title = "SSA line mode", options = ["Volume average", "Classic mode", "Mixed", "Auto"], group = ichi) ssbmode = input.string(defval = "VWMA", title = "SSB line mode", options = ["VWMA", "Classic"], group = ichi) // Ichimoku conversionPeriods = input(11, title = "Fast Line", group = ichi) basePeriods = input(26, title = "Slow Line", group = ichi) lnt = input(89, title = "SSB Line", group = ichi) conv2 = ta.vwma(close, conversionPeriods) base2 = ta.vwma(close, basePeriods) conversionLine = math.avg(ta.lowest(conversionPeriods), ta.highest(conversionPeriods)) baseLine = math.avg(ta.lowest(basePeriods), ta.highest(basePeriods)) leadLine1 = math.avg(conversionLine, baseLine) leadLine12 = math.avg(conv2, base2) leadLine13 = math.avg(conv2, base2, conversionLine, baseLine) leadLine2 = ta.vwma(close, lnt) leadline21 = math.avg(ta.lowest(lnt), ta.highest(lnt)) // Trama ama = 0.00 lengthTR = input(34, title = "Trama Backline Lenght", group = ichi) hh = math.max(math.sign(ta.change(ta.highest(lengthTR))),0) ll = math.max(math.sign(ta.change(ta.lowest(lengthTR))*-1),0) tc = math.pow(ta.sma(hh or ll ? 1 : 0,lengthTR),2) ama := nz(ama[1]+tc*(close-ama[1]),close) // Bands and channel source = hlc3 mode3 = input.string(defval = "Channel", title = "Mode", options = ["Channel", "Bands"], group = bands) period = input(title = "Period", defval = 34, group = bands) multi = input(title = "Multiplier", defval = 3.14, group = bands) smooth = input(defval = 1, title = "Smoothing value", group = bands) sma = ta.vwma(source, period) // Keltner Channel f_kc(src, length, mult, useTrueRange) => float basis = sma float span = (useTrueRange) ? ta.tr : (high - low) float rangeEma = ta.ema(span, length) [basis, basis + rangeEma * mult, basis - rangeEma * mult] [kcmiddle, kcupper, kclower] = f_kc(source, period, multi, true) // Bollinger Bands f_bb(src, length, mult) => float basis2 = sma float dev = multi * ta.stdev(source, period) [basis2, basis2 + dev, basis2 - dev] [bbmiddle, bbupper, bblower] = f_bb(close, 5, 4) // Plot plotmiddle = if mode3 == "Channel" (ta.sma(kcmiddle, smooth)) else if mode3 == "Bands" (ta.sma(bbmiddle, smooth)) plotupper = if mode3 == "Channel" (ta.sma(kcupper, smooth)) else if mode3 == "Bands" (ta.sma(bbupper, smooth)) plotlower = if mode3 == "Channel" (ta.sma(kclower, smooth)) else if mode3 == "Bands" (ta.sma(bblower, smooth)) // Candle color Lenghtfast = 11 Lenghtslow = 89 colorup = #2962ff colordown = #e91e63 a1 = ta.sma(hlc3, Lenghtfast*2) a2 = ta.vwma(hlc3, Lenghtfast) a3 = ta.sma(hlc3, Lenghtslow*2) a4 = ta.vwma(hlc3, Lenghtslow) c3 = if a1 > a2 and a3 > a4 and ccolorinput == true (colordown) else if a1 < a2 and a3 < a4 and ccolorinput == true (colorup) barcolor(c3) // Extension zones [middle2, upper2, lower2] = ta.kc(close, 200, 12, false) [middle3, upper3, lower3] = ta.kc(close, 200, 23, false) g1 = if bandinput == true upper2 g2 = if bandinput == true upper3 g3 = if bandinput == true lower2 g4 = if bandinput == true lower3 h1 = plot(g1, color = color.new(color.gray, 100), editable = false) h2 = plot(g2, color = color.new(color.gray, 100), editable = false) h3 = plot(g3, color = color.new(color.gray, 100), editable = false) h4 = plot(g4, color = color.new(color.gray, 100), editable = false) fill(h3, h4, color = color.new(#2962ff, 85), title = "Lower zone") fill(h1, h2, color = color.new(#e91e63, 85), title = "Upper zone") // Plot displacement = input(26, title = "Forward displacement", group = ichi) backdisp = input(30, title = "Backwards displacement", group = ichi) p9 = if ssbmode == "VWMA" p9 = leadLine2 else if ssbmode == "Classic" p9 = leadline21 x1 = if flmode == "Volume averages" x1 = conv2 else if flmode == "Classic mode" x1 = conversionLine x2 = if flmode == "Volume averages" x2 = base2 else if flmode == "Classic mode" x2 = baseLine u1 = if ssamode == "Volume average" u1 = leadLine12 else if ssamode == "Classic mode" u1 = leadLine1 else if ssamode == "Mixed" u1 = leadLine13 else if ssamode == "Auto" u1 = math.avg(x1, x2) kjuncol = conversionLine > baseLine ? #2962ff : conversionLine < baseLine ? #e91e63 : color.gray q1 = if mode == "Ichimoku" x1 q2 = if mode == "Ichimoku" x2 q3 = if mode == "Ichimoku" u1 q4 = if mode == "Ichimoku" p9 q5 = if mode == "Ichimoku" ama q6 = if mode == "Channel and Bands" plotmiddle q7 = if mode == "Channel and Bands" plotupper q8 = if mode == "Channel and Bands" plotlower plot(q1, color=color.gray, title="Conversion Line") plot(q2, color=kjuncol, linewidth=2, title="Base Line") p8 = plot(q3, offset = displacement, color=#2962ffb4, title="SSA") p3 = plot(q4, offset = displacement, color=#e91e62b2, title="SSB") fill(p8, p3,color.rgb(134, 134, 134, 77), title = "Kumo Cloud") plot(q5, color = color.rgb(149, 0, 179, 10), offset = -backdisp, title = "Backline", style = plot.style_circles) plot(q6, color = color.gray, title = "Middle line") p10 = plot(q8, color = #2962ff, title = "Lower line") p20 = plot(q7, color = #e91e63, title = "Upper line") fill(p10, p20, color = color.new(color.gray, 90), title = "Channel Background")
프로필 이미지
매치다2
2023-06-21
1320
글번호 169942
지표
답변완료

잘 부탁드립니다

//@version=4 //By Glaz, Modified // study("QQE MOD") RSI_Period = input(6, title='RSI Length') SF = input(5, title='RSI Smoothing') QQE = input(3, title='Fast QQE Factor') ThreshHold = input(3, title="Thresh-hold") // src = input(close, title="RSI Source") // // Wilders_Period = RSI_Period * 2 - 1 Rsi = rsi(src, RSI_Period) RsiMa = ema(Rsi, 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 := RSIndex[1] > longband[1] and RSIndex > longband[1] ? max(longband[1], newlongband) : newlongband shortband := RSIndex[1] < shortband[1] and RSIndex < shortband[1] ? min(shortband[1], newshortband) : newshortband cross_1 = cross(longband[1], RSIndex) trend := cross(RSIndex, shortband[1]) ? 1 : cross_1 ? -1 : nz(trend[1], 1) FastAtrRsiTL = trend == 1 ? longband : shortband //////////////////// length = input(50, minval=1, title="Bollinger Length") mult = input(0.35, minval=0.001, maxval=5, step=0.1, title="BB Multiplier") basis = sma(FastAtrRsiTL - 50, length) dev = mult * stdev(FastAtrRsiTL - 50, length) upper = basis + dev lower = basis - dev color_bar = RsiMa - 50 > upper ? #00c3ff : RsiMa - 50 < lower ? #ff0062 : color.gray // // Zero cross QQEzlong = 0 QQEzlong := nz(QQEzlong[1]) QQEzshort = 0 QQEzshort := nz(QQEzshort[1]) QQEzlong := RSIndex >= 50 ? QQEzlong + 1 : 0 QQEzshort := RSIndex < 50 ? QQEzshort + 1 : 0 // Zero = hline(0, color=color.white, linestyle=hline.style_dotted, linewidth=1) //////////////////////////////////////////////////////////////// RSI_Period2 = input(6, title='RSI Length') SF2 = input(5, title='RSI Smoothing') QQE2 = input(1.61, title='Fast QQE2 Factor') ThreshHold2 = input(3, title="Thresh-hold") src2 = input(close, title="RSI Source") // // Wilders_Period2 = RSI_Period2 * 2 - 1 Rsi2 = rsi(src2, 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 := RSIndex2[1] > longband2[1] and RSIndex2 > longband2[1] ? max(longband2[1], newlongband2) : newlongband2 shortband2 := RSIndex2[1] < shortband2[1] and RSIndex2 < shortband2[1] ? min(shortband2[1], newshortband2) : newshortband2 cross_2 = cross(longband2[1], RSIndex2) trend2 := cross(RSIndex2, shortband2[1]) ? 1 : cross_2 ? -1 : nz(trend2[1], 1) FastAtrRsi2TL = trend2 == 1 ? longband2 : shortband2 // // Zero cross QQE2zlong = 0 QQE2zlong := nz(QQE2zlong[1]) QQE2zshort = 0 QQE2zshort := nz(QQE2zshort[1]) QQE2zlong := RSIndex2 >= 50 ? QQE2zlong + 1 : 0 QQE2zshort := RSIndex2 < 50 ? QQE2zshort + 1 : 0 // hcolor2 = RsiMa2 - 50 > ThreshHold2 ? color.silver : RsiMa2 - 50 < 0 - ThreshHold2 ? color.silver : na plot(FastAtrRsi2TL - 50, title='QQE Line', color=color.white, transp=0, linewidth=2) plot(RsiMa2 - 50, color=hcolor2, transp=50, title='Histo2', style=plot.style_columns) Greenbar1 = RsiMa2 - 50 > ThreshHold2 Greenbar2 = RsiMa - 50 > upper Redbar1 = RsiMa2 - 50 < 0 - ThreshHold2 Redbar2 = RsiMa - 50 < lower plot(Greenbar1 and Greenbar2 == 1 ? RsiMa2 - 50 : na, title="QQE Up", style=plot.style_columns, color=#00c3ff, transp=0) plot(Redbar1 and Redbar2 == 1 ? RsiMa2 - 50 : na, title="QQE Down", style=plot.style_columns, color=#ff0062, transp=0)
프로필 이미지
매치다2
2023-06-21
1733
글번호 169941
지표
답변완료

일목균형표 문의 드립니다.

함수 정의할때 일목균형표 선행스팬1,2 문의 드립니다. 선행스팬1,2는 지금 현재 캔들이 있는 선행스팬1,2와 이미 앞에 나와있는 선행스팬1,2 두가지가 있는데요 각각 어떻게 함수 정의를 해야 하나요? A=현재 캔들이 있는 선행스팬1 B=26봉 전 앞에 나와있는 선행스팬1(앞구름) C=현재 캔들이 있는 선행스팬2 D=26봉 전 앞에 나와있는 선행스팬2(앞구름) 로 분류해서 설명 부탁드립니다.
프로필 이미지
비정성시
2023-06-21
1440
글번호 169940
사용자 함수
답변완료

차트에 한계선표시하기

예스트레이더에서 국선 차트에 표시하는 코드좀 부탁드립니다. 아래와 같습니다. 국선 한계선 표시 1. 시가 상승 한계선 1차 : 시가대비 2.5포인트 상승 지점에 라인 표시 2. 시가 상승 한계선 2차 : 시가대비 3 포인트 상승 지점에 라인 표시 3. 시가 하락 한계선 1차 : 시가대비 2.5포인트 하락 지점에 라인 표시 4. 시가 하락 한계선 2차 : 시가대비 3 포인트 하락 지점에 라인 표시 1. 저점 대비 상승 한계선 1차 : 저점 대비 2.5포인트 상승 지점에 라인 표시 2. 저점 대비 상승 한계선 2차 : 저점 대비 3 포인트 상승 지점에 라인 표시 3. 고점 대비 하락 한계선 1차 : 고점 대비 2.5포인트 하락 지점에 라인 표시 4. 고점 대비 하락 한계선 2차 : 고점 대비 3 포인트 하락 지점에 라인 표시 2.5포인트나 3포인트는 INPUT을 써서 수치를 조정 가능하게 하면 좋음 라인 색상은 사용자 조정가능하게 해주면 좋음
프로필 이미지
깅창
2023-06-21
1087
글번호 169939
지표
답변완료

문의드립니다

//기본차트 MACD macdv = macd(short,long); macds = Ema(macdv,sig); Ep1 = 2/(short+1); Ep2 = 2/(long+1); Ep3 = 2/(sig+1); if Bdate != Bdate[1] Then { S1 = TimeToMinutes(stime); D1 = sdate; } if D1 > 0 then { if sdate == D1 Then TM = TimeToMinutes(stime)-S1; Else TM = TimeToMinutes(stime)+1440-S1; TF1 = TM%분1; TF2 = TM%분2; //15분봉 MACD if Bdate != Bdate[1] or (Bdate == Bdate[1] and 분1 > 1 and TF1 < TF1[1]) or (Bdate == Bdate[1] and 분1 > 1 and TM >= TM[1]+분1) or (Bdate == Bdate[1] and 분1 == 1 and TM > TM[1]) Then { i1 = i1 + 1; Prexma11 = xma11[1]; Prexma12 = xma12[1]; PreMACDS1 = MACDS1[1]; } if i1 <= 1 then { xma11 = C; xma12 = C; MACDV1 = xma11-xma12; MACDS1 = MACDV1; } else { xma11 = C * EP1 + Prexma11 * (1-EP1); xma12 = C * EP2 + Prexma12 * (1-EP2); MACDV1 = xma11-xma12; MACDS1 = MACDV1 * EP3 + PreMACDS1 * (1-EP3); } //20분봉 MACD if Bdate != Bdate[1] or (Bdate == Bdate[1] and 분2 > 1 and TF2 < TF2[1]) or (Bdate == Bdate[1] and 분2 > 1 and TM >= TM[1]+분2) or (Bdate == Bdate[1] and 분2 == 1 and TM > TM[1]) Then { i2 = i2 + 1; Prexma21 = xma11[1]; Prexma22 = xma12[1]; PreMACDS2 = MACDS2[1]; } if i2 <= 1 then { xma21 = C; xma22 = C; MACDV2 = xma21-xma22; MACDS2 = MACDV2; } else { xma21 = C * EP1 + Prexma21 * (1-EP1); xma22 = C * EP2 + Prexma22 * (1-EP2); MACDV2 = xma21-xma22; MACDS2 = MACDV2 * EP3 + PreMACDS2 * (1-EP3); } 시간 변경은 어떻게하나요? 예) 현재차트 60분봉 15분봉--->120분봉 20분봉--->240분봉
프로필 이미지
탱탱볼
2023-06-21
1144
글번호 169934
시스템