커뮤니티
예스랭귀지 Q&A
답변완료
[공지] 예스랭귀지 AI 어시스턴트, '예스나 AI' 출시 및 무료 체험 안내
안녕하세요, 예스스탁 입니다.복잡한 수식 공부 없이 여러분의 아이디어를 말하면 시스템 트레이딩 언어 예스랭귀지로 작성해주는 서비스예스나 AI(YesNa AI)가 출시되었습니다.지금 예스나 AI를 직접 경험해 보실 수 있도록 20크레딧(질문권 20회)를 무료로 증정해 드리고 있습니다.바로 여러분의 아이디어를 코드로 변환해보세요.--------------------------------------------------🚀 YesNa AI 핵심 기능- 지표식/전략식/종목검색식 생성: 자연어로 요청하면 예스랭귀지 문법에 맞는 코드를 작성합니다.- 종목검색식 변환 지원: K증권의 종목 검색식을 예스랭귀지로 변환 지원합니다.- 컴파일 검증: 작성된 코드가 실행 가능한지 컴파일러를 통해 문법 검증을 거쳐 결과물을 제공합니다.상세한 서비스 개요 및 활용 방법은 [서비스 소개 페이지]에서 확인하실 수 있습니다.▶ 서비스 소개 페이지: 바로가기서비스 사용 유의사항 및 결제 환불정책은 [이용약관]을 참고 부탁드립니다.▶ 서비스 이용약관: 바로가기💬 이용 문의사용 중 문의사항은 [프로그램 사용법 Q&A] 게시판에서 [예스나 AI] 카테고리를 설정 후 문의해 주시면 상세히 안내해 드리겠습니다.--------------------------------------------------앞으로도 AI를 활용한 다양한 트레이딩 기능들을 지속적으로 선보일 예정입니다.많은 관심과 기대 부탁드립니다.
2026-02-27
1536
글번호 230811
답변완료
문의
늘 감사 드립니다
아래 수식에서 당일최고와 당일중심, 당일최저 3등분선을
5등분으로 만들고 싶습니다.
최고와 중심선 사이에 2/1선을 넣고
중심선과 최저 사이에 또 2/1선을 넣을 수 있게
중심선을 기준으로 위로 2칸, 아래로 2칸 부탁드립니다.
감사합니다.
Input : Period(1);
Var : value(0);
value = ma(bids,period)-ma(asks,period);#호가잔량이동평균오실레이터
if date != date[1] Then{
value1 = value;
value2 = value;
}
if value > value1 Then
value1 = value;
if value < value2 Then
value2 = value;
If value > value[35] Then
Plot1(value, "호가잔량이평오실레이터",RED);
Else
Plot1(value, "호가잔량이평오실레이터",BLUE);
plot2(value1,"당일최고");
plot3(value2,"당일최저");
plot4((value1+value2)/2,"당일중심");
PlotBaseLine1(0,"기준선");
2025-07-12
251
글번호 192458
답변완료
예스종목검색으로 요청합니다..
요즘 많이 더운데 수고가 많으세요...
((종목 검색 조건))
200일 신저가 발생하고 일목균형표 음운구름대 관통하는 장대양봉 캔들을 찾고
싶어요...
부탁드립니다...
2025-07-12
231
글번호 192457
답변완료
부틱드립니다
수고하심니다
아래수식을 예스로 부탁드립니다
// This work is licensed under a Attribution-NonCommercial-ShareAlike 4.0 International (CC BY-NC-SA 4.0) https://creativecommons.org/licenses/by-nc-sa/4.0/
// ©LuxAlgo
//@version=5
indicator("Inversion Fair Value Gaps (IFVG) [LuxAlgo]", "LuxAlgo - Inversion Fair Value Gaps (IFVG)", overlay = true, max_boxes_count = 500, max_lines_count = 500, max_labels_count = 500)
//---------------------------------------------------------------------------------------------------------------------}
//Settings
//---------------------------------------------------------------------------------------------------------------------{
disp_num = input.int(5, maxval = 100, minval = 1, title = "Show Last", tooltip = "Specifies the amount of most recent inversion FVG to display in Bullish/Bearish pairs, starting at the current and looking back.")
signal_pref = input.string("Close", title = "Signal Preference", options = ["Close","Wick"], tooltip = "Choose to send signals based on Wicks or Close Price.")
wt = signal_pref == "Wick"
atr_multi = input.float(0.25, step = 0.25,minval = 0, title = "ATR Multiplier", tooltip = "Filters FVGs based on ATR Width, Only displays Inversions that are Greater-Than the ATR*Multiplier.")
//Colors
green = input.color(color.new(#089981, 80), title = "Bull Color", group = "Colors")
red = input.color(color.new(#f23645, 80), title = "Bear Color", group = "Colors")
gray = input.color(#787b86, title = "Midline Color", group = "Colors")
invis = color.rgb(0,0,0,100)
//---------------------------------------------------------------------------------------------------------------------}
//UDT's
//---------------------------------------------------------------------------------------------------------------------{
type lab //Contains Necessary Label Data to Send to Label Function
int x
float y
int dir
type fvg //Contains Necessary FVG Data to Send to Chart.
int left = na
float top = na
int right = na
float bot = na
float mid = na
int dir = na
int state = na
array<lab> labs = na
int x_val = na
//---------------------------------------------------------------------------------------------------------------------}
//Functions
//---------------------------------------------------------------------------------------------------------------------{
//Basic Calcs
buffer = 100 //How many FVGs to keep in memory.
c_top = math.max(open,close)
c_bot = math.min(open,close)
label_maker(_x,_y,_dir) => //Used for making Labels
switch
_dir == 1 => label.new(_x,_y,"₩n▲", style = label.style_text_outline, color = invis, textcolor = color.new(green,0), size = size.small, xloc = xloc.bar_time)
_dir == -1 => label.new(_x,_y, "▼₩n", style = label.style_text_outline, color = invis, textcolor = color.new(red,0), size = size.small, xloc = xloc.bar_time)
fvg_manage(_ary,_inv_ary) => //First step filtering of FVG data, Not all FVGs will be displayed, only inversions.
if _ary.size() >= buffer
_ary.shift()
if _ary.size() > 0
for i = _ary.size()-1 to 0
value = _ary.get(i)
_dir = value.dir
if _dir == 1 and (c_bot < value.bot)
value.x_val := time
_inv_ary.push(_ary.remove(i))
if _dir == -1 and (c_top > value.top)
value.x_val := time
_inv_ary.push(_ary.remove(i))
inv_manage(_ary) => //All inversions will be displayed.
fire = false
if _ary.size() >= buffer
_ary.shift()
if _ary.size() > 0
for i = _ary.size()-1 to 0
value = _ary.get(i)
bx_top = value.top
bx_bot = value.bot
_dir = value.dir
st = value.state
if (st == 0 and _dir == 1)
value.state := 1
value.dir := -1
if (_dir == -1 and st == 0)
value.state := 1
value.dir := 1
if st >= 1
value.right := time
if (_dir == -1 and st == 1 and close < bx_bot and (wt?high:close[1]) >= bx_bot and (wt?high:close[1]) < bx_top)
value.labs.push(lab.new(time,bx_top,-1))
fire := true
if (_dir == 1 and st == 1 and close > bx_top and (wt?low:close[1]) <= bx_top and (wt?low:close[1]) > bx_bot)
value.labs.push(lab.new(time,bx_bot,1))
fire := true
if st >= 1 and ((_dir == -1 and c_top > bx_top) or (_dir == 1 and c_bot < bx_bot))
_ary.remove(i)
fire
send_it(_ary) => // Draws Everything on the Chart
last_index = _ary.size()-1
for [index,value] in _ary
bx_top = value.top
bx_bot = value.bot
bx_left = value.left
xval = value.x_val
mid = value.mid
col = value.dir == -1 ? green : red
o_col = value.dir == -1 ? red : green
if index > last_index - disp_num
box.new(bx_left,bx_top,xval,bx_bot,bgcolor = col, border_color = invis, xloc = xloc.bar_time)
box.new(xval,bx_top,time,bx_bot, bgcolor = o_col, border_color = invis, xloc = xloc.bar_time)
line.new(bx_left,mid,time,mid, color = gray, style = line.style_dashed, xloc = xloc.bar_time)
box.new(bar_index,bx_top,bar_index+50,bx_bot, bgcolor = o_col, border_color = invis)
line.new(bar_index,mid,bar_index+50,mid, color = gray, style = line.style_dashed)
for stuff in value.labs
label_maker(stuff.x,stuff.y,stuff.dir)
//---------------------------------------------------------------------------------------------------------------------}
//Delete drawings
//---------------------------------------------------------------------------------------------------------------------{
for boxes in box.all
box.delete(boxes)
for lines in line.all
line.delete(lines)
for labels in label.all
label.delete(labels)
//---------------------------------------------------------------------------------------------------------------------}
//Data Arrays
//---------------------------------------------------------------------------------------------------------------------{
var bull_fvg_ary = array.new<fvg>(na) // FVG Data, Not all will be Drawn
var bear_fvg_ary = array.new<fvg>(na)
var bull_inv_ary = array.new<fvg>(na) // Inversion Data, All will be Drawn
var bear_inv_ary = array.new<fvg>(na)
//---------------------------------------------------------------------------------------------------------------------}
//FVG Detection
//---------------------------------------------------------------------------------------------------------------------{
atr = nz(ta.atr(200)*atr_multi, ta.cum(high - low) / (bar_index+1))
fvg_up = (low > high[2]) and (close[1] > high[2])
fvg_down = (high < low[2]) and (close[1] < low[2])
if fvg_up and math.abs(low-high[2]) > atr
array.push(bull_fvg_ary,fvg.new(time[1], low, time, high[2], math.avg(low,high[2]), 1, 0,array.new<lab>(na),na))
if fvg_down and math.abs(low[2]-high) > atr
array.push(bear_fvg_ary,fvg.new(time[1], low[2], time, high, math.avg(high,low[2]),-1 ,0,array.new<lab>(na),na))
//---------------------------------------------------------------------------------------------------------------------}
//Running Functions
//---------------------------------------------------------------------------------------------------------------------{
// FVG_Data -> Inversion_Data -> Chart
fvg_manage(bull_fvg_ary,bull_inv_ary)
fvg_manage(bear_fvg_ary,bear_inv_ary)
bear_signal = inv_manage(bull_inv_ary)
bull_signal = inv_manage(bear_inv_ary)
if barstate.islast
send_it(bull_inv_ary)
send_it(bear_inv_ary)
//Alert Options
alertcondition(bull_signal, "Bullish Signal")
alertcondition(bear_signal, "Bearish Signal")
//---------------------------------------------------------------------------------------------------------------------}
2025-07-12
479
글번호 192456
답변완료
검색식 부탁드립니다. _(_ _)_
항상 도와주심에 감사드립니다._(__)_
모든 이동평균선(5,20,60,120,240,480)이 20프로이내에 모여 있고 배열은 상관없지만 단 최상단 이평선이 480선인 상태에서 480선을 돌파한 종목검색식과
역시 20프로 이내구간과 단 최하단이평선이 240 ,최상단이평선 480상태에서 480선을 돌파하는 종목 검색식을 부탁드립니다
2025-07-12
223
글번호 192455
답변완료
수정을 부탁 드립니다.
안녕하세요!
만들어주신 아래 수식에 수정을 부탁드립니다.
매수, 매도 , 청산 시 한글로 매수, 매도, 청산이라는 한글이 표시가 되도록 수정을 부탁 드립니다.
그리고 궁금한점이 있습니다.
만약 DATA1이 매수에 들어가면 동시에 DATA2는 매도에 들어가야 하는데 신호는 DATA1에서만 나타나고 DATA2에서는 나타나지 않습니다.
스프레드매매는 2종목이 동시에 매매에 들어가면 한종목은 수익, 한종목은 손실이 나타나서 청산시 한종목은 수익, 한종목은 손실로 마감이 되어야 되는거 아닌가요? 이때 손실보다 수익이 더 발생해서 차익만큼만 진짜 수익이 되는 걸 스프래드매매로 알고 있습니다.
그래서 스프레드매매를 수동으로 거래하시는 분들을 보면 매매창이 항상 매수, 매도창 2개가 떠 있습니다.
input : 매수진입(-3),매수청산(-1);
input : 매도진입(-1),매도청산(-3);
var : diff(0,data1);
diff = Data1(c)-Data2(c);
if MarketPosition <= 0 and diff <= 매수진입 and diff[1] > 매수진입 Then
Buy();
if MarketPosition == 1 and diff >= 매수청산 Then
ExitLong();
if MarketPosition >= 0 and diff >= 매도진입 and diff[1] < 매도진입 Then
Buy();
if MarketPosition == -1 and diff <= 매도청산 Then
ExitShort();
2025-07-11
249
글번호 192454
답변완료
키움신호를 검색식으로 요청드려봅니다.
안녕하세요.
키움신호인데.
검색식으로 요청 드립니다. 감사합니다.
이 신호에 .
조건 2개를 더 추가 하고 싶습니다.
조건1 주가등락률 5%이상
조건2 거래대금 100억이상
A=avg(c,수치);
B=A(1);
K=A/B*100;
Q=MA(K,기간,단순);
D=avg(c,기간1);
E=avg(c,기간2);
CrossUp(K,Q)
&& K<=수치2 && 종가>=시가 && C<C(1)*수치3
&& D<E && A<D
고맙습니다.
열공해보겠습니다.
2025-07-11
273
글번호 192452
답변완료
문의
아래 수식은
국내 데이트레이딩
하루 2회 거래하는 수식입니다.
첫번째 진입(b1)에서 익절로 포지션을 청산했을 경우
거래를 중지하는 수식을 추가해주십시요.
b1 익절 이후 b2 진입은 성공율이 낮기 때문입니다.
항상 고맙습니다.
**************************************************************************************
Input : 최대(99999),최소(0),거래횟수(2);
input : lock1(103000),b1(9),진입눌림1(4),진입돌파1(2);
input : lock2(113000),b2(18),진입눌림2(3),진입돌파2(1);
input : als(50),atr1(0),atr2(32),agl(128);
input : bls(38),btr1(0),btr2(90),bgl(108);
var : T1(0,data1),entry(0,data1);
var : LL(0,data2),EH(0,data2),E1(0,data2),H1(0,data2);
var : i1(0,data2),S1(0,data2),L1(0,data2);
var : DH2(0,data2),DL2(0,data2);
if data1(Bdate != Bdate[1]) Then
T1 = TotalTrades;
if data2(Bdate != Bdate[1]) Then{
E1 = 0;
DH2 = data2(H);
DL2 = data2(L);
}
if data2(H > DH2) Then
DH2 = data2(H);
if data2(L < DL2) Then
DL2 = data2(L);
if MarketPosition == 0 Then
entry = TotalTrades-T1;
Else
entry = (TotalTrades-T1)+1;
if MarketPosition == 0 and entry == 0 Then{
if data2(E1 == 0 and C >= DL2+PriceScale*B1) Then{
E1 = 1;
H1 = data2(H);
i1 = data2(index);
}
if data2(E1 == 1 and index > i1) then{
if data2(H > H1) Then
H1 = data2(H);
if data2(L <= H1-PriceScale*진입눌림1) Then{
E1 = 2;
i1 = data2(index);
S1 = H1;
}
}
if stime<lock1 and 최대 >= C and C >= 최소 and data2(E1 == 2 and index > i1 and C >= S1+PriceScale*진입돌파1) Then{
buy("b1");
}
}
if TotalTrades > TotalTrades[1] Then
LL = data2(L);
if data2(L < LL) Then
LL = data2(L);
if MarketPosition == 0 and entry >= 1 and entry < 거래횟수 Then{
if data2(E1 == 0 and C >= LL+PriceScale*B2 and C[1] < LL+PriceScale*B2) Then{
E1 = 1;
H1 = data2(H);
i1 = data2(index);
}
if data2(E1 == 1 and index > i1) then{
if data2(H > H1) Then
H1 = data2(H);
if data2(L <= H1-PriceScale*진입눌림2) Then{
E1 = 2;
i1 = data2(index);
S1 = H1;
}
}
if stime<lock2 and data2(E1 == 2 and index > i1 and C >= S1+PriceScale*진입돌파2) Then{
buy("b2");
}
}
if MarketPosition== 1 Then
{
if IsEntryName("b1") == true Then
{
SetStopLoss(PriceScale*als,PointStop);
SetStopTrailing(PriceScale*atr2,PriceScale*atr1,PointStop,1);
SetStopProfittarget(PriceScale*agl,PointStop);
}
Else if IsEntryName("b2") == true Then
{
SetStopLoss(PriceScale*bls,PointStop);
SetStopTrailing(PriceScale*btr2,PriceScale*btr1,PointStop,1);
SetStopProfittarget(PriceScale*bgl,PointStop);
}
Else
{
SetStopLoss(0);
SetStopTrailing(0,0);
SetStopProfittarget(0);
}
}
2025-07-11
281
글번호 192448
답변완료
문의드립니다
차트가 주야 복합차트로 쓸때
dayopen 과 금일 평균값이 야걍 거래가 포함되내요..
주간 아침장 개장시의 시가와 평균값을 계산하고 싶습니다
수식 좀 알려 주세요
2025-07-11
201
글번호 192446
답변완료
문의드립니다
예를 들어
삼성전자 1분 통합차트에서
KRX 차트에서 나오는
dayclose
지표를 만들고 싶습니다
감사합니다
2025-07-11
285
글번호 192444