커뮤니티
예스랭귀지 Q&A
답변완료
[공지] 예스랭귀지 AI 어시스턴트, '예스나 AI' 출시 및 무료 체험 안내
안녕하세요, 예스스탁 입니다.복잡한 수식 공부 없이 여러분의 아이디어를 말하면 시스템 트레이딩 언어 예스랭귀지로 작성해주는 서비스예스나 AI(YesNa AI)가 출시되었습니다.지금 예스나 AI를 직접 경험해 보실 수 있도록 20크레딧(질문권 20회)를 무료로 증정해 드리고 있습니다.바로 여러분의 아이디어를 코드로 변환해보세요.--------------------------------------------------🚀 YesNa AI 핵심 기능- 지표식/전략식/종목검색식 생성: 자연어로 요청하면 예스랭귀지 문법에 맞는 코드를 작성합니다.- 종목검색식 변환 지원: K증권의 종목 검색식을 예스랭귀지로 변환 지원합니다.- 컴파일 검증: 작성된 코드가 실행 가능한지 컴파일러를 통해 문법 검증을 거쳐 결과물을 제공합니다.상세한 서비스 개요 및 활용 방법은 [서비스 소개 페이지]에서 확인하실 수 있습니다.▶ 서비스 소개 페이지: 바로가기서비스 사용 유의사항 및 결제 환불정책은 [이용약관]을 참고 부탁드립니다.▶ 서비스 이용약관: 바로가기💬 이용 문의사용 중 문의사항은 [프로그램 사용법 Q&A] 게시판에서 [예스나 AI] 카테고리를 설정 후 문의해 주시면 상세히 안내해 드리겠습니다.--------------------------------------------------앞으로도 AI를 활용한 다양한 트레이딩 기능들을 지속적으로 선보일 예정입니다.많은 관심과 기대 부탁드립니다.
2026-02-27
1523
글번호 230811
답변완료
지표 변환 부탁드립니다.
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © EmreKb
//@version=5
indicator("Market Structure Break & Order Block", "MSB-OB", overlay=true, max_lines_count=500, max_bars_back=4900, max_boxes_count=500)
settings = "Settings"
zigzag_len = input.int(9, "ZigZag Length", group=settings)
show_zigzag = input.bool(true, "Show Zigzag", group=settings)
fib_factor = input.float(0.33, "Fib Factor for breakout confirmation", 0, 1, 0.01, group=settings)
text_size = input.string(size.tiny, "Text Size", [size.tiny, size.small, size.normal, size.large, size.huge], group=settings)
delete_boxes = input.bool(true, "Delete Old/Broken Boxes", group=settings)
bu_ob_inline_color = "Bu-OB Colors"
be_ob_inline_color = "Be-OB Colors"
bu_bb_inline_color = "Bu-BB Colors"
be_bb_inline_color = "Be-BB Colors"
bu_ob_display_settings = "Bu-OB Display Settings"
bu_ob_color = input.color(color.new(color.green, 70), "Color", group=bu_ob_display_settings, inline=bu_ob_inline_color)
bu_ob_border_color = input.color(color.green, "Border Color", group=bu_ob_display_settings, inline=bu_ob_inline_color)
bu_ob_text_color = input.color(color.green, "Text Color", group=bu_ob_display_settings, inline=bu_ob_inline_color)
be_ob_display_settings = "Be-OB Display Settings"
be_ob_color = input.color(color.new(color.red, 70), "Color", group=be_ob_display_settings, inline=be_ob_inline_color)
be_ob_border_color = input.color(color.red, "Border Color", group=be_ob_display_settings, inline=be_ob_inline_color)
be_ob_text_color = input.color(color.red, "Text Color", group=be_ob_display_settings, inline=be_ob_inline_color)
bu_bb_display_settings = "Bu-BB & Bu-MB Display Settings"
bu_bb_color = input.color(color.new(color.green, 70), "Color", group=bu_bb_display_settings, inline=bu_bb_inline_color)
bu_bb_border_color = input.color(color.green, "Border Color", group=bu_bb_display_settings, inline=bu_bb_inline_color)
bu_bb_text_color = input.color(color.green, "Text Color", group=bu_bb_display_settings, inline=bu_bb_inline_color)
be_bb_display_settings = "Be-BB & Be-MB Display Settings"
be_bb_color = input.color(color.new(color.red, 70), "Color", group=be_bb_display_settings, inline=be_bb_inline_color)
be_bb_border_color = input.color(color.red, "Border Color", group=be_bb_display_settings, inline=be_bb_inline_color)
be_bb_text_color = input.color(color.red, "Text Color", group=be_bb_display_settings, inline=be_bb_inline_color)
var float[] high_points_arr = array.new_float(5)
var int[] high_index_arr = array.new_int(5)
var float[] low_points_arr = array.new_float(5)
var int[] low_index_arr = array.new_int(5)
var box[] bu_ob_boxes = array.new_box(5)
var box[] be_ob_boxes = array.new_box(5)
var box[] bu_bb_boxes = array.new_box(5)
var box[] be_bb_boxes = array.new_box(5)
to_up = high >= ta.highest(zigzag_len)
to_down = low <= ta.lowest(zigzag_len)
trend = 1
trend := nz(trend[1], 1)
trend := trend == 1 and to_down ? -1 : trend == -1 and to_up ? 1 : trend
last_trend_up_since = ta.barssince(to_up[1])
low_val = ta.lowest(nz(last_trend_up_since > 0 ? last_trend_up_since : 1, 1))
low_index = bar_index - ta.barssince(low_val == low)
last_trend_down_since = ta.barssince(to_down[1])
high_val = ta.highest(nz(last_trend_down_since > 0 ? last_trend_down_since : 1, 1))
high_index = bar_index - ta.barssince(high_val == high)
if ta.change(trend) != 0
if trend == 1
array.push(low_points_arr, low_val)
array.push(low_index_arr, low_index)
if trend == -1
array.push(high_points_arr, high_val)
array.push(high_index_arr, high_index)
f_get_high(ind) =>
[array.get(high_points_arr, array.size(high_points_arr) - 1 - ind), array.get(high_index_arr, array.size(high_index_arr) - 1 - ind)]
f_get_low(ind) =>
[array.get(low_points_arr, array.size(low_points_arr) - 1 - ind), array.get(low_index_arr, array.size(low_index_arr) - 1 - ind)]
f_delete_box(box_arr) =>
if delete_boxes
box.delete(array.shift(box_arr))
else
array.shift(box_arr)
0
[h0, h0i] = f_get_high(0)
[h1, h1i] = f_get_high(1)
[l0, l0i] = f_get_low(0)
[l1, l1i] = f_get_low(1)
if ta.change(trend) != 0 and show_zigzag
if trend == 1
line.new(h0i, h0, l0i, l0)
if trend == -1
line.new(l0i, l0, h0i, h0)
market = 1
market := nz(market[1], 1)
// market := market == 1 and close < l0 and low < l0 - math.abs(h0 - l0) * fib_factor ? -1 : market == -1 and close > h0 and high > h0 + math.abs(h0 - l0) * fib_factor ? 1 : market
last_l0 = ta.valuewhen(ta.change(market) != 0, l0, 0)
last_h0 = ta.valuewhen(ta.change(market) != 0, h0, 0)
market := last_l0 == l0 or last_h0 == h0 ? market : market == 1 and l0 < l1 and l0 < l1 - math.abs(h0 - l1) * fib_factor ? -1 : market == -1 and h0 > h1 and h0 > h1 + math.abs(h1 - l0) * fib_factor ? 1 : market
bu_ob_index = bar_index
bu_ob_index := nz(bu_ob_index[1], bar_index)
for i=h1i to l0i[zigzag_len]
index = bar_index - i
if open[index] > close[index]
bu_ob_index := bar_index[index]
bu_ob_since = bar_index - bu_ob_index
be_ob_index = bar_index
be_ob_index := nz(be_ob_index[1], bar_index)
for i=l1i to h0i[zigzag_len]
index = bar_index - i
if open[index] < close[index]
be_ob_index := bar_index[index]
be_ob_since = bar_index - be_ob_index
be_bb_index = bar_index
be_bb_index := nz(be_bb_index[1], bar_index)
for i=h1i - zigzag_len to l1i
index = bar_index - i
if open[index] > close[index]
be_bb_index := bar_index[index]
be_bb_since = bar_index - be_bb_index
bu_bb_index = bar_index
bu_bb_index := nz(bu_bb_index[1], bar_index)
for i=l1i - zigzag_len to h1i
index = bar_index - i
if open[index] < close[index]
bu_bb_index := bar_index[index]
bu_bb_since = bar_index - bu_bb_index
if ta.change(market) != 0
if market == 1
line.new(h1i, h1, h0i, h1, color=color.green, width=2)
label.new(int(math.avg(h1i, l0i)), h1, "MSB", color=color.new(color.black, 100), style=label.style_label_down, textcolor=color.green, size=size.small)
bu_ob = box.new(bu_ob_index, high[bu_ob_since], bar_index + 10, low[bu_ob_since], bgcolor=bu_ob_color, border_color=bu_ob_border_color, text="Bu-OB", text_color=bu_ob_text_color, text_halign=text.align_right, text_size=text_size)
bu_bb = box.new(bu_bb_index, high[bu_bb_since], bar_index + 10, low[bu_bb_since], bgcolor=bu_bb_color, border_color=bu_bb_border_color, text=l0 < l1 ? "Bu-BB" : "Bu-MB", text_color=bu_bb_text_color, text_halign=text.align_right, text_size=text_size)
array.push(bu_ob_boxes, bu_ob)
array.push(bu_bb_boxes, bu_bb)
if market == -1
line.new(l1i, l1, l0i, l1, color=color.red, width=2)
label.new(int(math.avg(l1i, h0i)), l1, "MSB", color=color.new(color.black, 100), style=label.style_label_up, textcolor=color.red, size=size.small)
be_ob = box.new(be_ob_index, high[be_ob_since], bar_index + 10, low[be_ob_since], bgcolor=be_ob_color, border_color=be_ob_border_color, text="Be-OB", text_color=be_ob_text_color, text_halign=text.align_right, text_size=text_size)
be_bb = box.new(be_bb_index, high[be_bb_since], bar_index + 10, low[be_bb_since], bgcolor=be_bb_color, border_color=be_bb_border_color, text=h0 > h1 ? "Be-BB" : "Be-MB", text_color=be_bb_text_color, text_halign=text.align_right, text_size=text_size)
array.push(be_ob_boxes, be_ob)
array.push(be_bb_boxes, be_bb)
for bull_ob in bu_ob_boxes
bottom = box.get_bottom(bull_ob)
top = box.get_top(bull_ob)
if close < bottom
f_delete_box(bu_ob_boxes)
else if close < top
alert("Price in the BU-OB zone")
else
box.set_right(bull_ob, bar_index + 10)
for bear_ob in be_ob_boxes
top = box.get_top(bear_ob)
bottom = box.get_bottom((bear_ob))
if close > top
f_delete_box(be_ob_boxes)
if close > bottom
alert("Price in the BE-OB zone")
else
box.set_right(bear_ob, bar_index + 10)
for bear_bb in be_bb_boxes
top = box.get_top(bear_bb)
bottom = box.get_bottom(bear_bb)
if close > top
f_delete_box(be_bb_boxes)
else if close > bottom
alert("Price in the BE-BB zone")
else
box.set_right(bear_bb, bar_index + 10)
for bull_bb in bu_bb_boxes
bottom = box.get_bottom(bull_bb)
top = box.get_top(bull_bb)
if close < bottom
f_delete_box(bu_bb_boxes)
else if close < top
alert("Price in the BU-BB zone")
else
box.set_right(bull_bb, bar_index + 10)
alertcondition(ta.change(market) != 0, "MSB", "MSB")
2025-09-23
388
글번호 194217
2wnwn 님에 의해서 삭제되었습니다.
2025-09-23
58
글번호 194216
답변완료
조건검색식 문의드립니다.
M = floor(date/a);
S = sum(b);
HH = sum(H);
MS1 = S - valuewhen(1, M!=M(1), S(1));
MH1 = HH - valuewhen(1, M!=M(1), HH(1));
MS2 = S - valuewhen(2, M!=M(1), S(1)) - MS1;
MH2 = HH - valuewhen(2, M!=M(1), HH(1)) - MH1;
지표라인 = MH2 / MS2;
신호 = CrossUp(C, 지표라인);
지표변수
A 8
b 11.2
당일 장중에서, 30분봉 상에서, 위 신호가 한번이라도 발생했던 모든 종목들을 검출할 수 있도록
식 변환해주시면 감사드리겠습니다 (__)
2025-09-23
176
글번호 194205
답변완료
종목검색식 부탁드립니다
1. 캔들이 종가기준 112이평 (지수) 아래에 있고,
당일 고가가 (꼬리포함)10% 이상 상승하고,
캔들 전체길이에서 꼬리가 30% 이상인 종목검색식 부탁드려요
2. 캔들이 종가기준 112이평 (지소) 아래에 있고,
당일 고가가 (꼬리포함) 10% 이상 상승하고,
캔들 전체길이에서 꼬리가 30% 이상인,
0봉전에서 ~ 60봉전까지 의 모든종목 검색식 부탁드립니다
2025-09-23
171
글번호 194204
답변완료
검색식부탁드립니다
수고많습니다 수식을검색식으로 부탁드립니다
a1=ma(c,20);
b1=ma(c,60);
이격도=c<=o*0.97 && c>=o*0.90;
c1=a1>b1 && a1>h && 이격도 &&(o-c)>(h-o) && (o-c)>(c-l);
a=valuewhen(1,c1,c);
crossup(c,a)
2025-09-23
204
글번호 194203
쪼꼬아빠 님에 의해서 삭제되었습니다.
2025-09-23
0
글번호 194201
답변완료
매수 매도 식좀 부탁드립니다
60일 이평선 매매법입니다
매수 --- 60일 이평선 돌파하고 이후 봉이 60일 이평선과 캔들이 고가 저가 과
간격이 생긴이후 캔들이 60이평선을 터지이후 다음봉이 종가상 터치봉 고가보다
크면 매수(N자파동)
매도 --- 60일 이평선 이탈하고 이후 봉이 60일 이평선과 캔들이 고가 저가 과
간격이 생긴이후 캔들이 60이평선을 터지이후 다음봉이 종가상 터치봉 저가보다
낮으면 매도(N자파동)
관망구간 -- 60일 이편선을 돌파하고 지지없이 다시 이탈시 이런 구간은 관망합니다
익절 --- 매수청산 진입후 60일 이펑선을 두번 터지 이후 3양봉이면 청산
매도청산 진입후 60일 이펑선을 두번 터지 이후 3양봉이면 청산
손절 --- 지지봉 가격에서 20틱 (매도)이상 (매수)이하면 손절
각 구간 자세한 설명좀 주석으로 부탁합니다
달아준 주석으로 보면서 수정을 해보겠습니다
감사합니다
2025-09-23
164
글번호 194200
답변완료
수정 부탁합니다.
아래 96367번 에 있는 지표를 기반으로
양봉으로 밴드하단을 뚫고 올라와서 종가가 밴드안에 들어올때 매수
음봉으로 밴드 상단을 뚫고 내려와서 종가가 밴드안에 들어오면 청산
(추가 - 매수 포지션 있을때 음봉으로(시가는 밴드안에있고 종가는 하단밴드 밑)
하단밴드를 뚫고 내려오면 청산)
매수공통사항도 적용 부탁합니다.
1. 총 3회까지 분할매수 ( 1회 총 투자금의 30% )
2. 매수시점에 전5봉을 확인하여 매수가 있었다면 추가매수금지
** 조건식 빼고 상기 조건만으로 부탁합니다.
조건식을 삭제해도 이상하게 나오네요
조건식 이부분을 삭제했습니다.
Condition1 = diff < diff[1];
Condition2 = diff < ma(diff,5)[1];
Condition3 = C > upband and upband > O;
Condition4 = Asks > Bids;
if Condition1 == False and Condition2 == False and Condition3 == true and Condition4 == true Then
2025-09-23
259
글번호 194199
답변완료
수식 정리..부탁드립니다.
지표조건
기간1 20
기간3 240
가격 (H+L)/2
K 38.2
A = C-C(기간1);
MA=ma(C,기간1);
HH=Highest(H,기간3);
LL = Lowest(L,기간3);
PB=(HH-LL)*(K/100)+LL
AA=Valuewhen (1,crossup(A,0),MA);
AA>AA(1) &&
가격이 PB 에 5%내 근접
2025-09-22
182
글번호 194198