커뮤니티
예스랭귀지 Q&A
답변완료
[공지] 예스랭귀지 AI 어시스턴트, '예스나 AI' 출시 및 무료 체험 안내
안녕하세요, 예스스탁 입니다.복잡한 수식 공부 없이 여러분의 아이디어를 말하면 시스템 트레이딩 언어 예스랭귀지로 작성해주는 서비스예스나 AI(YesNa AI)가 출시되었습니다.지금 예스나 AI를 직접 경험해 보실 수 있도록 20크레딧(질문권 20회)를 무료로 증정해 드리고 있습니다.바로 여러분의 아이디어를 코드로 변환해보세요.--------------------------------------------------🚀 YesNa AI 핵심 기능- 지표식/전략식/종목검색식 생성: 자연어로 요청하면 예스랭귀지 문법에 맞는 코드를 작성합니다.- 종목검색식 변환 지원: K증권의 종목 검색식을 예스랭귀지로 변환 지원합니다.- 컴파일 검증: 작성된 코드가 실행 가능한지 컴파일러를 통해 문법 검증을 거쳐 결과물을 제공합니다.상세한 서비스 개요 및 활용 방법은 [서비스 소개 페이지]에서 확인하실 수 있습니다.▶ 서비스 소개 페이지: 바로가기서비스 사용 유의사항 및 결제 환불정책은 [이용약관]을 참고 부탁드립니다.▶ 서비스 이용약관: 바로가기💬 이용 문의사용 중 문의사항은 [프로그램 사용법 Q&A] 게시판에서 [예스나 AI] 카테고리를 설정 후 문의해 주시면 상세히 안내해 드리겠습니다.--------------------------------------------------앞으로도 AI를 활용한 다양한 트레이딩 기능들을 지속적으로 선보일 예정입니다.많은 관심과 기대 부탁드립니다.
2026-02-27
4380
글번호 230811
회원 님에 의해서 삭제되었습니다.
2018-04-30
15
글번호 118604
답변완료
문의드립니다.
도움주시는 덕분에 도전하고 있습니다. 매번 감사합니다.
1. 기타
밴드폭이 n개봉동안 n이하
이렇게 표현하면 될까요?
그리고 이게 진입봉의 경우 밴드폭이 늘어날텐데요. 전봉까지로 하려면
countif(BWidth < n,n개봉)[1]
이렇게 하면 되나요?
Inputs: Period(20), D(2), Period2(9);
Variables: BBTop(0), BBMid(0), BBBot(0),Bwidth(0),sig(0);
BBTop = BollBandUp(Period,D);
BBMid = ma(C,Period);
BBBot = BollBandDown(Period,D);
BWidth = ((BBTop - BBBot)/ BBMid)*10000;
sig = ma(BWidth,Period2);
countif(BWidth < n,n개봉) < 1
2018-04-30
122
글번호 118603
답변완료
수식부탁드립니다=========
1분차트로해놓고 조건이맞아도 소리가안나네요 부탁드립니다
(아래 교차간격에서는 소리가 정상적으로 납니다 )
var:신호비교봉(3),신호발생가격(1250),찬스라인(0.1),downn(0.99),LENGTH1(60),LENGTH2(10),비교봉(5),비교봉1(5),양합상승(1.008),양합하락(0.985),표시2(0);
Input:라인폭(0),소리2(0),소리22(0),표시위치(0.7),최고저기준(10),교차간격(0.05),abs간격(2),susmss간격(3);
INPUTS: LENGTH11(30),전봉차(0);
Input : Periodtsf(30);
Input : Periodt(30);
VARS: TEMA11(0),susm22tem(0);
var : sum2(0,data1),sum4(0,data1),sum6(0,data1),TEMA1atm2(0),TEMA1atm4(0),TEMA1atm6(0),ss(0);
var : HH(0,data2),LL(0,data2),hl(0,data2),ii(0,data2);;
var : crup(0),crdn(0),sum22(0),ccurnt(0),cgap(0),callgap(0),putgap(0),plemeumgap(0),chanline(0);
var :linegi(0),data2yc(0),data3yc(0),hapyc(0),hapycrt(0),TEMA1hapycrt(0),crup96(0),data2opc(0),data3opc(0),datatoopp(0);
var :susm22(0),sucrup(0),hhh(0),lll(0),hii(0),chanceline(0),pyungyc(0),pyungty(0);
var :dataabs(0),dataabstem(0);
sum2 = (data2(c)+data3(c));
sum22 =(data2(c)+data3(c))/2*250000;
data2opc = data2(openD(0));
data3opc = data3(openD(0));
// if data2(dayindex+1 == 3) Then
// data2opc = data2(c);
// if data3(dayindex+1 == 3) Then
// data3opc = data3(c);
dataabs = abs(data2(c) - data3(c));
//************ susm22의 테마 *****************************************
dataabstem = (3 * Ema(dataabs,LENGTH11)) - (3 * Ema(Ema(dataabs,LENGTH11),LENGTH11)) +
(Ema(Ema(Ema(dataabs,LENGTH11),LENGTH11),LENGTH11));
// Plot41(dataabstem,"abstemup",iff((dataabstem )>(dataabstem[1])+00,RED,iff((dataabstem )<(dataabstem[1] )-00,BLUE,BLACK)));
//*********************************************************
datatoopp = (data2opc + data3opc) / 2 *250000;
susm22 = sum22 - datatoopp;
data2yc = data2(closeD(1));
data3yc = data3(closeD(1));
pyungyc = ( data2yc + data3yc ) / 2 *250000;
pyungty = pyungyc - datatoopp;
if data2(bdate != bdate[1]) Then{
ii = 0;
HHh = susm22;
LlL = susm22;
}
else
{
ii = ii+1;
if ii < 최고저기준 Then
{
if susm22 > hhh Then
hhh = susm22;
if susm22 < lll Then
lll = susm22;
}
else{
hhh = data2(highest(susm22,최고저기준));
lll = data2(lowest(susm22,최고저기준));
}
}
hii = (hhh + lll)/2;
//plot1(sum2,"양합");
PLOT3(sum22,"수정양합");
//hhh = hh - susm22;
//lll = ll - susm22;
//hii = (hhh + lll) / 2;
plot21(HHh,"Data2 H" );
plot22(LLl,"Data2 L");
plot76(hii,"hii");
/*
if ss<=0 and hii > hii[신호비교봉] + 신호발생가격 then {
ss=1;
PLOT24(0,"상승");
if 소리2 == 1 then {
PlaySound("C:UsersAdministratorDesktopsound동시매수진입.wav");
}
}
if ss>=0 and hii < hii[신호비교봉] - 신호발생가격 then {
ss=-1;
PLOT25(0,"하락");
if 소리2 == 1 then {
PlaySound("C:UsersAdministratorDesktopsound동시매도진입.wav");
}
}
*/
/**********************************************************************
if ss<=0 and tema1[1] < tema1 Then {
ss=1;
PLOT45((tema1 )-0.01,"매수");
// PlaySound("C:UsersAdministratorDesktop효과Bandi.wav");
}
if ss>=0 and tema1[1] > tema1 Then {
ss=-1;
PLOT46((tema1 )-0.01,"매도");
//PlaySound("C:UsersAdministratorDesktop효과click08.wav");
}
**********************************************************************/
TEMA1atm2 = (3 * Ema(sum22,LENGTH1)) - (3 * Ema(Ema(sum22,LENGTH1),LENGTH1)) +
(Ema(Ema(Ema(sum22,LENGTH1),LENGTH1),LENGTH1));
plot5(TEMA1atm2,"태마2",iff((TEMA1atm2 )>(TEMA1atm2[1])+00,RED,iff((TEMA1atm2 )<(TEMA1atm2[1] )-00,BLUE,BLACK)));
if ( Data2(c) > Data3(c)) and ( Data2(c) - Data3(c)) < 교차간격 Then{
crup = (Data2(c)+Data3(c))/2*250000;
ccurnt = c;
}
if ( Data3(c) > Data2(c)) and ( Data3(c) - Data2(c)) < 교차간격 Then{
crup = (Data2(c)+Data3(c))/2*250000;
ccurnt = c;
}
// PLOT31(crup,"교차라인");
if ( Data2(c) > Data3(c)) and ( Data2(c) - Data3(c)) < 교차간격 Then{
PLOT52(10000,"상승교차");
if 소리2 == 1 then {
PlaySound("C:UsersAdministratorDesktopsounddd2.wav");
}
}
if ( Data3(c) > Data2(c)) and ( Data3(c) - Data2(c)) < 교차간격 Then{
PLOT53(10000,"하락교차");
if 소리2 == 1 then {
PlaySound("C:UsersAdministratorDesktopsounddd2.wav");
}
}
if sTime == 090000 Then {
plot59( 20000,"장시작" );
}
// PLOT58(datatoopp ,"시가평균");
susm22 = sum22 - datatoopp;
PLOT99(susm22 ,"시가대비평가");
//************ susm22의 테마 *****************************************
susm22tem = (3 * Ema(susm22,LENGTH11)) - (3 * Ema(Ema(susm22,LENGTH11),LENGTH11)) +
(Ema(Ema(Ema(susm22,LENGTH11),LENGTH11),LENGTH11));
Plot75(susm22tem,"temup",iff((susm22tem )>(susm22tem[1])+00,RED,iff((susm22tem )<(susm22tem[1] )-00,BLUE,BLACK)));
Plot91(susm22tem-라인폭,"susm22tem_1") ;
Plot92(susm22tem+라인폭,"susm22tem_2") ;
if susm22tem > susm22tem[1] and (NextBarSdate > sdate or (NextBarSdate == sdate and NextBarStime > stime)) Then{
plot93(susm22tem,"susmup");
if 소리2 == 1 then {
PlaySound("C:UsersAdministratorDesktopsounddn3.wav");
}
}
if susm22tem < susm22tem[1] and (NextBarSdate > sdate or (NextBarSdate == sdate and NextBarStime > stime)) Then{
plot94(susm22tem,"susmdn");
if 소리2 == 1 then {
PlaySound("C:UsersAdministratorDesktopsounddd5.wav");
}
}
/*
if ss<=0 and susm22tem < susm22tem[susmss간격] then {
ss=1;
PLOT24(susm22,"매도진입");
if 소리2 == 1 then {
PlaySound("C:UsersAdministratorDesktopsounddn3.wav");
}
}
if ss>=0 and susm22tem > susm22tem[susmss간격] then {
ss=-1;
PLOT25(susm22,"매수진입");
if 소리2 == 1 then {
PlaySound("C:UsersAdministratorDesktopsounddd5.wav");
}
}
*/
//*********************************************************
plotbaseline1(0);
/*
plotbaseline2(-10000);
plotbaseline3(-20000);
plotbaseline4(-30000);
plotbaseline5(-40000);
plotbaseline6(10000);
plotbaseline8(20000);
plotbaseline9(30000);
plotbaseline10(40000);
*/
sucrup = crup - datatoopp;
PLOT62(sucrup,"수정교차라인");
// chanceline = datatoopp * 찬스라인;
// PLOT63(chanceline,"찬스라인");
PLOT63(pyungty ,"전데이타평");
if 소리22 == 1 then {
if CrossDown(susm22,-10000) or CrossUp(susm22,-10000) Then
{ plot64(susm22,"-10000");
PlaySound("C:UsersAdministratorDesktopsound마1w.wav");
}
if CrossDown(susm22,-20000) or CrossUp(susm22,-20000) Then
{ plot65(susm22,"-20000");
PlaySound("C:UsersAdministratorDesktopsound마2w.wav");
}
if CrossDown(susm22,-30000) or CrossUp(susm22,-30000) Then
{ plot66(susm22,"-30000");
PlaySound("C:UsersAdministratorDesktopsound마3w.wav");
}
if CrossDown(susm22,-40000) or CrossUp(susm22,-40000) Then
{ plot67(susm22,"-40000");
PlaySound("C:UsersAdministratorDesktopsound마4w.wav");
}
//*********************************+++++++++++++++++++++++++++++++++++++
if CrossDown(susm22,10000) or CrossUp(susm22,10000) Then
{ plot68(susm22,"10000");
PlaySound("C:UsersAdministratorDesktopsound프1w.wav");
}
if CrossDown(susm22,20000) or CrossUp(susm22,20000) Then
{ plot69(susm22,"20000");
PlaySound("C:UsersAdministratorDesktopsound프2w.wav");
}
if CrossDown(susm22,30000) or CrossUp(susm22,30000) Then
{ plot70(susm22,"30000");
PlaySound("C:UsersAdministratorDesktopsound프3w.wav");
}
if CrossDown(susm22,40000) or CrossUp(susm22,40000) Then
{ plot71(susm22,"40000");
PlaySound("C:UsersAdministratorDesktopsound프4w.wav");
}
}
var : LRLv(0);
LRLv = LRL(susm22,Periodt);
Plot72(LRLv, "LRS_susm22");
var : TSF(0);
TSF = LRL(susm22,Periodtsf)+LRS(susm22,Periodtsf);
//Plot91(TSF-라인폭,"TSF_susm221") ;
//Plot92(TSF+라인폭,"TSF_susm222") ;
if susm22 > -5000 and susm22 <= 0 then plot83(tsf,"하1");
if susm22 > -10000 and susm22 <= -5000 then plot84(tsf,"하2");
if susm22 > -15000 and susm22 <= -10000 then plot85(tsf,"하3");
if susm22 > -20000 and susm22 <= -15000 then plot86(tsf,"하4");
if susm22 > -25000 and susm22 <= -20000 then plot87(tsf,"하5");
if susm22 > -30000 and susm22 <= -25000 then plot88(tsf,"하6");
if susm22 > -35000 and susm22 <= -30000 then plot89(tsf,"하7");
if susm22 > -40000 and susm22 <= -35000 then plot90(tsf,"하8");
2018-05-01
196
글번호 118601
답변완료
함수요청
안녕하세요?
60분봉상 크루드오일 전략을 작성하고 있습니다.
월봉상 MACD오실레이터가 월봉상 직전봉기준 0값 이상이면 A매수진입&청산전략을
0값 이하면 B매도진입&청산전략을
월봉상 직전봉기군 5ma>20ma이면 C매수진입&청산전략을
5ma<20ma면 D매도진입&청산전략을 사용하고 싶습니다.
함수 요청드립니다.
2018-04-30
112
글번호 118599
답변완료
주석을달아주세요
아래수식 주석을 달아주세요
input : 시작시간(174000),종료시간(030000);
input : 지표출력시작시간(100000),지표출력종료시간(170000);
var : HH(0),LL(0);
if stime == 시작시간 or (stime > 시작시간 and stime[1] < 시작시간) Then{
HH = H;
LL = L;
}
if 시작시간 > 종료시간 then{
if stime >= 시작시간 or stime <= 종료시간 Then{
if H > HH Then
HH = H;
if L < LL Then
LL = L;
}
}
if 시작시간 < 종료시간 then{
if stime >= 시작시간 and stime <= 종료시간 Then{
if H > HH Then
HH = H;
if L < LL Then
LL = L;
}
}
if stime >= 지표출력시작시간 and stime < 지표출력종료시간 and HH > 0 and LL > 0 then{
var1 = HH+(HH-LL)*1.618;
var2 = HH+(HH-LL)*2.000;
var3 = HH+(HH-LL)*2.618;
var4 = HH+(HH-LL)*3.000;
var5 = LL-(HH-LL)*1.618;
var6 = LL-(HH-LL)*2.000;
var7 = LL-(HH-LL)*2.618;
var8 = LL-(HH-LL)*3.000;
plot1(var1,"+1.618");
plot2(var2,"+2.000");
plot3(var3,"+2.618");
plot4(var4,"+3.000");
plot5(var5,"-1.618");
plot6(var6,"-2.000");
plot7(var7,"-2.618");
plot8(var8,"-3.000");
}
이런식으로 위아래 양방향으로 내고 싶습니다
시스템식~
input : 시작시간(174000),종료시간(030000);
input : 지표출력시작시간(100000),지표출력종료시간(170000);
var : HH(0),LL(0);
if stime == 시작시간 or (stime > 시작시간 and stime[1] < 시작시간) Then{
HH = H;
LL = L;
}
if 시작시간 > 종료시간 then{
if stime >= 시작시간 or stime <= 종료시간 Then{
if H > HH Then
HH = H;
if L < LL Then
LL = L;
}
}
if 시작시간 < 종료시간 then{
if stime >= 시작시간 and stime <= 종료시간 Then{
if H > HH Then
HH = H;
if L < LL Then
LL = L;
}
}
if stime >= 지표출력시작시간 and stime < 지표출력종료시간 and HH > 0 and LL > 0 then{
var1 = HH+(HH-LL)*1.618;
var2 = HH+(HH-LL)*2.000;
var3 = HH+(HH-LL)*2.618;
var4 = HH+(HH-LL)*3.000;
var5 = LL-(HH-LL)*1.618;
var6 = LL-(HH-LL)*2.000;
var7 = LL-(HH-LL)*2.618;
var8 = LL-(HH-LL)*3.000;
if crossdown(c,var1) Then
buy();
if Crossup(c,var5) Then
sell();
고점저점의예식)
input:left(5),right(5),구분(1);
var:j(0),prehv(0),prelv(0),prehb(0),prelb(0),tmpv(0),tmpb(0),
ovr(0),반등(1),반락(-1);
array:hv[10](0),lv[10](0),hb[10](0),lb[10](0),
r[8](0),fr[8](0);
r[0] = 0;
r[1] = 0.236;
r[2] = 0.382;
r[3] = 0.50;
r[4] = 0.618;
r[5] = 0.764;
r[6] = 1;
r[7] = 1.618;
#==============================================================================#
# 변곡점 계산
#==============================================================================#
//파동선 작성 설명은 자주 했으므로 생략
if highest(h[1],left) <= h then {
prehv = h;
prehb = 0;
}
else
prehb = prehb + 1;
if lowest(l[1],left) >= l then {
prelv = l;
prelb = 0;
}
else
prelb = prelb + 1;
for j = 1 to 9 begin
hb[j] = hb[j] + 1;
lb[j] = lb[j] + 1;
end;
if prehb == right and highest(h,right) <= h[right] then {
for j = 9 downto 2 {
hv[j] = hv[j-1];
hb[j] = hb[j-1];
}
hv[1] = prehv;
hb[1] = prehb;
if lb[1] > hb[2] then {
for j = 9 downto 2 {
lv[j] = lv[j-1];
lb[j] = lb[j-1];
}
tmpv = 0;
for j = hb[1] + 1 to hb[2] - 1 {
if tmpv > l[j] or tmpv ==0 then {
tmpv = l[j];
tmpb = j;
}
}
lv[1] = tmpv;
lb[1] = tmpb;
}
}
if prelb == right and lowest(l,right) >= l[right] then {
for j = 9 downto 2 {
lv[j] = lv[j-1];
lb[j] = lb[j-1];
}
lv[1] = prelv;
lb[1] = prelb;
if hb[1] > lb[2] then {
for j = 9 downto 2 {
hv[j] = hv[j-1];
hb[j] = hb[j-1];
}
tmpv = 0;
for j = lb[1] + 1 to lb[2] - 1 {
if tmpv < h[j] or tmpv ==0 then {
tmpv = h[j];
tmpb = j;
}
}
hv[1] = tmpv;
hb[1] = tmpb;
}
}
#==============================================================================#
# Fibonacci Retracements 계산
#==============================================================================#
//반등과 반락을 모두 표시하게 되면 복잡해지므로 한 방향만 표시하는 것이 옳음
if 구분 == 반등 then {
if crossup(lb[1],hb[1]) then
{
for j = 0 to 7 begin
fr[j] = hv[1] - (hv[1] - lv[1]) * r[j];
end;
ovr = 0;
}
if fr[6]>l then ovr = 1;
}
if 구분 == 반락 then {
if crossup(hb[1],lb[1]) then
{
for j = 0 to 7 begin
fr[j] = lv[1] + (hv[1] - lv[1]) * r[j];
end;
ovr = 0;
}
if fr[6]>l then ovr = 1;
}
#==============================================================================#
# 지표출력
#==============================================================================#
if hb[1]==right then plot1(hv[1],"파동선",GREEN);
if lb[1]==right then plot1(lv[1],"파동선",GREEN);
plot2(fr[0],"0%",BLUE);
plot3(fr[1],"23.6%",RED);
plot4(fr[2],"38.2%",MAGENTA);
plot5(fr[3],"50%",GRAY);
plot6(fr[4],"61.8%",LBLUE);
plot7(fr[5],"76.4%",LGREEN);
plot8(fr[6],"100%",PINK);
if ovr then plot9(fr[7],"161.8%",LMAGENTA); //점 그래프로 표시
2018-04-30
125
글번호 118598
회원 님에 의해서 삭제되었습니다.
2018-04-30
107
글번호 118581
답변완료
질문입니다.
C[0]와 C[1]을 비교하여,
C[0] > C[1] 이라면 1,
C[0] == C[1] 이라면 0,
C[0] < C[1] 이라면 -1을 대입합니다.
다음으로는 C[1]과 C[2]를 비교하여,
C[1] > C[2] 이라면 1,
C[1] == C[2] 이라면 0,
C[1] < C[2] 이라면 -1을 대입합니다.
이를 기간 X만큼 진행하고, 그 합을 그래프로 나타내고 싶습니다.
주석과 함께 예시로 부탁드립니다.
감사합니다.
2018-04-30
139
글번호 118579
답변완료
수식부탁드립니다======================
//susm22tem 는 susm22 를 tema 한 값인데요 susm22tem 를 만들때 susm22의 오늘데이타만
//참고하여 작성하고싶슴니다 수정부탁드립니다 감사합니다'
susm22tem = (3 * Ema(susm22,LENGTH11)) - (3 * Ema(Ema(susm22,LENGTH11),LENGTH11)) +
(Ema(Ema(Ema(susm22,LENGTH11),LENGTH11),LENGTH11));
Plot75(susm22tem,"temup",iff((susm22tem )>(susm22tem[1])+00,RED,iff((susm22tem )<(susm22tem[1] )-00,BLUE,BLACK)));
Plot91(susm22tem-라인폭,"susm22tem_1") ;
Plot92(susm22tem+라인폭,"susm22tem_2") ;
if susm22tem > susm22tem[1] and (NextBarSdate > sdate or (NextBarSdate == sdate and NextBarStime > stime)) Then{
plot93(susm22tem,"susmup");
if 소리2 == 1 then {
PlaySound("C:₩Users₩Administrator₩Desktop₩sound₩dn3.wav");
}
}
if susm22tem < susm22tem[1] and (NextBarSdate > sdate or (NextBarSdate == sdate and NextBarStime > stime)) Then{
plot94(susm22tem,"susmdn");
if 소리2 == 1 then {
PlaySound("C:₩Users₩Administrator₩Desktop₩sound₩dd5.wav");
}
}
2018-04-30
189
글번호 118578
답변완료
수식 부탁합니다
스토캐스틱 (25.6.6) 월봉의 스토캐스틱이
골든크로스가 발생된 종목을 일봉검색에서
찾을 수 있는 수식 부탁합니다
2018-04-30
141
글번호 118577