커뮤니티

예스랭귀지 Q&A

글쓰기
답변완료

오류 수정 좀 부탁드립니다.

제가 나름 gpt로 코드를 수정해보려 했는데 초보라서 계속 오류만 발생하네요.ㅠㅠ 아래 코드가 무엇이 문제인지 수정 좀 부탁드립니다. input : atrLen(20), mode(1); # 1: Trending, 2: Scalping input : smoothingLen(10); input : showMA(true); var : priorATR(0), currentATR(0), factor(0); var : supertrend(0), direction(0), stopPrice(0); var : hl2(0), atrVal(0); hl2 = (h + l) / 2; # 현재 ATR 계산 currentATR = atr(atrLen); # 전일 ATR 계산 priorATR = atr(atrLen)[1]; # 적응형 배수 설정 if currentATR <= priorATR * 0.25 then factor = iff(mode = 2, 5.0, 1.0); else if currentATR <= priorATR * 0.5 then factor = iff(mode = 2, 3.0, 3.0); else if currentATR <= priorATR * 0.75 then factor = iff(mode = 2, 1.5, 4.0); else factor = iff(mode = 2, 1.0, 5.0); # Supertrend 계산 (기초선) supertrend = hl2 - factor * currentATR; direction = iff(close > supertrend, 1, -1); # Stop라인 조정: 슈퍼트렌드와 종가의 중간값을 이동 평균으로 부드럽게 처리 stopPrice = ma((close + supertrend)/2, smoothingLen); # 최종 슈퍼트렌드 라인 출력 plot1(stopPrice, "Adaptive SuperTrend", iff(direction > 0, red, blue)); # 사용자가 원하는 경우 MA 출력 if showMA then begin plot2(ma(close, atrLen), "Base MA", gray); end else begin NoPlot(2); end # Fill Zone 라인 (위/아래 경계선) var : uptrendStop(0), downtrendStop(0); uptrendStop = ma((high + supertrend) / 2, atrLen/ 2); downtrendStop = ma((low + supertrend) / 2, atrLen/ 2); plot3(iff(direction= 1, uptrendStop, na), "Buy Stop Line", darkgreen); plot4(iff(direction= -1, downtrendStop, na), "Sell Stop Line", darkred);
프로필 이미지
플로스트
2025-07-03
262
글번호 192278
지표

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

프로필 이미지
님이랑
2025-07-03
24
글번호 192277
종목검색
답변완료

부탁드립니다.

