커뮤니티
예스랭귀지 Q&A
답변완료
[공지] 예스랭귀지 AI 어시스턴트, '예스나 AI' 출시 및 무료 체험 안내
안녕하세요, 예스스탁 입니다.복잡한 수식 공부 없이 여러분의 아이디어를 말하면 시스템 트레이딩 언어 예스랭귀지로 작성해주는 서비스예스나 AI(YesNa AI)가 출시되었습니다.지금 예스나 AI를 직접 경험해 보실 수 있도록 20크레딧(질문권 20회)를 무료로 증정해 드리고 있습니다.바로 여러분의 아이디어를 코드로 변환해보세요.--------------------------------------------------🚀 YesNa AI 핵심 기능- 지표식/전략식/종목검색식 생성: 자연어로 요청하면 예스랭귀지 문법에 맞는 코드를 작성합니다.- 종목검색식 변환 지원: K증권의 종목 검색식을 예스랭귀지로 변환 지원합니다.- 컴파일 검증: 작성된 코드가 실행 가능한지 컴파일러를 통해 문법 검증을 거쳐 결과물을 제공합니다.상세한 서비스 개요 및 활용 방법은 [서비스 소개 페이지]에서 확인하실 수 있습니다.▶ 서비스 소개 페이지: 바로가기서비스 사용 유의사항 및 결제 환불정책은 [이용약관]을 참고 부탁드립니다.▶ 서비스 이용약관: 바로가기💬 이용 문의사용 중 문의사항은 [프로그램 사용법 Q&A] 게시판에서 [예스나 AI] 카테고리를 설정 후 문의해 주시면 상세히 안내해 드리겠습니다.--------------------------------------------------앞으로도 AI를 활용한 다양한 트레이딩 기능들을 지속적으로 선보일 예정입니다.많은 관심과 기대 부탁드립니다.
2026-02-27
4366
글번호 230811
답변완료
수식 부탁드립니다
지표식 부탁 드립니다.
indicator(title='Weighted Orderflow', precision = 3, overlay=false, explicit_plot_zorder = true)
// Input parameters
useSmoothing = input.bool(true, "Smooth OrderFlow?", group = "Calculation Parameters")
orderFlowWindow = input.int(12, minval=1, title='Order Flow Period', group = "Calculation Parameters")
smoothingLength = input.int(10, minval=1, title='Order Flow HMA Smoothing Length', group = "Calculation Parameters")
// Colors
upColor = input(#00ffbb, "Up Colour")
downColor = input(#ff1100, "Down Colour")
// Order Flow Calculation
efficiency = math.abs(close-open)/volume
orderFlow = math.sum((close > close[1] ? volume : (close < close[1] ? -volume : 0)) * efficiency, orderFlowWindow) / math.sum(efficiency, orderFlowWindow)
orderFlow := useSmoothing ? ta.hma(orderFlow, smoothingLength) : orderFlow
pine_vwrma(x, y) =>
ta.rma(x * volume, y) / ta.rma(volume, y)
// Standard Deviation Calculation
stdDev = ta.stdev(orderFlow, 45) * 1
normalizedOrderFlow = orderFlow/(stdDev + stdDev)
// Plotting Order Flow Columns
gap = 0.4
midu = plot(gap, "Basis", color = color.blue, display = display.none)
mmm = plot(0, "Basis", color = color.new(close > 0 ? upColor : downColor, 3), display = display.all)
midl = plot(-gap, "Basis", color = color.blue, display = display.none)
upu = plot(1.5+gap, "upper", color = color.blue, display = display.none)
uuu = plot(1.5, "upper", color = color.blue, display = display.none)
upl = plot(1.5-gap, "upper", color = color.blue, display = display.none)
lpu = plot(-1.5+gap, "lower", color = color.blue, display = display.none)
lll = plot(-1.5, "lower", color = color.blue, display = display.none)
lpl = plot(-1.5-gap, "lower", color = color.blue, display = display.none)
plot(math.avg(gap, 1.5-gap), "Upper Inter Range", color.new(chart.fg_color, 80), 1, plot.style_circles)
plot(math.avg(-gap, -1.5+gap), "Lower Inter Range", color.new(chart.fg_color, 80), 1, plot.style_circles)
fill(upu, uuu, 1.5+gap, 1.5, color.new(downColor, normalizedOrderFlow > 0 ? 20 : 60), color.new(downColor, normalizedOrderFlow > 0 ? 50 : 80), "Upper Cloud")
fill(upl, uuu, 1.52, 1.5-gap, color.new(downColor, 80), color.new(downColor, 99), "Upper Cloud")
fill(lpl, lll, -1.5, -1.5-gap, color.new(upColor, normalizedOrderFlow < 0 ? 50 : 80), color.new(upColor, normalizedOrderFlow < 0 ? 20 : 60), "lower Cloud")
fill(lpu, lll, -1.5+gap, -1.5, color.new(upColor, 99),color.new(upColor, 80), "lower Cloud")
transparencyControl1 = 30
chg1 = normalizedOrderFlow * 0.80
chg2 = normalizedOrderFlow * 0.60
chg3 = normalizedOrderFlow * 0.40
chg4 = normalizedOrderFlow * 0.20
plot(normalizedOrderFlow, color = color.new(normalizedOrderFlow > 0 ? upColor : downColor, transparencyControl1+60), style = plot.style_columns, linewidth = 4)
plot(chg1, color = color.new(normalizedOrderFlow > 0 ? upColor : downColor, transparencyControl1+55), style = plot.style_columns, linewidth = 4)
plot(chg2, color = color.new(normalizedOrderFlow > 0 ? upColor : downColor, transparencyControl1+40), style = plot.style_columns, linewidth = 4)
plot(chg3, color = color.new(normalizedOrderFlow > 0 ? upColor : downColor, transparencyControl1+30), style = plot.style_columns, linewidth = 4)
plot(chg4, color = color.new(normalizedOrderFlow > 0 ? upColor : downColor, transparencyControl1+25), style = plot.style_columns, linewidth = 4)
plot(normalizedOrderFlow, color = color.new(normalizedOrderFlow > 0 ? upColor : downColor, transparencyControl1))
plotchar(ta.crossunder(normalizedOrderFlow, 1.5) ? 2.1 : na, "Bearish Reversal", "▼", location.absolute, downColor, size = size.tiny)
plotchar(ta.crossover(normalizedOrderFlow, -1.5) ? -2.1 : na, "Bullish Reversal", "▲", location.absolute, upColor, size = size.tiny)
2025-06-19
530
글번호 191936
답변완료
부탁드립니다
수고하십니다
예스로 부탁드립니다
// INPUTS ――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――{
int length = input.int(100, "Lookback Period")
float channel_width = input.float(1.5, "Channel Width", step = 0.1)
int channel_len = input(100, "Channel Length")
bool mid_disp = input.bool(true, "Mid Line", inline = "s")
bool fill_band = input.bool(true, "Fill Band", inline = "s")
color col1 = input.color(#21dfac, "", inline = "s1")
color col2 = input.color(#df216d, "", inline = "s1")
// }
// CALCULATIONS――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――{
// Function to compute logarithmic regression
f_log_regression(src, length) =>
float sumX = 0.0
float sumY = 0.0
float sumXSqr = 0.0
float sumXY = 0.0
for i = 0 to length - 1
val = math.log(src[i])
per = i + 1.0
sumX += per
sumY += val
sumXSqr += per * per
sumXY += val * per
slope = (length * sumXY - sumX * sumY) / (length * sumXSqr - sumX * sumX)
average = sumY / length
intercept = average - slope * sumX / length + slope
[slope, intercept]
// Calculate slope and intercept
[slope, intercept] = f_log_regression(close, length)
float start = math.exp(intercept + slope * length)
float end = math.exp(intercept)
float diff = end - end[3]
float deviation = ta.stdev(close, length)
bool up_sig = ta.crossover(diff, 0) and barstate.isconfirmed
bool dn_sig = ta.crossunder(diff, 0) and barstate.isconfirmed
// }
// PLOT ――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――{
// Define Colors
color color_up = color.from_gradient(diff, ta.lowest(diff,200), ta.highest(diff,200), na, col1)
color color_dn = color.from_gradient(diff, ta.lowest(diff,200), ta.highest(diff,200), col2, na)
color channel_col = end > start ? col1 : col2
color trend_col = end > end[3] ? color_up : color_dn
color trend_col1 = end > end[3] ? col1 : col2
p1 = plot(end, "Log Regression", color = trend_col1, linewidth = 2)
p2 = plot(end[3], color = trend_col, display = display.none, editable = false)
plotshape(up_sig ? end : na, "Up", shape.xcross, location.absolute, chart.fg_color, size = size.tiny)
plotshape(dn_sig ? end : na, "Dn", shape.xcross, location.absolute, chart.fg_color, size = size.tiny)
fill(p1, p2, fill_band ? trend_col : na)
// Define upper and lower channel based on standard deviation
var line up1 = na
var line up = na
var line base = na
var line lw = na
var line lw1 = na
var label lbl_t = na
if na(base) and mid_disp
base := line.new(bar_index[channel_len], start, bar_index, end, style = line.style_dashed)
else
base.set_xy1(bar_index[channel_len], start)
base.set_xy2(bar_index, end)
base.set_color(chart.fg_color)
if na(up1)
up1 := line.new(bar_index[channel_len], start+deviation*(channel_width+0.3), bar_index, end + deviation*(channel_width+0.3), width = 3)
else
up1.set_xy1(bar_index[channel_len], start+deviation*(channel_width+0.3))
up1.set_xy2(bar_index, end + deviation*(channel_width+0.3))
up1.set_color(channel_col)
if na(up)
up := line.new(bar_index[channel_len], start+deviation*channel_width, bar_index, end + deviation*channel_width, width = 1)
else
up.set_xy1(bar_index[channel_len], start+deviation*channel_width)
up.set_xy2(bar_index, end + deviation*channel_width)
up.set_color(na)
if na(lw)
lw := line.new(bar_index[channel_len], start-deviation*channel_width, bar_index, end - deviation*channel_width, width = 1)
else
lw.set_xy1(bar_index[channel_len], start-deviation*channel_width)
lw.set_xy2(bar_index, end - deviation*channel_width)
lw.set_color(na)
if na(lw1)
lw1 := line.new(bar_index[channel_len], start-deviation*(channel_width+0.3), bar_index, end - deviation*(channel_width+0.3), width = 3)
lbl_t := label.new(bar_index[channel_len], start-deviation*(channel_width+0.3))
else
lw1.set_xy1(bar_index[channel_len], start-deviation*(channel_width+0.3))
lw1.set_xy2(bar_index, end - deviation*(channel_width+0.3))
lw1.set_color(channel_col)
lbl_t.set_xy(bar_index[channel_len], start-deviation*(channel_width+0.3))
lbl_t.set_text(end > start ? "UP" : "DN")
lbl_t.set_style((end < start ? label.style_label_lower_right : label.style_label_upper_right))
lbl_t.set_color(channel_col)
lbl_t.set_textcolor(#070f23)
// Fill Channel Upper and Lower Zones with color
linefill.new(lw, lw1, color.new(channel_col, 70))
linefill.new(up, up1, color.new(channel_col, 70))
// Info Dash
if barstate.islast
dash = table.new(position.top_right, 10, 10, bgcolor = color.new(chart.fg_color, 90), border_color = chart.bg_color, border_width = 5)
dash.cell(0, 0, "Slope: " + str.tostring(slope*100, "#,###.###"), text_color = chart.fg_color)
dash.cell(0, 1, "Log Regression Channel: " + (end > start ? "UP" : "DN"), text_color = channel_col)
dash.cell(0, 2, "Logarithmic Regression: " + (end > end[3] ? "UP" : "DN"), text_color = color.new(trend_col, 0))
// }
2025-06-19
444
글번호 191934
답변완료
시뮬레이션 돌리는 법 문의
안녕하세요?
시뮬레이션 돌리는 법 문의 드립니다.
실제 과거데이터로 시뮬레이션을 돌려 보면,
SetStopProfittarget(StopTrailingPrice, PointStop);
SetStopTrailing(1, StopTrailingPrice, PointStop);
은 아주 큰 차이를 보입니다.
실제 상황이랑, 이 2개 함수간에 어떤 차이가 있는지 알듯, 말듯 합니다.
그리고, 실제 상황과 가장 유사한, 추천하시는 시뮬레이션 방법에 대해 알려주십시요.
2025-06-19
410
글번호 191930
2685up 님에 의해서 삭제되었습니다.
2025-06-19
13
글번호 191929
답변완료
질문 부탁드립니다
답변감사합니다
plot((iff(condition3 == true,1,0)) 으로 확인을 해보면
하루중에 조건 (aa[0]<h and aa[0]>l) 을 만족하게 되는 봉이 나타나면 그 다음봉이
aa[0]<h and aa[0]>l 조건을 만족하지 않아도 계속 true 로 나타나고 다음 거래일이 되면 false 가 되는데요
분봉상 조건검색이 뭘 의미하는지 개념을 잘몰라서 그런지 뭔가 이해가 잘 안가는데요
조건만족시 Condition3를 true 로 설정해놓는것과 find 를 하는것의 관계를 잘 모르겠습니다
true 로 했다가 거래일이 변경되면 다시 false 로 리셋을 하는거 같은데..
"오늘 당일날 봉들중에서 하나라도 조건에 맞으면 검색하라 " 이런 의미는 아닌건가요?
if Bdate != Bdate[1] Then
{
Condition3=False;
}
...
if Condition3==False and (aa[1]<h and aa[1]>l) Then
{
Condition3=true;
Find(1);
}
질문2)
그럼 혹시 그냥 단순하게 분봉 차트로 봤을때, 지금 현재봉만 (가장 최근봉) 가지고 봤을때 aa[1]<h and aa[1]>l 조건 만족하는걸 찾게 하는건 안될까요?? 일봉에서 하는거처럼요.
그리고 질문1에서 말한거처럼 분봉상 당일날 한번이라도 그런봉이 나오면 검색하게 해주는 식은
작성이 가능할까요?
감사합니다
2025-06-19
272
글번호 191923
답변완료
부탁드립니다
아래수식을 검색식으로 만들어 주시면 감사하겠습니다.
A=Predayhigh()-Predaylow();
B=Dayopen()+a*0.5;
B1=RSI(2);
Crossup(C,B) and B1>50
2025-06-19
333
글번호 191922
답변완료
문의
국내주간선물 5분봉 기준입니다.
아래수식은 수량 1개로 운영하는 수식입니다.
요청사항)
첫진입때 수량 2개를 진입시키고
1개씩 청산수식을 따로 적용하여 청산하고 싶습니다.
첫번째 청산수식(2개에서 1개)
SetStopLoss(1,PointStop);
SetStopTrailing(2,0,PointStop);
두번째 청산수식(나머지 1개)
SetStopLoss(2,PointStop);
SetStopTrailing(3,0,PointStop);
수식 완성 부탁드립니다.
항상 고맙습니다.
*****************************************************************************
input : upfs(575);
var : T1(0),entry(0);
if Bdate != Bdate[1] Then
T1 = TotalTrades;
if MarketPosition == 0 Then
entry = TotalTrades-T1;
Else
entry = (TotalTrades-T1)+1;
if data1(Bdate)==data2(Bdate) and Data2(c>Lowd(0)+upfs) and entry==0 Then
Buy("b");
SetStopLoss(1,PointStop);
SetStopTrailing(2,0,PointStop);
2025-06-19
275
글번호 191921
답변완료
분봉9분봉에서 지금분봉이 최고값으로 변환 부탁드려요 항상 감사하고 있슴미다
실력이 안되서 정말 죄송함미다 건강하세요
분봉 9 분봉에서 지금 9 분봉이 41봉 최고 높은값이 나올때 종목검색 할수 있게 수정부탁 드려요
항상 감사하고 있슴미다 건강하세요
input : AvgLen(7);
var : xclose(0),xopen(0),xvolume(0),nVolAccum(0),nRes(0);
PlotBaseLine1(0,"line",red);
xClose = close;
xOpen = open;
xVolume = volume;
nVolAccum = AccumN(iff(xClose > xOpen, xVolume, iff(xClose < xOpen, -xVolume, 0)) ,AvgLen);
nRes = nVolAccum / AvgLen;
2025-06-19
274
글번호 191920
답변완료
검색식 부탁드립니다
50일 동안 고점 대비 저점이 10% 이내에서 횡보하다가 50일 평균 거래량보다 500% 이상 거래량이 터지면서 고점을 돌파하고,
전일 종가 대비 당일 종가가 10% 이상인 양봉인 종목을 검색하고싶습니다
기간, 횡보율, 거래량, 전일대비 당일 종가 상승률은 변수 처리 부탁합니다.
2025-06-19
279
글번호 191911