커뮤니티
예스랭귀지 Q&A
답변완료
[공지] 예스랭귀지 AI 어시스턴트, '예스나 AI' 출시 및 무료 체험 안내
안녕하세요, 예스스탁 입니다.복잡한 수식 공부 없이 여러분의 아이디어를 말하면 시스템 트레이딩 언어 예스랭귀지로 작성해주는 서비스예스나 AI(YesNa AI)가 출시되었습니다.지금 예스나 AI를 직접 경험해 보실 수 있도록 20크레딧(질문권 20회)를 무료로 증정해 드리고 있습니다.바로 여러분의 아이디어를 코드로 변환해보세요.--------------------------------------------------🚀 YesNa AI 핵심 기능- 지표식/전략식/종목검색식 생성: 자연어로 요청하면 예스랭귀지 문법에 맞는 코드를 작성합니다.- 종목검색식 변환 지원: K증권의 종목 검색식을 예스랭귀지로 변환 지원합니다.- 컴파일 검증: 작성된 코드가 실행 가능한지 컴파일러를 통해 문법 검증을 거쳐 결과물을 제공합니다.상세한 서비스 개요 및 활용 방법은 [서비스 소개 페이지]에서 확인하실 수 있습니다.▶ 서비스 소개 페이지: 바로가기서비스 사용 유의사항 및 결제 환불정책은 [이용약관]을 참고 부탁드립니다.▶ 서비스 이용약관: 바로가기💬 이용 문의사용 중 문의사항은 [프로그램 사용법 Q&A] 게시판에서 [예스나 AI] 카테고리를 설정 후 문의해 주시면 상세히 안내해 드리겠습니다.--------------------------------------------------앞으로도 AI를 활용한 다양한 트레이딩 기능들을 지속적으로 선보일 예정입니다.많은 관심과 기대 부탁드립니다.
2026-02-27
1541
글번호 230811
답변완료
질문 부탁드립니다
수고하십니다
아래식은 현재봉이 당일 최초로 조건 만족했을때만 검색하는 내용인데요,,,
condition3는 날짜가 바뀌면 기본으로 계속 false 상태이지만
당일 최초 만족시에만 검색하기 위해서 이후에 나오는 봉들은 모두 true 상태로 바꾸는거라고
이해를 하고 있는데요, (당일날 또 다른 aa[0]>h and aa[0] <l 이 나오더라도 true 이기때문에 만족 X)
그런데 Condition3==False and (aa[0]<h and aa[0]>l) 이 만족했을때 true 로 바꾸면
조건봉은 만족과 동시에 true 로 전환되는거고
true 로 바뀌기이전에 이미 condition3==false 상태에서 조건이 만족했기에
true로 전환되는것과 상관없이 false 이면서 aa[0]<h... 인 봉을 찾게 되는건가요?
plot(iff(condition==true,1,0)) 으로 해봤을때 조건봉이 true 로 나오게 되서 여쭤봅니다
감사합니다
if Bdate != Bdate[1] Then
{
DD = DD+1;
Condition3=False;
}
if (h>l*1.08) then
{...
}
if Condition3==False and (aa[0]<h and aa[0]>l) Then
{
Condition3=true;
Find(1);
}
2025-06-24
239
글번호 192035
yamu 님에 의해서 삭제되었습니다.
2025-06-23
0
글번호 192034
2wnwn 님에 의해서 삭제되었습니다.
2025-06-23
53
글번호 192033
답변완료
수식전환
항상 수고 많으십니다 아래수식을 예스랭귀지로 변환 부탁드립니다
A1=C>avg(c,5);
A2=C>avg(c,20);
A3=C>avg(c,60);
A4=avg(c,5)>avg(c,20);
A5=avg(c,5)>avg(c,60);
A6=0<avg(c,224);
A7=amount>con1;//CON1 15000
A8=(h(1)/avg(c,224,1)-1)*100>=con2;//CON2 -5
A9=sum(if(A8,1,0),con3)>=1;//CON3 30
A1 and A2 and A3 and A4 and A5 and A6 and A7 and A8 and A9
2025-06-23
277
글번호 192028
답변완료
함수 문의
1. OpenPositionProfit, MaxPositionProfit 함수에 대해 문의드립니다.
1-1. 기준이 $와 포인트 중에 어느 것을 기준으로 삼나요?
1-2. if (매수 또는 매도 진입한 상태) and (OpenPositionProfit / MaxPositionProfit) < 0.5
위와 같이 수식을 작성하면 진입 후 maxpositionprofit과 openpositionprofit을 계산하고 만약 위 조건대로 50% 미만으로 내려가는 순간 바로 청산하는 건가요?
2. 시간과 날짜 관련된 함수
stime, bdate, sdate, time 등 시간이나 날짜와 관련된 함수는 한국 시간을 기준으로 하나요? 아니면 해당 종목을 거래하는 거래소 도시 시간을 기준으로 하나요?
2025-06-23
267
글번호 192027
답변완료
부탁드립니다
60 이평 위에서 10, 20 이평 골든크로스
60 이평 아래서 10, 20 이평 데드크로스
기준으로 부탁드립니다 올려주신 수식을 적용해 보니 이미지 처럼 뜨네요
var : shortPeriod(5), longPeriod(20);
var : bh(0),bd(0),bt(0),tl1(0),tx1(0),A1(0),A2(0),A3(0);
var : sl(0),sd(0),st(0),tl2(0),tx2(0),B1(0),B2(0),B3(0);
var : A31(0),B31(0);
value1 = wma(C, shortPeriod);
value2 = wma(C, longPeriod);
If CrossUP(value1, value2) Then
{
buy();
bh = h;
bd = sDate;
bt = sTime;
if sl > 0 Then
{
A1 = sd;
A2 = st;
A3 = sl;
A31 = A3[1];
TL_SetEnd(TL1,A1,A2,A3[1]);
tl1 = TL_New(A1,A2,A3,NextBarSdate,NextBarStime,A3);
Text_SetLocation(Tx1,A1,A2,A3[1]);
if A3 > A31 Then
tx1 = Text_New(NextBarSdate,NextBarStime,A3,"▲"+NumToStr(A3,1));
Else
tx1 = Text_New(NextBarSdate,NextBarStime,A3,NumToStr(A3,1));
Text_SetColor(tx1,Blue);
Text_SetStyle(tx1,1,0);
}
}
If CrossDown(value1, value2) Then
{
sell();
sl = l;
sd = sDate;
st = sTime;
if bh > 0 Then
{
B1 = bd;
B2 = bt;
B3 = bh;
B31 = B3[1];
TL_SetEnd(TL2,B1,B2,B3[1]);
TL2 = TL_New(B1,B2,B3,NextBarSdate,NextBarStime,B3);
Text_SetLocation(tx2,B1,B2,B3[1]);
if B3 < B31 Then
tx2 = Text_New(NextBarSdate,NextBarStime,B3,"▼"+NumToStr(B3,1));
Else
tx2 = Text_New(NextBarSdate,NextBarStime,B3,NumToStr(B3,1));
Text_SetColor(tx2,Red);
Text_SetStyle(tx2,1,1);
}
}
if MarketPosition == 1 Then
{
if h > bh Then
{
bh = h;
bd = sDate;
bt = sTime;
}
}
if MarketPosition == -1 Then
{
if l < sl Then
{
sl = l;
sd = sDate;
st = sTime;
}
}
TL_SetEnd(tl1,NextBarSdate,NextBarStime,A3);
TL_SetEnd(tl2,NextBarSdate,NextBarStime,B3);
Text_SetLocation(tx1,NextBarSdate,NextBarStime,A3);
Text_SetLocation(tx2,NextBarSdate,NextBarStime,B3);
2025-06-23
300
글번호 192019
답변완료
지표 부탁드려요!!!
다음 TradingView 지표를 Yestrader로 부탁드립니다. 참고로 Grok Ai에다가 ta.change(src,length) 함수를 의뢰했더니 다음 1과 같이 보내왔습니다.
1. _Change(src, len) 함수
// 사용자 정의 change 함수 구현
_Change(source, length) =>
source - source[length]
2. TV 지표 수식(HMA Swing Levels [BigBeluga])
// INPUTS ――――――――――――――――――――{
len1 = input.int(5, "Trend Change")
len2 = input.int(50, "Swing Levels")
col1 = input.color(#238be0, "", inline = "col")
col2 = input.color(#1ae382, "", inline = "col")
h = ta.highest(len2)
l = ta.lowest(len2)
mid = math.avg(h, l)
hma = ta.hma(close, 50)
change = ta.change(hma, len1)
var trail = float(na)
var color = color(na)
type lines
line l
label lbl
bool direction
var data = array.new<lines>()
// }
// CALCULATIONS――――――――――{
if last_bar_index - bar_index < 4000
if h[1] == high[1] and high < h and change > 0
label.new(bar_index[1], high[1], "▇", style = label.style_label_center, color = color(na), textcolor = col2, size = size.tiny)
lbl = label.new(bar_index[1], high[1], str.tostring(high[1]), style = label.style_label_left, color = color(na), textcolor = col2, size = size.normal)
l1 = line.new(bar_index[1], high[1], bar_index, high[1], color = col2)
gg = lines.new(l1, lbl, false)
data.push(gg)
if l[1] == low[1] and low > l and change < 0
label.new(bar_index[1], low[1], "▇", style = label.style_label_center, color = color(na), textcolor = col1, size = size.tiny)
lbl = label.new(bar_index[1], low[1], str.tostring(low[1]), style = label.style_label_left, color = color(na), textcolor = col1, size = size.normal)
l2 = line.new(bar_index[1], low[1], bar_index, low[1], color = col1)
gg = lines.new(l2, lbl, true)
data.push(gg)
if data.size() > 0
for gg in data
l_ = gg.l
lbl = gg.lbl
l_.set_x2(bar_index)
lbl.set_x(bar_index)
if l_.get_x2() - l_.get_x1() > 250
l_.set_width(2)
if l_.get_x2() - l_.get_x1() > 500
l_.set_width(3)
if l_.get_x2() - l_.get_x1() > 750
l_.set_width(4)
if gg.direction
if low < l_.get_y1()
l_.set_width(1)
label.delete(lbl)
l_.set_style(line.style_dashed)
ss = lines.new(line(na), label(na))
data.set(data.indexof(gg), ss)
else
if high > l_.get_y1()
l_.set_width(1)
label.delete(lbl)
l_.set_style(line.style_dashed)
ss = lines.new(line(na), label(na))
data.set(data.indexof(gg), ss)
if change > 0
trail := hma
color := color.fuchsia
if change < 0
trail := hma
color := color.lime
pt = plot(trail, color = color, style = plot.style_stepline, linewidth = 2)
plot(trail, color = color.new(color, 60), style = plot.style_stepline, linewidth = 6)
// }
2025-06-23
370
글번호 192018
답변완료
종목 검색식 부탁드립니다.
항상 고생이 많으세요.
아래 수식을 종목검색으로 부탁드립니다.
Bii 0선 돌파를 5분봉에서 도출하고, 10분봉에서 검토해서 종목을 찾는 수식입니다.
-----------------------------------------------------------------------
// [조건식 이름: 5min_II_With_10min_Filter]
// 5분봉 신호 + 10분봉 추세 확인
// 1. 5분봉 II 신호 호출
#Include "5min_II_Cross" // 별도 저장한 조건식 포함
// 2. 10분봉 데이터 가져오기
Var:
TenMinClose = CloseD(10), // 10분봉 종가
TenMinVolume = VolumeD(10); // 10분봉 거래량
// 3. 10분봉 II 계산 (DLL 없이 직접 구현)
Var: TenMinII(0);
TenMinII = (2*TenMinClose - HighD(10) - LowD(10)) /
(HighD(10) - LowD(10)) * TenMinVolume;
// 4. 10분봉 필터 조건
TenMinFilter = (TenMinII > 0); // 10분봉 II > 0
// 5. 통합 신호 (5분봉 신호 AND 10분봉 필터)
FinalSignal = CrossSignal AND TenMinFilter;
// 6. 출력 (차트 표시용)
IF FinalSignal THEN {
Plot1(Low-10, "BUY", colorRed, shapeUpArrow);
SetAlert(1); // 알림 발생
}
2025-06-23
355
글번호 192007
답변완료
써머시간 적용에 따른 청산
안녕하세요,
써머타임에 시간에 맞춰 청산 시간 수식을 만들었는데요.
아래 식으로
써머시간 미적용 시간은 오전 7시간에 정상적으로 청산이 되는데
써머시간 적용시간에는 오전 6시에 청산이 되어야 하는데 8시에 청산이 됩니다.
혹시 어떤 수식이 오류인지 알 수 있을까요?
if NextBarSdate != sDate then
begin
DD = DayOfWeek(NextBarSdate);
Year = Floor(NextBarSdate / 10000);
// 써머타임 시작: 3월 둘째 일요일
V1 = (10000 * Year) + (100 * 3) + 1;
V2 = 15 - DayOfWeek(V1);
// 써머타임 종료: 11월 첫째 일요일
V3 = (10000 * Year) + (100 * 11) + 1;
V4 = 8 - DayOfWeek(V3);
summer = NextBarSdate > ((10000 * Year) + (100 * 3) + V2)
and
NextBarSdate < ((10000 * Year) + (100 * 11) + V4);
if summer then
ET = 055900; // 서머타임 청산: 오전 5:59
else
ET = 065900; // 표준시간 청산: 오전 6:59
end;
if NextBarStime >= ET and stime < ET then
begin
ExitLong("EOD_EL", AtMarket);
ExitShort("EOD_ES", AtMarket);
end;
2025-06-22
297
글번호 192000