8시 45분 굵기2 시가 세로선도 넣어주시면 감사하겠습니다. 굵기2 input : ntime(90000); var : TL(0); if (sDate != sDate[1] and sTime >= ntime) or (sDate == sDate[1] and sTime >= ntime and sTime[1] < ntime) Then { #수직선 TL = TL_New(sDate,sTime,0,sDate,sTime,99999999); TL_SetColor(TL,Gray); TL_SetSize(TL,1); var1 = O; }
프로필 이미지
어떤하루
2025-07-03
226
글번호 192274
지표
답변완료

수식 문의 드립니다.

안녕하세요. 수식 문의 드립니다. 지난번 문의한 번호 ; 93291 날짜 : 25. 06 / 21 위수신에 수식을 추가 하려 합니다 1. 볼린저밴드_스퀴즈 상단 2. 중심선 3. G/C 4. 스퀴즈 하단 ---------------------------------- 추가 5. 지수 5일선 6. 지수 5일선_ 고점, 저점 부탁드립니다. 감사 합니다
프로필 이미지
s1017051
2025-07-03
618
글번호 192267
지표
답변완료

문의드립니다.

var : AA(False), BB(False); var : T(0), B(0), dayStartBar(0); var1 = ma(C, 10); if sDate != sDate[1] Then { T = 0; B = 0; dayStartBar = BarIndex + 1; // 금일 첫 봉 인덱스 저장 } //B = B + 1; AA = DayOpen >= 5000 and DayOpen <= 6000; //BB = DayOpen >= DayClose[1] and DayOpen <= DayClose[1] * 1.06; if AA Then T = 1; // 골든크로스는 금일 두 번째 봉부터 검사 if T == 1 and dayStartBar >= 10 and CrossUp(C, var1) Then // find(1); 이거 안됩니다... 금일 분봉이 몇번째인지, 카운트가 안됩니다... 예를들면, 15번째분봉에 골든크로스가 있는거 고르기... 또 20봉 ~ 30봉까지의 거래량의 합계... 이런걸 알고싶은데...ai로 아무리 노력해도 안됩니다... 분봉의 카운트를 알고싶습니다... 몇번째분봉인지 알고싶습니다...갈켜주세요... 부탁드립니다... 감사합니다...ㅎ
프로필 이미지
시온사랑
2025-07-03
185
글번호 192266
종목검색

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

프로필 이미지
s1017051
2025-07-03
3
글번호 192265
지표

사공하늘 님에 의해서 삭제되었습니다.

프로필 이미지
사공하늘
2025-07-03
37
글번호 192264
검색
답변완료

아래 트뷰 전략을 종목검색으로 변환 문의 드립니다.

안녕하세요, 제가 트레이딩뷰 자동매매에서 사용하던 전략인데, 예스트레이더 종목검색으로 변환이 가능한지 문의 드립니다. 단순하게, ALGOALPHA - ZERO LAG SIGNALS이 녹색일 때, 그리고 CM_ULTIMATE_MA_MTF_V2 [SMA로 대체]가 녹색(양의 값)일때, 발생하는 슈퍼트렌드 혹은 UT Bot alerts등의 신호가 발생했을시,진입을 하는 그런 전략입니다. 예스트레이더의 종목검색으로 변환 가능한지 문의 드립니다. 감사합니다. //////////////////////////////////////////////////////////// SUPERTREND //////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // INPUTS Periods = 15 // input(title='ATR Period', defval=10) src = hl2 // input(hl2, title='Source') Multiplier = 3.0 // input.float(title='ATR Multiplier', step=0.1, defval=3.0) changeATR = true // input(title='Change ATR Calculation Method ?', defval=true) showsignals = true // input.bool(title='Show Buy/Sell Signals ?', defval=true, group = "SuperTrend") highlighting = false // input.bool(title='Highlighter On/Off ?', defval=false, group = "SuperTrend") // CALCULATIONS atr2 = ta.sma(ta.tr, Periods) atr = changeATR ? ta.atr(Periods) : atr2 up = src - Multiplier * atr up1 = nz(up[1], up) up := close[1] > up1 ? math.max(up, up1) : up dn = src + Multiplier * atr dn1 = nz(dn[1], dn) dn := close[1] < dn1 ? math.min(dn, dn1) : dn trend = 1 trend := nz(trend[1], trend) trend := trend == -1 and close > dn1 ? 1 : trend == 1 and close < up1 ? -1 : trend // PLOTS // upPlot = plot(trend == 1 ? up : na, title='Up Trend', style=plot.style_linebr, linewidth=2, color=color.new(color.green, 0)) buySignal = trend == 1 and trend[1] == -1 // dnPlot = plot(trend == 1 ? na : dn, title='Down Trend', style=plot.style_linebr, linewidth=2, color=color.new(color.red, 0)) sellSignal = trend == -1 and trend[1] == 1 // plotshape(buySignal ? up : na, title='UpTrend Begins', location=location.absolute, style=shape.circle, size=size.tiny, color=color.new(color.green, 0)) // plotshape(buySignal and showsignals ? up : na, title='Buy', text='Buy', location=location.absolute, style=shape.labelup, size=size.tiny, color=color.new(color.green, 0), textcolor=color.new(color.white, 0)) // plotshape(sellSignal ? dn : na, title='DownTrend Begins', location=location.absolute, style=shape.circle, size=size.tiny, color=color.new(color.red, 0)) // plotshape(sellSignal and showsignals ? dn : na, title='Sell', text='Sell', location=location.absolute, style=shape.labeldown, size=size.tiny, color=color.new(color.red, 0), textcolor=color.new(color.white, 0)) // mPlot = plot(ohlc4, title='', style=plot.style_circles, linewidth=0) longFillColor = highlighting ? trend == 1 ? color.green : color.white : color.white shortFillColor = highlighting ? trend == -1 ? color.red : color.white : color.white // fill(mPlot, upPlot, title='UpTrend Highligter', color=longFillColor, transp=90) // fill(mPlot, dnPlot, title='DownTrend Highligter', color=shortFillColor, transp=90) // RETURNS stGreen = (trend == 1) ? true : false stRed = (trend == -1) ? true : false stBuySignal = buySignal stSellSignal = sellSignal ///////////////////////////////////////////////// ALGOALPHA - ZERO LAG SIGNALS ///////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // INPUTS length = 70 // input.int(70, "Length", tooltip = "The Look-Back window for the Zero-Lag EMA calculations", group = "Main Calculations") mult = 1.2 // input.float(1.2, "Band Multiplier", tooltip = "This value controls the thickness of the bands, a larger value makes the indicato less noisy", group = "Main Calculations") t1 = "5" // input.timeframe("5", "Time frame 1", group = "Extra Timeframes") t2 = "15" // input.timeframe("15", "Time frame 2", group = "Extra Timeframes") t3 = "60" // input.timeframe("60", "Time frame 3", group = "Extra Timeframes") t4 = "240" // input.timeframe("240", "Time frame 4", group = "Extra Timeframes") t5 = "1D" // input.timeframe("1D", "Time frame 5", group = "Extra Timeframes") green = #00ffbb // input.color(#00ffbb, "Bullish Color", group = "Appearance") red = #ff1100 // input.color(#ff1100, "Bearish Color", group = "Appearance") // CALCULATIONS srcA = close lag = math.floor((length - 1) / 2) zlema = ta.ema(srcA + (srcA - srcA[lag]), length) volatility = ta.highest(ta.atr(length), length*3) * mult var trendA = 0 if ta.crossover(close, zlema+volatility) trendA := 1 if ta.crossunder(close, zlema-volatility) trendA := -1 // PLOTS zlemaColor = trendA == 1 ? color.new(green, 70) : color.new(red, 70) // m = plot(zlema, title="Zero Lag Basis", linewidth=2, color=zlemaColor) // upper = plot(trendA == -1 ? zlema+volatility : na, style = plot.style_linebr, color = color.new(red, 90), title = "Upper Deviation Band") // lower = plot(trendA == 1 ? zlema-volatility : na, style = plot.style_linebr, color = color.new(green, 90), title = "Lower Deviation Band") // fill(m, upper, (open + close) / 2, zlema+volatility, color.new(red, 90), color.new(red, 70)) // fill(m, lower, (open + close) / 2, zlema-volatility, color.new(green, 90), color.new(green, 70)) // plotshape(ta.crossunder(trendA, 0) ? zlema+volatility : na, "Bearish Trend", shape.labeldown, location.absolute, red, text = "▼", textcolor = chart.fg_color, size = size.small) // plotshape(ta.crossover(trendA, 0) ? zlema-volatility : na, "Bullish Trend", shape.labelup, location.absolute, green, text = "▲", textcolor = chart.fg_color, size = size.small) // plotchar(ta.crossover(close, zlema) and trendA == 1 and trendA[1] == 1 ? zlema-volatility*1.5 : na, "Bullish Entry", "▲", location.absolute, green, size = size.tiny) // plotchar(ta.crossunder(close, zlema) and trendA == -1 and trendA[1] == -1 ? zlema+volatility*1.5 : na, "Bearish Entry", "▼", location.absolute, red, size = size.tiny) s1 = request.security(syminfo.tickerid, t1, trendA) s2 = request.security(syminfo.tickerid, t2, trendA) s3 = request.security(syminfo.tickerid, t3, trendA) s4 = request.security(syminfo.tickerid, t4, trendA) s5 = request.security(syminfo.tickerid, t5, trendA) s1a = s1 == 1 ? "Bullish" : "Bearish" s2a = s2 == 1 ? "Bullish" : "Bearish" s3a = s3 == 1 ? "Bullish" : "Bearish" s4a = s4 == 1 ? "Bullish" : "Bearish" s5a = s5 == 1 ? "Bullish" : "Bearish" // TABELS if barstate.islast var data_table = table.new(position=position.top_right, columns=2, rows=6, bgcolor=chart.bg_color, border_width=1, border_color=chart.fg_color, frame_color=chart.fg_color, frame_width=1) table.cell(data_table, text_halign=text.align_center, column=0, row=0, text="Time Frame", text_color=chart.fg_color) table.cell(data_table, text_halign=text.align_center, column=1, row=0, text="Signal", text_color=chart.fg_color) table.cell(data_table, text_halign=text.align_center, column=0, row=1, text=t1, text_color=chart.fg_color) table.cell(data_table, text_halign=text.align_center, column=1, row=1, text=s1a, text_color=chart.fg_color, bgcolor=s1a == "Bullish" ? color.new(green, 70) : color.new(red, 70)) table.cell(data_table, text_halign=text.align_center, column=0, row=2, text=t2, text_color=chart.fg_color) table.cell(data_table, text_halign=text.align_center, column=1, row=2, text=s2a, text_color=chart.fg_color, bgcolor=s2a == "Bullish" ? color.new(green, 70) : color.new(red, 70)) table.cell(data_table, text_halign=text.align_center, column=0, row=3, text=t3, text_color=chart.fg_color) table.cell(data_table, text_halign=text.align_center, column=1, row=3, text=s3a, text_color=chart.fg_color, bgcolor=s3a == "Bullish" ? color.new(green, 70) : color.new(red, 70)) table.cell(data_table, text_halign=text.align_center, column=0, row=4, text=t4, text_color=chart.fg_color) table.cell(data_table, text_halign=text.align_center, column=1, row=4, text=s4a, text_color=chart.fg_color, bgcolor=s4a == "Bullish" ? color.new(green, 70) : color.new(red, 70)) table.cell(data_table, text_halign=text.align_center, column=0, row=5, text=t5, text_color=chart.fg_color) table.cell(data_table, text_halign=text.align_center, column=1, row=5, text=s5a, text_color=chart.fg_color, bgcolor=s5a == "Bullish" ? color.new(green, 70) : color.new(red, 70)) // RETURNS zeroLagGreen = (trendA == 1) ? true : false zeroLagRed = (trendA == -1) ? true : false ////////////////////////////////////////////// CM_ULTIMATE_MA_MTF_V2 [SMA로 대체] ////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // RETURNS smaCrossOver = ta.crossover(ta.sma(close, 20), ta.sma(close, 50)) smaCrossUnder = ta.crossunder(ta.sma(close, 20), ta.sma(close, 50)) sma20Green = ta.sma(close, 20) >= ta.sma(close, 20)[1] sma20BreakOut = (open < ta.sma(close, 20)) and (close > ta.sma(close, 20)) //////////////////////////////////////////////////////// UT BOT ALERTS ////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // INPUTS a = 2 // input(1, title='Key Vaule. ₩'This changes the sensitivity₩'') c = 20 // input(10, title='ATR Period') h = false // input(false, title='Signals from Heikin Ashi Candles') // CALCULATIONS xATR = ta.atr(c) nLoss = a * xATR srcC = h ? request.security(ticker.heikinashi(syminfo.tickerid), timeframe.period, close, lookahead=barmerge.lookahead_off) : close xATRTrailingStop = 0.0 iff_1 = srcC > nz(xATRTrailingStop[1], 0) ? srcC - nLoss : srcC + nLoss iff_2 = srcC < nz(xATRTrailingStop[1], 0) and srcC[1] < nz(xATRTrailingStop[1], 0) ? math.min(nz(xATRTrailingStop[1]), srcC + nLoss) : iff_1 xATRTrailingStop := srcC > nz(xATRTrailingStop[1], 0) and srcC[1] > nz(xATRTrailingStop[1], 0) ? math.max(nz(xATRTrailingStop[1]), srcC - nLoss) : iff_2 pos = 0 iff_3 = srcC[1] > nz(xATRTrailingStop[1], 0) and srcC < nz(xATRTrailingStop[1], 0) ? -1 : nz(pos[1], 0) pos := srcC[1] < nz(xATRTrailingStop[1], 0) and srcC > nz(xATRTrailingStop[1], 0) ? 1 : iff_3 xcolor = pos == -1 ? color.red : pos == 1 ? color.green : color.blue ema = ta.ema(srcC, 1) above = ta.crossover(ema, xATRTrailingStop) below = ta.crossover(xATRTrailingStop, ema) buy = srcC > xATRTrailingStop and above sell = srcC < xATRTrailingStop and below barbuy = srcC > xATRTrailingStop barsell = srcC < xATRTrailingStop // PLOTS // plotshape(buy, title='Buy', text='Buy', style=shape.labelup, location=location.belowbar, color=color.new(color.green, 0), textcolor=color.new(color.white, 0), size=size.tiny) // plotshape(sell, title='Sell', text='Sell', style=shape.labeldown, location=location.abovebar, color=color.new(color.red, 0), textcolor=color.new(color.white, 0), size=size.tiny) // RETURNS UTBuyCond = buy ? true : false UTSellCond = sell ? true : false /////////////////////////////////////////////////////////// STRATEGY //////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// var float entryPrice = na var float slPrice = na bool totalLongCond = stGreen and zeroLagGreen and (UTBuyCond or stBuySignal) bool totalLongExitCond = stRed or zeroLagRed if strategy.position_size == 0 if totalLongCond pstrategy.entry("long", "strategy.long", comment = "롱 진입") entryPrice := close slPrice := entryPrice * (1 - slPercent) if strategy.position_size > 0 pstrategy.exit("exit long", "long", stop = slPrice, comment = "롱 SL") if totalLongExitCond pstrategy.close("long", "롱 종료", immediately = true) entryPrice := na slPercent := na
프로필 이미지
리버피닉스
2025-07-03
378
글번호 192263
종목검색
답변완료

종목검색 할때

KRX만 검색 되는거 같은데 NXT는 검색 할수있는 방법이 없나요?
프로필 이미지
nicebs
2025-07-03
201
글번호 192262
종목검색
답변완료

변환부탁합니다.

tradingview 지표 중 일부 수식입니다. 가능한 변환부탁드립니다. 플롯이나 fill 부분은 정확하지 않아도 됩니다. 입력값은 ma1,ma2,ma3,ma4 // 이동평균선 계산 ma1 = exponential ? ema(src, ma1_length) : sma(src, ma1_length) ma2 = exponential ? ema(src, ma2_length) : sma(src, ma2_length) ma3 = exponential ? ema(src, ma3_length) : sma(src, ma3_length) ma4 = exponential ? ema(src, ma4_length) : sma(src, ma4_length) // 각 영역의 상단/하단값 계산 red_top = max(ma1, ma2) red_bottom = min(ma1, ma2) blue_top = max(ma3, ma4) blue_bottom = min(ma3, ma4) // 범위 계산 red_range = red_top - red_bottom blue_range = blue_top - blue_bottom // 교차 조건 계산 current_condition = red_top > blue_top prev_condition = red_top[1] > blue_top[1] // 교차 시점 감지 red_cross_above = current_condition and not prev_condition blue_cross_above = not current_condition and prev_condition // 겹침 조건 계산 is_overlap = (red_top > blue_bottom) and (red_bottom < blue_top) overlap_start = not is_overlap[1] and is_overlap overlap_end = is_overlap[1] and not is_overlap // MA 플롯 정의 (메인 차트에 표시) p1 = plot(ma1, color=show_fill_input ? color.new(color.white, 100) : (change(ma1) >= 0 ? color.lime : color.red), style=plot.style_line, title="MA1", linewidth=2) p2 = plot(ma2, color=show_fill_input ? color.new(color.white, 100) : (change(ma2) >= 0 ? color.lime : color.red), style=plot.style_line, title="MA2", linewidth=2) p3 = plot(ma3, color=show_fill_input ? color.new(color.white, 100) : (change(ma3) >= 0 ? color.lime : color.red), style=plot.style_line, title="MA3", linewidth=2) p4 = plot(ma4, color=show_fill_input ? color.new(color.white, 100) : (change(ma4) >= 0 ? color.lime : color.red), style=plot.style_line, title="MA4", linewidth=2) / === 색상 채우기 === fill(p1, p2, color=show_fill_input ? color.new(color.red, 60) : na, title="MA1-MA2 간격") fill(p3, p4, color=show_fill_input ? color.new(color.blue, 60) : na, title="MA3-MA4 간격")
프로필 이미지
bw
2025-07-03
245
글번호 192260
지표