커뮤니티
예스랭귀지 Q&A
[공지] 예스랭귀지 AI 어시스턴트, '예스나 AI' 출시 및 무료 체험 안내
안녕하세요, 예스스탁 입니다.복잡한 수식 공부 없이 여러분의 아이디어를 말하면 시스템 트레이딩 언어 예스랭귀지로 작성해주는 서비스예스나 AI(YesNa AI)가 출시되었습니다.지금 예스나 AI를 직접 경험해 보실 수 있도록 20크레딧(질문권 20회)를 무료로 증정해 드리고 있습니다.바로 여러분의 아이디어를 코드로 변환해보세요.--------------------------------------------------🚀 YesNa AI 핵심 기능- 지표식/전략식/종목검색식 생성: 자연어로 요청하면 예스랭귀지 문법에 맞는 코드를 작성합니다.- 종목검색식 변환 지원: K증권의 종목 검색식을 예스랭귀지로 변환 지원합니다.- 컴파일 검증: 작성된 코드가 실행 가능한지 컴파일러를 통해 문법 검증을 거쳐 결과물을 제공합니다.상세한 서비스 개요 및 활용 방법은 [서비스 소개 페이지]에서 확인하실 수 있습니다.▶ 서비스 소개 페이지: 바로가기서비스 사용 유의사항 및 결제 환불정책은 [이용약관]을 참고 부탁드립니다.▶ 서비스 이용약관: 바로가기💬 이용 문의사용 중 문의사항은 [프로그램 사용법 Q&A] 게시판에서 [예스나 AI] 카테고리를 설정 후 문의해 주시면 상세히 안내해 드리겠습니다.--------------------------------------------------앞으로도 AI를 활용한 다양한 트레이딩 기능들을 지속적으로 선보일 예정입니다.많은 관심과 기대 부탁드립니다.
2026-02-27
1317
글번호 230811
답변완료
부탁드립니다
키움 지표입니다
예스트레이더 검색부탁드리겠습니다
wvf = ((highest(C, 12) - low) / highest(C, 12)) * 100;
sDev = 2.0 * stdev(wvf, 10);
midLine = avg(wvf, 10);
upperBand = midLine + sDev;
rangeHigh = (highest(wvf, 50)) * 0.25;
os = (wvf >= upperBand) or (wvf >= rangeHigh);
if(os,1,0);
if( ((os(1)>0 and os(2)>0 and os(3)>0 and os(4)>0) and os == 0), -wvf, 0);
2025-05-05
365
글번호 190579
답변완료
박스출력 수식작성 부탁드려요
안녕하세요
첨부한 사진처럼
TP와 SL을 표기하고 싶습니다.
그림과 상관없이 조건은 20이평 돌파시 당일20이평이 최고일때의 고가를 tp로 표기하고
sl은 당일20이평이 최저일때의 처가로 sl을 표기하고 싶습니다.
첨부한 그림처럼 텍스트로 sl값이 얼마인지 몇%의 손절인지 그리고 tp인 익절값이 얼마인지
진입가 대비 몇%인지를 표기할 수 있도록 부탁드립니다.
진입가는 20이평 돌파시의 종가로 해주시면 될것 같습니다.
사진처럼 박스의 컬러가 2가지로 표현되도록 부탁드립니다.
2025-05-06
401
글번호 190578
답변완료
macd를 C가 아닌 다른 변수를 넣고 만들고 싶습니다.
안녕하세요?
macd를 c가 아닌 다른 변수를 사용해서 만들고 싶습니다.
변수를 var1이라고 했을 때, var1을 이용해서 macd 12 26 9 를 만드는 수식을 부탁드립니다.
감사합니다.
2025-05-05
308
글번호 190577
답변완료
지표 변환 문의드립니다.
귀사의 무궁한 발전을 기원합니다
안녕하세요,수고 많으십니다
트레이딩뷰 지표를 예스트레이더로 변환해 주시면 대단히 감사하겠습니다.
주석이 좀 많네요.
챠트상에 봉그리기 비쥬얼은 구현하기 힘들면 넘어가시고, 매수,매도 신호만 ▲, ▼ 이런식으로 넣어 주시면 안될까요.
좋은 프로그램 만들어 주셔서 항상 잘 쓰고 있습니다.감사합니다.
++++++++++++++++++++++++++++++++++++++++++
// Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © QuantAlgo
//@version=6
indicator(title="Zero Lag Signals For Loop [QuantAlgo]", overlay=true)
// ╔════════════════════════════════╗ //
// ║ USER-DEFINED SETTINGS ║ //
// ╚════════════════════════════════╝ //
// Input Groups
var string zlag_settings = "════════ Zero Lag Settings ════════"
var string loop_settings = "════════ For Loop Settings ════════"
var string thresh_settings = "════════ Threshold Settings ════════"
var string visual_settings = "════════ Visualization Settings ════════"
// Tooltips
tooltip_zl_length = "Length of the Zero Lag calculation period. Higher values create smoother signals."
tooltip_vol_mult = "Multiplier for volatility in signal generation. Higher values make signals more conservative by requiring larger price movements."
tooltip_loop_start = "Starting point for the loop analysis. Lower values analyze more recent price action."
tooltip_loop_end = "Ending point for the loop analysis. Higher values analyze longer historical periods."
tooltip_thresh_up = "Minimum score required to generate uptrend signals. Higher values create stricter conditions."
tooltip_thresh_down = "Maximum score required to generate downtrend signals. Lower values create stricter conditions."
tooltip_signals = "Enable/disable signal markers on the chart"
tooltip_candles = "Enable/disable candle coloring based on trend direction"
tooltip_bg_lines = "Enable/disable vertical lines on signal changes"
// Zero Lag Settings
length = input.int(50, "Zero Lag Length",
minval=1,
group=zlag_settings,
tooltip=tooltip_zl_length)
volatility_mult = input.float(1.5, "Volatility Multiplier",
minval=0.1,
group=zlag_settings,
tooltip=tooltip_vol_mult)
// Loop Settings
loop_start = input.int(1, "Loop Start",
minval=1,
group=loop_settings,
tooltip=tooltip_loop_start)
loop_end = input.int(70, "Loop End",
minval=1,
group=loop_settings,
tooltip=tooltip_loop_end)
// Threshold Settings
threshold_up = input.int(5, "Threshold Uptrend",
group=thresh_settings,
tooltip=tooltip_thresh_up)
threshold_down = input.int(-5, "Threshold Downtrend",
group=thresh_settings,
tooltip=tooltip_thresh_down)
// Visualization Settings
bullcolor = input.color(#00ffaa, "Bullish Color", group=visual_settings)
bearcolor = input.color(#ff0000, "Bearish Color", group=visual_settings)
show_signals = input.bool(true, "Show Signal Markers",
group=visual_settings, tooltip=tooltip_signals)
paint_candles = input.bool(true, "Color Candles",
group=visual_settings, tooltip=tooltip_candles)
show_bg_lines = input.bool(false, "Signal Change Lines",
group=visual_settings, tooltip=tooltip_bg_lines)
// ╔════════════════════════════════╗ //
// ║ ZERO LAG CALCULATIONS ║ //
// ╚════════════════════════════════╝ //
lag = math.floor((length - 1) / 2)
zl_basis = ta.ema(close + (close - close[lag]), length)
volatility = ta.highest(ta.atr(length), length*3) * volatility_mult
// ╔════════════════════════════════╗ //
// ║ FOR LOOP ANALYSIS ║ //
// ╚════════════════════════════════╝ //
forloop_analysis(basis_price) =>
sum = 0.0
for i = loop_start to loop_end by 1
sum += (basis_price > basis_price[i] ? 1 : -1)
sum
score = forloop_analysis(zl_basis)
// ╔════════════════════════════════╗ //
// ║ SIGNAL GENERATION ║ //
// ╚════════════════════════════════╝ //
// Long/Short conditions
long_signal = score > threshold_up and close > zl_basis + volatility
short_signal = score < threshold_down and close < zl_basis - volatility
// Trend detection
var trend = 0
if long_signal
trend := 1
else if short_signal
trend := -1
// Track trend changes
var prev_trend = 0
trend_changed = trend != prev_trend
prev_trend := trend
// ╔════════════════════════════════╗ //
// ║ VISUALIZATION ║ //
// ╚════════════════════════════════╝ //
// Current trend color
trend_col = trend == 1 ? bullcolor : trend == -1 ? bearcolor : na
// Plot Zero Lag line
p_basis = plot(zl_basis, "Zero Lag Basis", color=trend_col, linewidth=3)
p_price = plot(hl2, "Price", display=display.none, editable=false)
// Fill between Zero Lag and price
fill(p_basis, p_price, hl2, zl_basis, na, color.new(trend_col, 20))
// Plot trend shift labels
plotshape(trend_changed and trend == 1 ? zl_basis : na, "Bullish Trend",
shape.labelup, location.absolute, bullcolor,
text="𝑳", textcolor=#000000, size=size.small, force_overlay=true)
plotshape(trend_changed and trend == -1 ? zl_basis : na, "Bearish Trend",
shape.labeldown, location.absolute, bearcolor,
text="𝑺", textcolor=#ffffff, size=size.small, force_overlay=true)
// Background signal lines
bgcolor(show_bg_lines ?
(ta.crossover(trend, 0) ? bullcolor :
ta.crossunder(trend, 0) ? bearcolor : na) : na)
// Color candles based on trend
barcolor(paint_candles ?
(trend == 1 ? bullcolor :
trend == -1 ? bearcolor : na) : na)
// ╔════════════════════════════════╗ //
// ║ ALERTS ║ //
// ╚════════════════════════════════╝ //
alertcondition(ta.crossover(trend, 0),
title="Zero Lag Signals Long",
message="Zero Lag Signals Long {{exchange}}:{{ticker}}")
alertcondition(ta.crossunder(trend, 0),
title="Zero Lag Signals Short",
message="Zero Lag Signals Short {{exchange}}:{{ticker}}")
// ╔════════════════════════════════╗ //
// ║ CREATED BY ║ //
// ╚════════════════════════════════╝
2025-05-08
582
글번호 190576
답변완료
문의드립니다
당일용인데요
시가 대비 일정 크기만큼 상승하거나 하락하면 봉이 만들어지게 하고 싶은데요
봉으로 나오게 하는건 불가능할거 같아서..
그냥 라인이나 박스형태로 또는 기타 모양으로 차트에 표시하게 하고 싶습니다
시가를 기준으로 일정크기 만큼 만들어지는데..
위로 10 상승하면 양봉(빨간색라인) 아래로 10 하락하면 음봉(블루라인)..
일단 상승 또는 하락이던 봉이 만들어진후는 다음봉은 만들어진 전봉기준으로 일정크기 움직인 만큼 다시 다음 봉을 만듭니다
전봉대비 10 상승하면 빨강라인?(박스? 점?)
전봉 대비 10 하락하면 블루라인(박스? 점?)
10 만큼 상승/하락하면 양봉/음봉 이런식 개념으로
처음에는 시가를 기준으로... 그 다음 부터는 전봉대비 움직이는 크기만큼 양봉, 음봉을 만든다는 개념입니다
일정한 크기만큼 움직였을때 양봉이던 음봉이던 완성되게..
분봉처럼 시간이 되야 봉이 완성되는게 아니라 움직인 크기가 충족되면 봉이 만들어지는
가장 최근것만 차트에 나오지 않고 .. 장시작후 계속 양봉/음봉을 그려간다는
개념으로 시가 부터 시작해 계속 표시되었으면 합니다
감사합니다
2025-05-06
333
글번호 190575
요타 님에 의해서 삭제되었습니다.
2025-05-04
2
글번호 190574
답변완료
검색식 부탁드립니다
수식]
A= (highest(high,shortPeriod)+lowest(low,shortPeriod))/2;
B = MA(C, 기간, 지수);
crossup(A,B) &&
C > O
지표변수]
shortPeriod 9
기간 120
감사합니다
2025-05-04
394
글번호 190573
답변완료
종목검색식 요청드립니다.
아래 키움신호를 만족하는 종목검색식을 만들고 싶습니다. 도움 부탁드립니다.
* 키움신호 (이평1-5, 이평2-20, 이평3-60)
M5=Ma(c,이평1,가중);
M20=Ma(c,이평2,가중);
M60=Ma(c,이평3,가중);
조건=crossup(M5,M20);
조건1=crossup(M5,M60);
A=Valuewhen(1,조건,M5);
B=Valuewhen(1,조건1,M60);
A=B and Crossup(C,A) and crossup(C,B) and C>M20
2025-05-04
411
글번호 190572
답변완료
기존시스템에 진입수정 신고저에 의한 진입조건
안녕 하세요 항상 감사합니다 많이도움받고 있읍니다
기존에 시스템도움받아 테스트기간동안 에러같은거는 발생하지않고 신호는
잘나와 주고있어요
주문관련 -+10틱정도제공되고 주문지연이나 시간정정은 있으나
미체결 시간경과에대한 자동취소는 제공되지않는게 아쉽습니다
그래서 죄송하지만 한번더 도움 받고자합니다
아래시스템 수식은 타주기 지표조합으로 진입시간청산시간
손익절이 들어간 시스템식입니다
{수정사항은 타분봉 데이타2,3 macd 0선이상이하 골든데드크로스 유지에서
신호일치는 기존과 동일합니다
데이터2,3 조건일치후 진입분봉 타점 수정부탁드립니다.
*추가사항 신고가(N일) 신저가(N일) 지표에는 이름이 이렇게 나옵니다
분봉으로 추가해보았는데 파일처럼 추가는 돼네요
(예시)로 1분봉상 100봉 신고가 추가해보왔어요 타분봉 데이타2,3이 매도조건이면
*진입봉에서 N(20)봉 기간동안 신고가 신호가 발생하였다면 macd선 0선하향돌파시
매도진입 입니다. 매수조건은 반대입니다.
기존방식 진입분봉 macd 0선 상하향돌파진입에서 N(20)봉 기간동안 신고가,신저가 추가
*청산조건 스탑로스 도달하거나 타주기 분봉데이타2 or 3 0선상관없이 macd선과 시그널
골든데드크로스시 청산합니다
-----------------------------------------------
input : short(12),long(26),sig(9);
input : 진입시작시간(230000),당일청산시간(020000),손절틱(100),감시틱(70),되돌림틱(20);
var : S1(0),D1(0),TM(0),EP1(0),EP2(0),EP3(0);
var : macdv(0,Data1),macds(0,Data1);
var : macdv1(0,Data2),macds1(0,Data2);
var : macdv2(0,Data3),macds2(0,Data3);
macdv = data1(macd(short,long));
macds = data1(Ema(macdv,sig));
macdv1 = data2(macd(short,long));
macds1 = data2(Ema(macdv1,sig));
macdv2 = data3(macd(short,long));
macds2 = data3(Ema(macdv2,sig));
if sDate != sDate[1] Then
SetStopEndofday(당일청산시간);
if Bdate != Bdate[1] Then
SetStopEndofday(0);
var : Tcond(False),OO(0),HH(0),LL(0),CC(0);
if (sdate != sDate[1] and sTime >= 당일청산시간) or
(sdate == sDate[1] and sTime >= 당일청산시간 and sTime[1] < 당일청산시간) Then
Tcond = false;
if (sdate != sDate[1] and sTime >= 진입시작시간) or
(sdate == sDate[1] and sTime >= 진입시작시간 and sTime[1] < 진입시작시간) Then
Tcond = true;
if Tcond == true Then
{
if MarketPosition <= 0 and CrossUp(MACDV,0) and MACDV1 > 0 and MACDV2 > 0 and
macdv > macds and macdv1 > macds1 and macdv2 > macds2 Then
Buy();
if MarketPosition >= 0 and CrossDown(MACDV,0) and MACDV1 < 0 and MACDV2 < 0 and
macdv < macds and macdv1 < macds1 and macdv2 < macds2 Then
Sell();
if MarketPosition == 1 and CrossDown(MACDV,0) Then
ExitLong();
if MarketPosition == -1 and CrossUp(MACDV,0) Then
ExitShort();
if MarketPosition == 1 Then
{
if highest(H,BarsSinceEntry) >= EntryPrice+PriceScale*감시틱 Then
ExitLong("bx",AtStop,highest(H,BarsSinceEntry)-PriceScale*되돌림틱);
}
if MarketPosition == -1 Then
{
if lowest(L,BarsSinceEntry) <= EntryPrice-PriceScale*감시틱 Then
ExitShort("sx",AtStop,lowest(L,BarsSinceEntry)+PriceScale*되돌림틱);
}
}
SetStopLoss(PriceScale*손절틱,PointStop);
*감사합니다
2025-05-04
416
글번호 190571