커뮤니티
예스랭귀지 Q&A
답변완료
[공지] 예스랭귀지 AI 어시스턴트, '예스나 AI' 출시 및 무료 체험 안내
안녕하세요, 예스스탁 입니다.복잡한 수식 공부 없이 여러분의 아이디어를 말하면 시스템 트레이딩 언어 예스랭귀지로 작성해주는 서비스예스나 AI(YesNa AI)가 출시되었습니다.지금 예스나 AI를 직접 경험해 보실 수 있도록 20크레딧(질문권 20회)를 무료로 증정해 드리고 있습니다.바로 여러분의 아이디어를 코드로 변환해보세요.--------------------------------------------------🚀 YesNa AI 핵심 기능- 지표식/전략식/종목검색식 생성: 자연어로 요청하면 예스랭귀지 문법에 맞는 코드를 작성합니다.- 종목검색식 변환 지원: K증권의 종목 검색식을 예스랭귀지로 변환 지원합니다.- 컴파일 검증: 작성된 코드가 실행 가능한지 컴파일러를 통해 문법 검증을 거쳐 결과물을 제공합니다.상세한 서비스 개요 및 활용 방법은 [서비스 소개 페이지]에서 확인하실 수 있습니다.▶ 서비스 소개 페이지: 바로가기서비스 사용 유의사항 및 결제 환불정책은 [이용약관]을 참고 부탁드립니다.▶ 서비스 이용약관: 바로가기💬 이용 문의사용 중 문의사항은 [프로그램 사용법 Q&A] 게시판에서 [예스나 AI] 카테고리를 설정 후 문의해 주시면 상세히 안내해 드리겠습니다.--------------------------------------------------앞으로도 AI를 활용한 다양한 트레이딩 기능들을 지속적으로 선보일 예정입니다.많은 관심과 기대 부탁드립니다.
2026-02-27
1536
글번호 230811
답변완료
아래 트뷰 전략을 종목검색으로 변환 문의 드립니다.
안녕하세요, 제가 트레이딩뷰 자동매매에서 사용하던 전략인데, 예스트레이더 종목검색으로 변환이 가능한지 문의 드립니다.
단순하게, 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
513
글번호 192263
답변완료
종목검색 할때
KRX만 검색 되는거 같은데
NXT는 검색 할수있는 방법이 없나요?
2025-07-03
277
글번호 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 간격")
2025-07-03
285
글번호 192260
답변완료
종목 검색 부탁드립니다.
기간 50
AA=(H+L+C)/3;
BB=AA*V;
X1=SUM(BB,기간);
X2=SUM(V,기간);
S1=X1/X2;
위 수식 돌파 종목 검색식 부탁드립니다
2025-07-03
230
글번호 192258
답변완료
전략 작성에 대하여 도움 부탁드립니다.
안녕하세요?
opening range breakout 전략 작성에 대하여 도움 부탁드립니다.
15분봉 사용.
1. 미국장 개장시간의 첫 15분봉(미국시간 09시30분~09시45분에 완성되는 봉, 서머타임 여부에 따라서 한국시간으로는 22시30분~22시45분에 완성되는 봉 또는 23시30분~23시45분에 완성되는 봉)의 고가와 저가를 opening range로 설정.
2. 진입가능시간은 미국시간으로 09시45분이후부터 12시 이전까지로 한정.
3. 종가가 opening range 고가보다 클때 매수진입, 저가보다 작을때에 매도 진입.
4. 매수손절은 opening range의 저가, 매도손절은 opening range의 고가.
5. 익절은 opening range 폭의 1.5배.
잘 부탁드립니다.
미리 감사드립니다.
2025-07-03
241
글번호 192255
답변완료
수식입력값(yeslanguage로 변환 요청)
안녕 하십닌까?
아래 함수 yeslanguage로 변환해서 수식값 등록할수 있도록 부탁드립니다.
//@version=5
indicator(title=macd+200ema",timeframe="",timeframe_gaps=true)
// getting inputs
fast_length = input(title = "fast length", defval =12)
slow_length = input(title = "slow length", defval =26)
src = input(title = "source" , defval =close)
signal_length = input.int(title ="signal smoothing",minval=1,maxval=50,
defval = 9 , display = display.data_windows)
sma_source = input.string(title=:oscillator ma type",defval= "ema", options =
[ "sma", "ema"],display = display.data_windows)
sma_signal=input.string(title = "signal line ma type",defval = "ema",
option=[ "sma", "ema"],display = display.data_windows)
// calculating
2025-07-03
274
글번호 192249
답변완료
질문 부탁드립니다
수고가 많으십니다
혹시 이런 수식도 가능한지 여쭤보고 싶습니다
차트상 조건 h>l*1.1 이 최초로 나오고 나서 (a봉 라고 할게요) 그 이후로
a봉 저가대비 8% 이상 상승한 봉을 찾는데 (반드시 h>l*1.1 일 필요없음)
누적을 해서 a 봉의 고가를 기준으로 20퍼센트를 초과하게 되면, 그 봉의 (봉 B) 고가를 구함
그 후로 봉B 고가 에서부터 -8% 하락한 봉을 찾습니다 (b봉 고가 기준 -20% 하락 지점까지)
봉b 기준 -20% 을 초과하면 그 봉의 저가를 구한뒤 다시 상승형 비교..
이 패턴을 계속 반복하게 하려고 하는데 작성이 가능할까요?
예를 들어서 가장 최초의 h>l*1.1 봉 이후에 조건봉 "저가"대비 +15% 봉 , 그 이후에 +8% 봉(+15% 봉의 저가 대비)이 체크되면
총 +23% (+20% 초과) 이므로 그 봉을 새로운 기준봉으로 하고
그 "고가값"을 기준으로 다음이 -15%, 그 다음이 -8% 이라면 그 봉이 새로운 기준봉, 그때의 저가를 구함 ...
이런식으로 상승 하락의 흐름을 만들고자합니다
**중점적으로 알고 싶은건 h>l*1.1이라는 조건을 최초만족했을때만 적용하고 그 이후로는 독립적인 조건으로 진행되게 할 수 있는지 입니다
감사합니다
2025-07-03
243
글번호 192248
답변완료
종목 검색식 부탁드립니다.
더위에 고생 많으십니다.
1. 일봉기준으로
주봉20이평 < 주봉60이평 일때
고가가 주봉60이평 위의 종목을 검색하고자 합니다.
(즉, 5일이내 고가가 잠시라도 주봉60이평을 돌파한 종목이 필요하다는 의미)
2. 30분봉기준으로
주봉20이평 < 주봉60이평 일때
고가가 주봉60이평 위의 종목을 검색하고자 합니다.
(즉, 5봉이내 고가가 잠시라도 주봉60이평을 돌파한 종목이 필요하다는 의미)
가능하시면 부탁드립니다.
항상 많은 도움에 감사드립니다.
2025-07-03
266
글번호 192247
답변완료
도움을 요청합니다.
본격 무더위가 시작되었습니다.
늘 도와주심에 감사드리고요
또 도움을 요청합니다.
=========================================
변수 v1 = data1(Upvol-DownVol);
변수 v2 =
SC= (C-O)/(H-L); //캔들의 몸통비율 산출
SCV = SC*v; //실제 몸통비율만큼 볼륨 값 산출
변수sum = v1+v2/2; //결론적으로 산출 방법이 다른 두 개의 볼륨을 합산, /2 평균값을 표현하고자 합니다.
추가로 피보나치비율 Plot 부탁드립니다.
=======================================================
늘 도와주심에 감사드립니다. 꾸벅
2025-07-02
318
글번호 192246