커뮤니티
예스랭귀지 Q&A
[공지] 예스랭귀지 AI 어시스턴트, '예스나 AI' 출시 및 무료 체험 안내
안녕하세요, 예스스탁 입니다.복잡한 수식 공부 없이 여러분의 아이디어를 말하면 시스템 트레이딩 언어 예스랭귀지로 작성해주는 서비스예스나 AI(YesNa AI)가 출시되었습니다.지금 예스나 AI를 직접 경험해 보실 수 있도록 20크레딧(질문권 20회)를 무료로 증정해 드리고 있습니다.바로 여러분의 아이디어를 코드로 변환해보세요.--------------------------------------------------🚀 YesNa AI 핵심 기능- 지표식/전략식/종목검색식 생성: 자연어로 요청하면 예스랭귀지 문법에 맞는 코드를 작성합니다.- 종목검색식 변환 지원: K증권의 종목 검색식을 예스랭귀지로 변환 지원합니다.- 컴파일 검증: 작성된 코드가 실행 가능한지 컴파일러를 통해 문법 검증을 거쳐 결과물을 제공합니다.상세한 서비스 개요 및 활용 방법은 [서비스 소개 페이지]에서 확인하실 수 있습니다.▶ 서비스 소개 페이지: 바로가기서비스 사용 유의사항 및 결제 환불정책은 [이용약관]을 참고 부탁드립니다.▶ 서비스 이용약관: 바로가기💬 이용 문의사용 중 문의사항은 [프로그램 사용법 Q&A] 게시판에서 [예스나 AI] 카테고리를 설정 후 문의해 주시면 상세히 안내해 드리겠습니다.--------------------------------------------------앞으로도 AI를 활용한 다양한 트레이딩 기능들을 지속적으로 선보일 예정입니다.많은 관심과 기대 부탁드립니다.
2026-02-27
1363
글번호 230811
답변완료
수식문의입니다
Array : WeekO[20](0),WeekC[20](0);
Array : MonthO[20](0),MonthC[20](0);
Array : YearO[20](0),YearC[20](0);
if DayOfWeek(Bdate) < DayOfWeek(Bdate[1]) Then
{
WeekO[0] = O; #주봉시작일의 시가
For cnt = 1 to 19
{
WeekO[cnt] = WeekO[cnt-1][1];
WeekC[cnt] = WeekC[cnt-1][1];
}
WeekOC = C ; #주봉시작(변경)일의 캔들종가
WeekOL = L ; #주봉시작(변경)일의 캔들저가
}
WeekC[0] = C; #주봉의 종가
if Bdate > Bdate[1]+30 Then
{
MonthO[0] = O; #월봉시작일의 캔들시가
For cnt = 1 to 19
{
MonthO[cnt] = MonthO[cnt-1][1];
MonthC[cnt] = MonthC[cnt-1][1];
}
MonthOC = C ; #월봉시작일의 캔들종가
}
MonthC[0] = C;
if Bdate > Bdate[1]+1000 Then
{
YearO[0] = O; #연봉시작일의 캔들시가
For cnt = 1 to 19
{
YearO[cnt] = YearO[cnt-1][1];
YearC[cnt] = YearC[cnt-1][1];
}
}
YearC[0] = C;
1. 신호수식>>
위의 수식을 활용하여 주봉차트상에서 매월 마지막주의 주봉캔들이 양봉인 경우의 매수신호 수식을 요청드리는 것으로, 다만 마지막주의 주봉캔들 시가가 이평 20주선보다 낮은 경우에는 추가조건으로서 이 캔들의 저가는 20주중 최저가이어야 하고, 20주선보다 시가가 높은 경우에는 양봉이면서 주봉캔들 종가는 해당월의 월시가와 5주선보다 높아야 합니다.
2. 지표수식>>
위 주봉의 시가선(WeekO[0])은 일봉차트상에서 계단식으로 라인이 표시되는데요, 이 라인이 변동될때마다(한주가 변동될때마다) 현재의 주 시작일 봉 저가-표시위치를 입력변수로 설정되게 요망-에 0, 이전주에는 1, 그 이전주는 2....이런씩으로 현재에서 과거로 20개정도 표시되게 할 수 있는 수식을 요청드립니다.
2024-10-31
807
글번호 184817
답변완료
수식작성 요청드립니다.
예를들어,
10월1일날 종목을 매수 했다고 치면,
매수한 10월1일날 "저가"를 손절가격으로 정하고
10월 2일 이후로 (10.3일이든 10.5일이든) 10월1일 저가를 이탈하면 손절하는 수식을 요청드립니다.
항상 도움을 주셔서 감사합니다.
2024-10-30
655
글번호 184816
답변완료
수고하십니다
항상 노고에 감사하며
변환 부탁드립니다
indicator("Zero-Lag MA Trend Levels [ChartPrime]", overlay = true)
// --------------------------------------------------------------------------------------------------------------------}
// 𝙐𝙎𝙀𝙍 𝙄𝙉𝙋𝙐𝙏𝙎
// --------------------------------------------------------------------------------------------------------------------{
int length = input.int(15, title="Length") // Length for the moving average calculations
bool show_levl = input.bool(true, "Trend Levels") // Toggle to show trend levels
// Colors for the trend levels
color up = input.color(#30d453, "+", group = "Colors", inline = "i")
color dn = input.color(#4043f1, "-", group = "Colors", inline = "i")
var box1 = box(na) // Variable to store the box
series float atr = ta.atr(200) // Average True Range (ATR) for trend levels
// --------------------------------------------------------------------------------------------------------------------}
// 𝙄𝙉𝘿𝙄𝘾𝘼𝙏𝙊𝙍 𝘾𝘼𝙇𝘾𝙐𝙇𝘼𝙏𝙄𝙊𝙉𝙎
// --------------------------------------------------------------------------------------------------------------------{
series float emaValue = ta.ema(close, length) // EMA of the closing price
series float correction = close + (close - emaValue) // Correction factor for zero-lag calculation
series float zlma = ta.ema(correction, length) // Zero-Lag Moving Average (ZLMA)
bool signalUp = ta.crossover(zlma, emaValue) // Signal for bullish crossover
bool signalDn = ta.crossunder(zlma, emaValue) // Signal for bearish crossunder
// Determine the color of ZLMA based on its direction
color zlma_color = zlma > zlma[3] ? up : zlma < zlma[3] ? dn : na
color ema_col = emaValue < zlma ? up : dn // Determine the EMA color
// --------------------------------------------------------------------------------------------------------------------}
// 𝙑𝙄𝙎𝙐𝘼𝙇𝙄𝙕𝘼𝙏𝙄𝙊𝙉
// --------------------------------------------------------------------------------------------------------------------{
// Plot the Zero-Lag Moving Average
p1 = plot(zlma, color = zlma_color, linewidth = 1) // Plot ZLMA
p2 = plot(emaValue, color = ema_col, linewidth = 1) // Plot EMA
fill(p1, p2, zlma, emaValue, color.new(zlma_color, 80), color.new(ema_col, 80)) // Fill between ZLMA and EMA
// Method to draw a box on the chart
method draw_box(color col, top, bot, price)=>
box.new(
bar_index, top, bar_index, bot, col, 1,
bgcolor = color.new(col, 90),
text = str.tostring(math.round(price, 2)),
text_size = size.tiny,
text_color = chart.fg_color,
text_halign = text.align_right
)
// Logic to draw trend levels as boxes on the chart
if show_levl
bool check_signals = signalUp or signalDn // Check if there is an up or down signal
switch
// Draw a box when a bullish signal is detected
signalUp => box1 := up.draw_box(zlma, zlma - atr, close)
// Draw a box when a bearish signal is detected
signalDn => box1 := dn.draw_box(zlma + atr, zlma, close)
switch
// Extend the right side of the box if no new signal is detected
not signalUp or not signalDn => box1.set_right(bar_index + 4)
=> box1 := box(na) // Otherwise, reset the box
switch
// Add a downward label when price crosses below the bottom of the box
ta.crossunder(high, box1.get_bottom()) and not check_signals[1] and not check_signals and emaValue > zlma=>
label.new(bar_index - 1, high[1], "▼", color = color(na), textcolor = dn, style = label.style_label_down)
// Add an upward label when price crosses above the top of the box
ta.crossover(low, box1.get_top()) and not check_signals and not check_signals[1] and emaValue < zlma=>
label.new(bar_index - 1, low[1], "▲", color = color(na), textcolor = up, style = label.style_label_up)
// Plot shapes for up and down signals
plotshape(signalUp ? zlma : na, "", shape.diamond, location.absolute, color = up, size = size.tiny)
plotshape(signalDn ? zlma : na, "", shape.diamond, location.absolute, color = dn, size = size.tiny)
// --------------------------------------------------------------------------------------------------------------------}
2024-10-30
1058
글번호 184815
답변완료
종목검색식 부탁드림니다.
항상 노고에 감사드림니다.
아래의 수식을 종목검색식으로 부탁드림니다.
A1 =ma(C, 2);
A2 =ma(C, 20);
A3 =ma(C, 60);
이격률 =A2/A3*100-100;
조건=
H> C(1)*1.15 &&
C> C(1)*1.1 &&
거래대금>=10000 &&
RSI(14)>=70;
조건 &&
Crossup(C, A2 && Crossup(C, A3) &&
이격률> -7 && 이격률 <7)
2024-10-31
758
글번호 184814
답변완료
키움의 지표를 Yes에 만들고 싶습니다. 부탁드립니다.
수고하십니다. 아래 키움의 지표 수식을 예스에 구현하고 싶습니다.
부탁드립니다.
키움 수식 : 상,하 2개 지표를 만들고 싶습니다.
기준봉=C/C(1)*100-100>=상승율 && 거래대금/100>=기준액 ;
HC=highest(C,상기간) ;
LL=lowest(L,하기간) ;
Bnt=BarsSince(C==HC) ;
상=valuewhen(1,기준봉 && HC,HC) ;
하=valuewhen(1,LL>0,LL) ;
수고하세요
2024-10-30
786
글번호 184813
답변완료
문의 드립니다
안녕하세요
트레이딩지표 전환 부탁드립니다
1.
res1 = input(title="Close Time Frame", type=resolution, defval="D")
cld=security(tickerid, res1, close[1])
opd=security(tickerid,res1, open[1])
tu=(cld +opd)/2
plot( tu, "Breakout",color=black ,style=line,linewidth=2,transp=0)
2.다음지표에 현재가을 추가해주세요
input : Periods(10);
input : Multiplier(3.0);
input : changeATR(1);#1:SMA 0:RMA
var : src(0),alpha(0),source(0),ATR1(0),ATR2(0),ATRV(0);
var : up(0),up1(0),dn(0),dn1(0),trend(0),tx(0);
src = (H+L)/2;
alpha = 1 / Periods;
atr1 = IFf(IsNan(atr1[1]) == true , ma(TrueRange, Periods) , alpha * TrueRange + (1 - alpha) * atr1[1]);
atr2 = ATR(Periods);
atrv = IFf(changeATR == 1 , atr1 , atr2);
up=src-(Multiplier*atrv);
up1 = IFf(IsNan(up[1]) == False,up[1],up);
up = iff(close[1] > up1 , max(up,up1) , up);
dn=src+(Multiplier*atrv);
dn1 = IFf(IsNan(dn[1]) == False,dn[1], dn);
dn = iff(close[1] < dn1 , min(dn, dn1) , dn);
trend = 1;
trend = IFf(IsNan(trend[1]) == False,trend[1], trend);
trend = IFf(trend == -1 and close > dn1 , 1 , iff(trend == 1 and close < up1 , -1 , trend));
if trend == 1 Then
plot1(up,"UpTrend",green);
Else
NoPlot(1);
if trend == -1 then
Plot2(dn,"Down Trend",red);
Else
NoPlot(2);
if trend == 1 and trend[1] == -1 Then
{
tx =Text_New(sDate,sTime,up,"●");
Text_SetStyle(tx,2,2);
Text_SetColor(tx,Green);
}
if trend == -1 and trend[1] == 1 Then
{
tx =Text_New(sDate,sTime,dn,"●");
Text_SetStyle(tx,2,2);
Text_SetColor(tx,Red);
}
감사합니다
2024-10-31
724
글번호 184812
2wnwn 님에 의해서 삭제되었습니다.
2024-10-30
36
글번호 184811
답변완료
추가 질문드립니다.
1.첨부파일에서 a지표가 기준선을 cross down 하기 직전 a지표의 가장 높은 고점을 표현 할 수 있는가요?
89736번 질문에서 제가 질문을 잘못 드린 것 같습니다. 보조지표로 그리는 게 아니구
cross down 하기 직전의 a지표의 가장 높은 고점값을 수식에 자동으로 인식하여 직전고점이 얼마 이하면 진입을 제한해보려고 합니다. 고점값을 구하는 식을 좀 부탁드립니다.(참고로 vr지표입니다.기준선은 300 입니다.)
2024-10-30
787
글번호 184810
답변완료
순매수체결량 30분전보다 우상향 검색식
안녕하세요
순매수체결량을 어찌어찌해서 잘 활용하고 있습니다
//Upvol "상승형 체결거래량";
//DownVol "하락형 체결거래량"
input: 막대굵기 (1);
var : sumPL(0);
if sDate != sDate[1] Then
{
sumPL = 0;
}
Else
{
sumPL = sumPL + (Upvol-DownVol);
if sumPL > 0 Then
Plot1(sumPL, "순매수체결량", RgB(255,0,0), Def, 막대굵기 );
Else
Plot1(sumPL, "순매수체결량", RgB(0,0,255), Def, 막대굵기 );
}
PlotBaseLine1(0, "기준선0");
지표수식은 위에 것으로 쓰고 있지만 뭐가 뭔지 거의 모릅니다
이걸 종목검색으로 활용하고 싶어서 순매수체결량이 30분전보다 증가한 종목을 찾고 싶어서 검색식을 만들어볼려고 합니다
아래부분에다
if var1>var1[30] then
find(1);
이렇게 붙여넣으면 될 줄 알았는데 검증을 클릭하면 오류라고 뜨네요
도움을 주실 수 있는지요? 꾸벅
2024-10-30
758
글번호 184807