커뮤니티
예스랭귀지 Q&A
답변완료
[공지] 예스랭귀지 AI 어시스턴트, '예스나 AI' 출시 및 무료 체험 안내
안녕하세요, 예스스탁 입니다.복잡한 수식 공부 없이 여러분의 아이디어를 말하면 시스템 트레이딩 언어 예스랭귀지로 작성해주는 서비스예스나 AI(YesNa AI)가 출시되었습니다.지금 예스나 AI를 직접 경험해 보실 수 있도록 20크레딧(질문권 20회)를 무료로 증정해 드리고 있습니다.바로 여러분의 아이디어를 코드로 변환해보세요.--------------------------------------------------🚀 YesNa AI 핵심 기능- 지표식/전략식/종목검색식 생성: 자연어로 요청하면 예스랭귀지 문법에 맞는 코드를 작성합니다.- 종목검색식 변환 지원: K증권의 종목 검색식을 예스랭귀지로 변환 지원합니다.- 컴파일 검증: 작성된 코드가 실행 가능한지 컴파일러를 통해 문법 검증을 거쳐 결과물을 제공합니다.상세한 서비스 개요 및 활용 방법은 [서비스 소개 페이지]에서 확인하실 수 있습니다.▶ 서비스 소개 페이지: 바로가기서비스 사용 유의사항 및 결제 환불정책은 [이용약관]을 참고 부탁드립니다.▶ 서비스 이용약관: 바로가기💬 이용 문의사용 중 문의사항은 [프로그램 사용법 Q&A] 게시판에서 [예스나 AI] 카테고리를 설정 후 문의해 주시면 상세히 안내해 드리겠습니다.--------------------------------------------------앞으로도 AI를 활용한 다양한 트레이딩 기능들을 지속적으로 선보일 예정입니다.많은 관심과 기대 부탁드립니다.
2026-02-27
3128
글번호 230811
답변완료
추세선 박스 크기
input : Period(10);
Var:상승색(Red), 하락색(Blue);
Var:j(0),T(0);
Var: date11(0),date12(0),time11(0),time12(0),TL1(0),TL(0),
date21(0),date22(0),time21(0),time22(0),
date31(0),date32(0),time31(0),time32(0),tx(0),tx1(0),tl4(0);
Array:HiVal[20](0),LoVal[20](0),HiBar[20](0),LoBar[20](0);
Array:r[7](0),fr[7](0),TL2[7](0),TL3[7](0),TX2[7](0),TX3[7](0);
var : box(0),box1(0);
Plot1(0);
r[0] = 0;
r[1] = 2;
r[2] = 3.;
r[3] = -1;
r[4] = -2.;
r[5] = 1;
r[6] = 0.5;
For j = 0 To 19
{
HiBar[j] = HiBar[j] + 1;
LoBar[j] = LoBar[j] + 1;
}
if crossup(c,highest(H,Period)[1]) Then
T = 1;
if CrossDown(c,Lowest(L,Period)[1]) Then
T = -1;
If T == -1 Then
{
If T[1] != -1 Then
{
For j = 18 DownTo 0
{
LoVal[j+1] = LoVal[j];
LoBar[j+1] = LoBar[j];
}
LoVal[0] = L;
LoBar[0] = 0;
date11 = date[HiBar[0]];
time11 = stime[HiBar[0]];
Value11 = HiVal[0];
date12 = date[LoBar[0]];
time12 = stime[LoBar[0]];
Value12 = LoVal[0];
date21 = date[HiBar[0]];
time21 = stime[HiBar[0]];
date22 = date[0];
time22 = stime[0];
for j = 0 to 6
{
fr[j] = LoVal[1] + ((HiVal[0] - LoVal[1]) * r[j]);
}
box = box_new(date11,time11,Value11,date12,time12,Value12);
Box_SetColor(box,Lime);
Box_SetFill(box,true,35);
}
If LoVal[0] > L Then
{
LoVal[0] = L;
LoBar[0] = 0;
date12 = date[LoBar[0]];
time12 = stime[LoBar[0]];
Value12 = LoVal[0];
date22 = date[0];
time22 = stime[0];
Box_SetEnd(box,date12,time12,Value12);
}
}
If T == 1 Then
{
If T[1] != 1 Then
{
For j = 18 DownTo 0
{
HiVal[j+1] = HiVal[j];
HiBar[j+1] = HiBar[j];
}
HiVal[0] = H;
HiBar[0] = 0;
date11 = date[LoBar[0]];
time11 = stime[LoBar[0]];
Value11 = LoVal[0];
date12 = date[HiBar[0]];
time12 = stime[HiBar[0]];
Value12 = HiVal[0];
date31 = date[LoBar[0]];
time31 = stime[LoBar[0]];
date32 = date[0];
time32 = stime[0];
for j = 0 to 5
{
fr[j] = LoVal[0] + ((HiVal[1] - LoVal[0]) * r[j]);
}
box = Box_New(date11,time11,Value11,date12,time12,Value12);
Box_SetColor(box,Magenta);
Box_SetFill(box,true,35);
}
If HiVal[0] < H Then
{
HiVal[0] = H;
HiBar[0] = 0;
date12 = date[HiBar[0]];
time12 = stime[HiBar[0]];
Value12 = HiVal[0];
TL_SetEnd(TL1, date12,time12,Value12);
date32 = date[0];
time32 = stime[0];
Box_SetEnd(box,date12,time12,Value12);
}
}
1.추세선이 전환되면 그 시점의 박스 크기를 시작점에 큰 글씨로 표기.
계속 커지면 계속 수정 변경하면서 추세가 끝날 때까지 크기를 표기.
2.추세가 역으로 전환되면 색상과 글자 크기를 작게 변경하여, 1p 이하는 지우고 1p 이상만 표기하여 저장.
감사합니다.
2022-11-16
989
글번호 163866
답변완료
79579 수정부탁드립니다
당일검색종목 포함 3봉전에 종목두 검색되도록 부탁드립니다
2022-11-16
812
글번호 163865
윤석한 님에 의해서 삭제되었습니다.
2022-11-16
17
글번호 163864
답변완료
지표수식 부탁드립니다.
5분봉에서 15분 200일 지수이평 지표를 그리고 싶습니다.
밑에것으로 했는데 값이 다르네요
input : Atime(5),Period1(5),Period2(20),Period3(60);
Var : Ep1(0), JISU1(0), PreJISU1(0);
Var : Ep2(0), JISU2(0), PreJISU2(0);
Var : Ep3(0), JISU3(0), PreJISU3(0);
var : TF(0);
Ep1 = 2/(Period1+1);
Ep2 = 2/(Period2+1);
Ep3 = 2/(Period3+1);
TF = TimeToMinutes(stime)%Atime;
if Bdate != bdate[1] or (Bdate == Bdate[1] and TF < TF[1]) Then{
value1 = value1+1;
PreJISU1 = JISU1[1];
PreJISU2 = JISU2[1];
PreJISU3 = JISU3[1];
}
if value1 <= 1 then {
JISU1 = C;
JISU2 = C;
JISU3 = C;
}
else{
JISU1 = C * EP1 + PreJISU1 * (1-EP1);
JISU2 = C * EP2 + PreJISU2 * (1-EP2);
JISU3 = C * EP3 + PreJISU3 * (1-EP3);
}
plot1(JiSu1);
plot2(Jisu2);
plot3(Jisu3);
2022-11-16
929
글번호 163863
답변완료
시스템식 부탁드립니다.
안녕하세요.
첨부 사진은 RSI와 볼린저밴드 지표를 합친 것입니다.
두 지표를 합쳤을때 동그라민 친 부분에서(RSI가 볼린저밴드 상향 또는 하향돌파)
매수 및 매도를 하고 싶습니다.
시스템식으로 가능하다면 매수 매도식 부탁드립니다.
감사합니다.
2022-11-16
1202
글번호 163862
답변완료
수정부탁드립니다
예스스탁 언어로 변경 부탁드립니다
//@version=3
strategy(title = "Chop Zone Strategy - Buy Only")
colorTurquoise = #34dddd
colorDarkGreen = #006400
colorPaleGreen = #98fb98
colorLime = lime
colorDarkRed = #8B0000
colorRed = red
colorOrange = orange
colorLightOrange = #ffc04c
colorYellow = yellow
source = close
avg = hlc3
pi = atan(1) * 4
periods = 30
highestHigh = highest(periods)
lowestLow = lowest(periods)
range = 25 / (highestHigh - lowestLow) * lowestLow
ema34 = ema(source, 34)
x1_ema34 = 0
x2_ema34 = 1
y1_ema34 = 0
y2_ema34 = (ema34[1] - ema34) / avg * range
c_ema34 = sqrt((x2_ema34 - x1_ema34)*(x2_ema34 - x1_ema34) + (y2_ema34 - y1_ema34)*(y2_ema34 - y1_ema34))
emaAngle_1 = round(180 * acos((x2_ema34 - x1_ema34)/c_ema34) / pi)
emaAngle = iff(y2_ema34 > 0, - emaAngle_1, emaAngle_1)
chopZoneColor = emaAngle >= 5 ? colorTurquoise : emaAngle < 5 and emaAngle >= 3.57 ? colorDarkGreen : emaAngle < 3.57 and emaAngle >= 2.14 ? colorPaleGreen : emaAngle < 2.14 and emaAngle >= .71 ? colorLime : emaAngle <= -1 * 5 ? colorDarkRed : emaAngle > -1 * 5 and emaAngle <= -1 * 3.57 ? colorRed : emaAngle > -1 * 3.57 and emaAngle <= -1 * 2.14 ? colorOrange : emaAngle > -1 * 2.14 and emaAngle <= -1 * .71 ? colorLightOrange : colorYellow
plot(1, color=chopZoneColor, style=columns)
sensitivity = input(title="Sensitivity", type=integer, defval=3, minval=1, maxval=100)
boolclose = (chopZoneColor!=colorTurquoise)
boolbuy = (chopZoneColor==colorTurquoise and chopZoneColor[sensitivity]!=colorTurquoise)
for i = 1 to sensitivity-1
if (chopZoneColor[i]==colorTurquoise)
boolclose := false
if (chopZoneColor[i]!=colorTurquoise)
boolbuy := false
strategy.entry("buy", strategy.long, when=boolbuy)
strategy.close("buy", when = boolclose)
2022-11-16
1191
글번호 163861
답변완료
거래체결 수식 질문입니다.
1분봉 차트에 거래량을 구분해서 표시하고 싶은데요.
예를 들어서 1분봉 상에서 한 봉에 거래량이 100개 체결 됐을 경우,
매도호가에 걸려있는 물량을 잡아먹는 매수주문의 체결이 60개,
매수 호가에 걸려있는 물량을 잡아먹는 매도주문의 체결이 40개인 경우에
0 선을 중심으로 위 아래 막대그래프로 표지할 수 있을까요?
또 위와 같은 동일한 막대그래프에서 변수를 설정하면 그 변수 아래의 체결 수량은 무시하고 그 이상의 체결량을 가지고 막대그래프를 표시할 수 있는지 여쭙습니다.
항상 감사합니다!
2022-11-16
1317
글번호 163860
답변완료
수식
if ADX(14)>15 and close-close[20] crosses above 0 then buy next bar at market;
if ADX(14)>15 and close-close[20] crosses below 0  then sellshort next bar at market; SetStopPosition;
SetStopLoss(3000);
SetProfitTarget(6000);
위와같은 트레이드스테이션 소스코드를 예스랭귀지로 변경바랍니다. 제가 예스랭귀지로 변경후 사용해보니 손절 익절이 작동하지 않앗습니다. 익절금액은 달러기준이고 예스랭귀지로는 pt로 테스트해봣습니다. 감사합니다.
2022-11-16
1220
글번호 163857
답변완료
지표 질문입니다
일목균형표에서 선행스팬1 이 선행스팬2 보다 상위일 때 선행스팬 1 최고가(A)를 그린다
일목균형표에서 선행스팬1 이 선행스팬2 보다 하위일 때 선행스팬 1 최저가(B)를 그린다
A+(A-B) 를 그린다
B-(A-B) 를 그린다
감사합니다
2022-11-16
923
글번호 163846