커뮤니티
예스랭귀지 Q&A
답변완료
[공지] 예스랭귀지 AI 어시스턴트, '예스나 AI' 출시 및 무료 체험 안내
안녕하세요, 예스스탁 입니다.복잡한 수식 공부 없이 여러분의 아이디어를 말하면 시스템 트레이딩 언어 예스랭귀지로 작성해주는 서비스예스나 AI(YesNa AI)가 출시되었습니다.지금 예스나 AI를 직접 경험해 보실 수 있도록 20크레딧(질문권 20회)를 무료로 증정해 드리고 있습니다.바로 여러분의 아이디어를 코드로 변환해보세요.--------------------------------------------------🚀 YesNa AI 핵심 기능- 지표식/전략식/종목검색식 생성: 자연어로 요청하면 예스랭귀지 문법에 맞는 코드를 작성합니다.- 종목검색식 변환 지원: K증권의 종목 검색식을 예스랭귀지로 변환 지원합니다.- 컴파일 검증: 작성된 코드가 실행 가능한지 컴파일러를 통해 문법 검증을 거쳐 결과물을 제공합니다.상세한 서비스 개요 및 활용 방법은 [서비스 소개 페이지]에서 확인하실 수 있습니다.▶ 서비스 소개 페이지: 바로가기서비스 사용 유의사항 및 결제 환불정책은 [이용약관]을 참고 부탁드립니다.▶ 서비스 이용약관: 바로가기💬 이용 문의사용 중 문의사항은 [프로그램 사용법 Q&A] 게시판에서 [예스나 AI] 카테고리를 설정 후 문의해 주시면 상세히 안내해 드리겠습니다.--------------------------------------------------앞으로도 AI를 활용한 다양한 트레이딩 기능들을 지속적으로 선보일 예정입니다.많은 관심과 기대 부탁드립니다.
2026-02-27
4355
글번호 230811
답변완료
문의드립니다.
안녕하세요??
또 평균값 문의드립니다.
분봉차트에서 전일 시가보다 같거나 높은 고가의 평균값, 저가의 평균값, 종가의 평균값과 전일의 시가보다 같거나 낮은 고가의 평균값, 저가의 평균값, 종가의 평균값을 차트에 표현하고 싶습니다. 지지/저항의 여부를 확인하려 합니다. 부탁드립니다.
2017-07-14
96
글번호 111318
답변완료
문의 드립니다.
안녕하세요.
시뮬레이션 차트에 연결선물 지수의 일간의 고점 저점을
30분차트에 기록하는 것이 가능한지요?
가능하다면
제가 첨부한 파일은 선물의 일간 고점 저점의 진폭을 수작업으로 기록하고 있는데요.
1. 고점 저점을 기록하는데 30분의 20이평 기준으로 아래에서 저점 그리고 20이평 위의 고점을 기록하고
2. 고점과 저점의 진폭을 계산할 수 있는지요.
이것을 자동으로 만들 수 있으면 편리할 것 같아서요.
가능한지 궁금합니다.
무더운 여름 건강하십시요.
2017-07-14
97
글번호 111316
답변완료
시스템 합성관련 문의
안녕하세요.
무더운 여름 고생이 많으시네요
제가 도움을 구하고자 하는것은 두 가지 시스템을 합성을 하려다보니 첨부된 파일과 같이
"연산자 앞뒤 두데이터의 형태가 같아야 합니다" 라는 문구가 뜨는데 어떻게 하는지 몰라서 문의 드립니다.
시스템#1================================================================================
input : 거래시간 (1), 시작시간 (160000), 끝시간 (045000),익절틱수 (15),손절틱수 (15);
input : P(20);
Var: value(0), HH(0), LL(0), HHH(0), LLL(0), FK(0);
HHH = highest(H,P);
LLL = lowest(L,P);
FK = (C-LLL) / (HHH-LLL) * 100;
if 거래시간 == 1 then
condition3 = (stime>=시작시간 or stime<=끝시간);
Else if 거래시간 == 2 then
condition3 = (stime>=시작시간 and stime<=끝시간);
Else
condition3 = true;
# 매수/매도청산
If MarketPosition == 0 and TotalTrades == TotalTrades[1] and
Condition3 == true and crossup(FK,80) Then
{
Buy();
}
# 매도/매수청산
If MarketPosition == 0 and TotalTrades == TotalTrades[1] and
Condition3 == true and CrossDown(FK,20) Then
{
Sell();
}
if MarketPosition == 1 Then{
LL = Floor((highest(H,BarsSinceEntry) - EntryPrice)/(PriceScale*손절틱수 ));
ExitLong("bx",AtStop,(EntryPrice-(PriceScale*손절틱수 ))+(PriceScale*손절틱수 )*LL);
}
if MarketPosition == -1 Then{
HH = Floor((EntryPrice-Lowest(L,BarsSinceEntry))/(PriceScale*손절틱수 ));
ExitShort("sx",AtStop,(EntryPrice+(PriceScale*손절틱수))-(PriceScale*손절틱수 )*HH);
}
SetStopProfittarget(PriceScale*익절틱수,PointStop);
if stime == 끝시간 or (stime > 끝시간 and stime[1] < 끝시간 ) Then{
if MarketPosition == 1 Then
ExitLong();
if MarketPosition == -1 Then
ExitShort();
}
시스템#2 ==========================================================================
input : 거래시간 (1), 시작시간 (160000), 끝시간 (045000),익절틱수 (15),손절틱수 (15);
input : Period1(50), Period2(10), Period3(5), sigPeriod(9), FastMovAvg(12), SlowMovAvg(26), MACDMovAvg(9);
Var: CCIv(0), CCIsig(0), HH(0), LL(0), XMACD(0);
CCIv = CCI(Period1);
CCIsig = ema(CCIv,Period2);
value1 = TRIX(Period3);
value2 = ema(value1, sigPeriod);
if 거래시간 == 1 then
condition3 = (stime>=시작시간 or stime<=끝시간);
Else if 거래시간 == 2 then
condition3 = (stime>=시작시간 and stime<=끝시간);
Else
condition3 = true;
If MarketPosition == 0 and TotalTrades == TotalTrades[1] and
Condition3 == true and CrossUp(CCIv, 0) and (CrossUP(value1, value2) or Crossup(MACD(FastMovAvg, SlowMovAvg), EMA(MACD(FastMovAvg, SlowMovAvg), MACDMovAvg)[1])) Then
Buy();
If MarketPosition == 0 and TotalTrades == TotalTrades[1] and
Condition3 == true and CrossDown(CCIv, 0) and (CrossDown(value1, value2) or CrossDown(MACD(FastMovAvg, SlowMovAvg), EMA(MACD(FastMovAvg, SlowMovAvg), MACDMovAvg)[1])) Then
Sell();
if MarketPosition == 1 Then{
LL = Floor((highest(H,BarsSinceEntry) - EntryPrice)/(PriceScale*손절틱수 ));
ExitLong("bx",AtStop,(EntryPrice-(PriceScale*손절틱수 ))+(PriceScale*손절틱수 )*LL);
}
if MarketPosition == -1 Then{
HH = Floor((EntryPrice-Lowest(L,BarsSinceEntry))/(PriceScale*손절틱수 ));
ExitShort("sx",AtStop,(EntryPrice+(PriceScale*손절틱수))-(PriceScale*손절틱수 )*HH);
}
SetStopProfittarget(PriceScale*익절틱수,PointStop);
if stime == 끝시간 or (stime > 끝시간 and stime[1] < 끝시간 ) Then{
if MarketPosition == 1 Then
ExitLong();
if MarketPosition == -1 Then
ExitShort();
}
수고하세요....
2017-07-14
169
글번호 111314
답변완료
함수요청
안녕하세요?
함수요청드립니다.
매수1 : 전일 봉이 양봉 상승 마감이고 당일 시가가 전일 종가대비 0.3%이상, 0.5%이하 상승시
전일 종가와 같은 가격으로
매수2 : 전일 봉이 양봉 상승 마감이고 당일 시가가 전일 종가대비 0.5%초과 상승시
전일 고가와 같은 가격으로
매도1 : 전일 봉이 음봉 하락 마감이고 당일 시가가 전일 종가대비 -0.3%이하, -0.5%이상 하락시 전일 종가와 같은 가격으로
매도2 : 전일 봉이 음봉 하락 마감이고 당일 시가가 전일 종가대비 -0.5%초과 하락시 전일 저가와 같은 가격으로
청산 : 당일 종가청산
2017-07-14
96
글번호 111313
답변완료
오류 문의
Input : EntTime(090100);
If MarketPosition == 0 and sTime >= EntTime and sTime < 151800 Then
Sell("s", AtStop, Highest(H, DayIndex+1)-0.1, 1) ;
SetStopLoss(0.11, PointStop);
If sTime == 151800 Then ExitShort();
위 수식을 적용하면, 첨부한 사진처럼 7/12일에 매도신호가 뜹니다.
수식의 의도는 당일 최고가에서 0.1pt 하락시 매도가 들어가도록 하는 건데
왜 고가에서 0.1pt 가 하락하지도 않았는데, 신호가 뜰까요?
뭐가 잘못된 건지요?
(적용한 종목은 7월물 콜317입니다.)
2017-07-18
107
글번호 111312
답변완료
문의드립니다.
안녕하세요
다름이아니고
메타프로그램 MT4 라는 프로그램의
언어를 이용하여서
예스트레이더 언어로 수정이 가능한지 궁금해서
여쭈어봅니다
//+------------+-----------------------------------------------------+
//| v.22.04.07 | ArrZZx2.mq4 |
//+------------+ |
//|------------| Bookkeeper, 2007, yuzefovich@gmail.com |
//+------------+-----------------------------------------------------+
#property copyright ""
#property link "http://www.forexter.land.ru/indicators.htm"
//----
#property indicator_chart_window
#property indicator_buffers 8
#property indicator_color1 MediumBlue
#property indicator_color2 RoyalBlue
#property indicator_color3 Blue
#property indicator_color4 Blue
#property indicator_color5 DarkGreen
#property indicator_color6 Red
#property indicator_color7 DarkGreen
#property indicator_color8 Red
//--------------------------------------------------------------------
extern int SR =3; // =3..4
extern int SRZZ =12; // =4..12..20
extern int MainRZZ=20; // =12..20..54...
extern int FP =21;
extern int SMF =3; // =1..5
extern bool DrawZZ =false;
extern int PriceConst=0; // 0 - Close
// 1 - Open
// 2 - High
// 3 - Low
// 4 - (H+L)/2
// 5 - (H+L+C)/3
// 6 - (H+L+2*C)/4
//extern string Prefix="ArrZZx2";
//--------------------------------------------------------------------
double Lmt[];
double LZZ[];
double SA[];
double SM[];
double Up[];
double Dn[];
double pUp[];
double pDn[];
//---------------------------------------------------------------------
int LTF[6]={0,0,0,0,0,0},STF[5]={0,0,0,0,0};
int MaxBar, nSBZZ, nLBZZ, SBZZ, LBZZ;
bool First=true;
int prevBars=0;
//---------------------------------------------------------------------
void MainCalculation(int Pos) {
if((Bars-Pos)>(SR+1)) SACalc(Pos); else SA[Pos]=0;
if((Bars-Pos)>(FP+SR+2)) SMCalc(Pos); else SM[Pos]=0; return; }
//---------------------------------------------------------------------
void SACalc(int Pos) { int sw, i, w, ww, Shift; double sum;
switch(PriceConst) {
case 0:
SA[Pos]=iMA(NULL,0,SR+1,0,MODE_LWMA,PRICE_CLOSE,Pos);
break;
case 1:
SA[Pos]=iMA(NULL,0,SR+1,0,MODE_LWMA,PRICE_OPEN,Pos);
break;
/*case 2:
SA[Pos]=iMA(NULL,0,SR+1,0,MODE_LWMA,PRICE_HIGH,Pos);
break;
case 3:
SA[Pos]=iMA(NULL,0,SR+1,0,MODE_LWMA,PRICE_LOW,Pos);
break;*/
case 4:
SA[Pos]=iMA(NULL,0,SR+1,0,MODE_LWMA,PRICE_MEDIAN,Pos);
break;
case 5:
SA[Pos]=iMA(NULL,0,SR+1,0,MODE_LWMA,PRICE_TYPICAL,Pos);
break;
case 6:
SA[Pos]=iMA(NULL,0,SR+1,0,MODE_LWMA,PRICE_WEIGHTED,Pos);
break;
default:
SA[Pos]=iMA(NULL,0,SR+1,0,MODE_LWMA,PRICE_OPEN,Pos);
break; }
for(Shift=Pos+SR+2;Shift>Pos;Shift--) { sum=0.0; sw=0; i=0; w=Shift+SR;
ww=Shift-SR; if(ww<Pos) ww=Pos;
while(w>=Shift) {i++; sum=sum+i*SnakePrice(w); sw=sw+i; w--; }
while(w>=ww) { i--; sum=sum+i*SnakePrice(w); sw=sw+i; w--; }
SA[Shift]=sum/sw; } return; }
//----
double SnakePrice(int Shift) {
switch(PriceConst) {
case 0: return(Close[Shift]);
case 1: return(Open[Shift]);
/*case 2: return(High[Shift]);
case 3: return(Low[Shift]);*/
case 4: return((High[Shift]+Low[Shift])/2);
case 5: return((Close[Shift]+High[Shift]+Low[Shift])/3);
case 6: return((2*Close[Shift]+High[Shift]+Low[Shift])/4);
default: return(Open[Shift]); } }
//---------------------------------------------------------------------
void SMCalc(int i) { double t, b;
for(int Shift=i+SR+2;Shift>=i;Shift--) {
t=SA[ArrayMaximum(SA,FP,Shift)]; b=SA[ArrayMinimum(SA,FP,Shift)];
SM[Shift]=(2*(2+SMF)*SA[Shift]-(t+b))/2/(1+SMF); } return; }
//---------------------------------------------------------------------
void LZZCalc(int Pos) {
int i,RBar,LBar,ZZ,NZZ,NZig,NZag;
i=Pos-1; NZig=0; NZag=0;
while(i<MaxBar && ZZ==0) { i++; LZZ[i]=0; RBar=i-MainRZZ;
if(RBar<Pos) RBar=Pos; LBar=i+MainRZZ;
if(i==ArrayMinimum(SM,LBar-RBar+1,RBar)) { ZZ=-1; NZig=i; }
if(i==ArrayMaximum(SM,LBar-RBar+1,RBar)) { ZZ=1;NZag=i; } }
if(ZZ==0) return; NZZ=0;
if(i>Pos) { if(SM[i]>SM[Pos]) { if(ZZ==1) {
if(i>=Pos+MainRZZ && NZZ<5) { NZZ++; LTF[NZZ]=i; } NZag=i;
LZZ[i]=SM[i]; } }
else { if(ZZ==-1) { if(i>=Pos+MainRZZ && NZZ<5) { NZZ++; LTF[NZZ]=i; }
NZig=i; LZZ[i]=SM[i]; } } }
while(i<LBZZ || NZZ<5) { LZZ[i]=0; RBar=i-MainRZZ;
if(RBar<Pos) RBar=Pos; LBar=i+MainRZZ;
if(i==ArrayMinimum(SM,LBar-RBar+1,RBar)) {
if(ZZ==-1 && SM[i]<SM[NZig]) {
if(i>=Pos+MainRZZ && NZZ<5) LTF[NZZ]=i; LZZ[NZig]=0; LZZ[i]=SM[i];
NZig=i; }
if(ZZ==1) { if(i>=Pos+MainRZZ && NZZ<5) { NZZ++; LTF[NZZ]=i; }
LZZ[i]=SM[i]; ZZ=-1; NZig=i; } }
if(i==ArrayMaximum(SM,LBar-RBar+1,RBar)) {
if(ZZ==1 && SM[i]>SM[NZag]) {
if(i>=Pos+MainRZZ && NZZ<5) LTF[NZZ]=i; LZZ[NZag]=0; LZZ[i]=SM[i];
NZag=i; }
if(ZZ==-1) { if(i>=Pos+MainRZZ && NZZ<5) { NZZ++; LTF[NZZ]=i; }
LZZ[i]=SM[i]; ZZ=1; NZag=i; } } i++; if(i>MaxBar) return; }
nLBZZ=Bars-LTF[5]; LZZ[Pos]=SM[Pos]; return; }
//----
void SZZCalc(int Pos) {
int i,RBar,LBar,ZZ,NZZ,NZig,NZag;
i=Pos-1; NZig=0; NZag=0;
while(i<=LBZZ && ZZ==0) { i++; pDn[i]=0; pUp[i]=0; Dn[i]=0; Up[i]=0;
Lmt[i]=0; RBar=i-SRZZ; if(RBar<Pos) RBar=Pos; LBar=i+SRZZ;
if(i==ArrayMinimum(SM,LBar-RBar+1,RBar)) { ZZ=-1; NZig=i; }
if(i==ArrayMaximum(SM,LBar-RBar+1,RBar)) { ZZ=1; NZag=i; } }
if(ZZ==0) return; NZZ=0;
if(i>Pos) { if(SM[i]>SM[Pos]) { if(ZZ==1) {
if(i>=Pos+SRZZ && NZZ<4) { NZZ++; STF[NZZ]=i; } NZag=i;
Dn[i-1]=Open[i-1]; } }
else { if(ZZ==-1) { if(i>=Pos+SRZZ && NZZ<4) { NZZ++; STF[NZZ]=i; }
NZig=i; Up[i-1]=Open[i-1]; } } }
while(i<=LBZZ || NZZ<4) { pDn[i]=0; pUp[i]=0; Dn[i]=0; Up[i]=0;
Lmt[i]=0; RBar=i-SRZZ; if(RBar<Pos) RBar=Pos; LBar=i+SRZZ;
if(i==ArrayMinimum(SM,LBar-RBar+1,RBar)) {
if(ZZ==-1 && SM[i]<SM[NZig]) {
if(i>=Pos+SRZZ && NZZ<4) STF[NZZ]=i; Up[NZig-1]=0; Up[i-1]=Open[i-1];
NZig=i; } if(ZZ==1) { if(i>=Pos+SRZZ && NZZ<4) { NZZ++; STF[NZZ]=i; }
Up[i-1]=Open[i-1]; ZZ=-1; NZig=i; } }
if(i==ArrayMaximum(SM,LBar-RBar+1,RBar)) {
if(ZZ==1 && SM[i]>SM[NZag]) {
if(i>=Pos+SRZZ && NZZ<4) STF[NZZ]=i; Dn[NZag-1]=0; Dn[i-1]=Open[i-1];
NZag=i; } if(ZZ==-1) { if(i>=Pos+SRZZ && NZZ<4) { NZZ++; STF[NZZ]=i; }
Dn[i-1]=Open[i-1]; ZZ=1; NZag=i; } } i++; if(i>LBZZ) return; }
nSBZZ=Bars-STF[4]; return; }
//---------------------------------------------------------------------
void ArrCalc() { int i,j,k,n,z=0; double p, b;
i=LBZZ; while(LZZ[i]==0) i--; j=i; p=LZZ[i]; i--; while(LZZ[i]==0) i--;
if(LZZ[i]>p) z=1; if(LZZ[i]>0 && LZZ[i]<p) z=-1; p=LZZ[j]; i=j-1;
while(i>0) { if(LZZ[i]>p) { z=-1; p=LZZ[i]; }
if(LZZ[i]>0 && LZZ[i]<p) { z=1; p=LZZ[i]; }
if(z>0 && Dn[i]>0) { Lmt[i]=Open[i]; Dn[i]=0; }
if(z<0 && Up[i]>0) { Lmt[i]=Open[i]; Up[i]=0; }
if(z>0 && Up[i]>0) { if(i>1) { j=i-1; k=j-SRZZ+1; if(k<0) k=0;
n=j; while(n>=k && Dn[n]==0) { pUp[n]=Up[i]; pDn[n]=0; n--; } }
if(i==1) pUp[0]=Up[i]; }
if(z<0 && Dn[i]>0) { if(i>1) { j=i-1; k=j-SRZZ+1; if(k<0) k=0;
n=j; while(n>=k && Up[n]==0) { pDn[n]=Dn[i]; pUp[n]=0; n--; } }
if(i==1) pDn[0]=Dn[i]; }
i--; } return; }
//---------------------------------------------------------------------
void deinit() {
return; }
//---------------------------------------------------------------------
int init() { IndicatorBuffers(8);
SetIndexBuffer(0,Lmt);
SetIndexStyle(0,DRAW_ARROW,EMPTY,2); SetIndexArrow(0,251);
SetIndexEmptyValue(0,0.0);
SetIndexBuffer(1,LZZ);
if(DrawZZ) {
SetIndexStyle(1,DRAW_SECTION,EMPTY,2);
SetIndexEmptyValue(1,0.0); }
else SetIndexStyle(1,DRAW_NONE);
SetIndexBuffer(2,SA); SetIndexStyle(2,DRAW_NONE);
SetIndexBuffer(3,SM); SetIndexStyle(3,DRAW_NONE);
SetIndexBuffer(4,Up); SetIndexStyle(4,DRAW_ARROW,EMPTY,1);
SetIndexArrow(4,233); SetIndexEmptyValue(4,0.0);
SetIndexBuffer(5,Dn); SetIndexStyle(5,DRAW_ARROW,EMPTY,1);
SetIndexArrow(5,234); SetIndexEmptyValue(5,0.0);
SetIndexBuffer(6,pUp); SetIndexStyle(6,DRAW_ARROW);
SetIndexArrow(6,217); SetIndexEmptyValue(6,0.0);
SetIndexBuffer(7,pDn); SetIndexStyle(7,DRAW_ARROW);
SetIndexArrow(7,218); SetIndexEmptyValue(7,0.0); return(0); }
//---------------------------------------------------------------------
int start() { int counted_bars=IndicatorCounted(); int limit,i,j,n;
if(counted_bars<0) return(-1); if(counted_bars>0) counted_bars--;
if(First==true) {
if(SR<2) SR=2; if(Bars<=2*(MainRZZ+FP+SR+2)) return(-1);
if(SRZZ<=SR) SRZZ=SR+1; MaxBar=Bars-(MainRZZ+FP+SR+2);
LBZZ=MaxBar; SBZZ=LBZZ; prevBars=Bars; First=false; }
limit=Bars-counted_bars; for(i=limit;i>=0;i--) { MainCalculation(i); }
if(prevBars!=Bars) { SBZZ=Bars-nSBZZ; LBZZ=Bars-nLBZZ; prevBars=Bars; }
SZZCalc(0); LZZCalc(0); ArrCalc(); return(0); }
//---------------------------------------------------------------------
2017-07-14
257
글번호 111310
답변완료
수식 문의드립니다.
1. 매매시 onclose 사용시 if 문을 만족하면 바로 종가에 진입하는것으로 알고 있는데
그 진입봉에서 5틱(아니면 0.5pt) 좋은 가격에 진입하는 식은 없나요?
(onclose,def+0.5)이렇게 사용해도 의미가 없는건가요?
2. 위와 같은 느낌인데 onclose는 바로 진입인데 1포인트 정도까지 좋은 가격을 기다리다가 그 해당봉이 아닌 이후봉에 진입하도록 하는 수식 작성 부탁드립니다.
2017-07-14
102
글번호 111306
답변완료
문의드립니다
if bdate != bdate[1] Then{
var1 = 0;
var21 = var2[1];
var31 = var3[1];
}
if abs(C-O) > 0 and H-L > var1 Then{
var1 = H-L;
var2 = H;
var3 = L;
}
if var21 > 0 and var31 > 0 then{
plot1(var21);
plot2(var21-abs(var21-var31)*0.236);
plot3(var21-abs(var21-var31)*0.382);
plot4(var21-abs(var21-var31)*0.500);
plot5(var21-abs(var21-var31)*0.618);
plot6(var21-abs(var21-var31)*0.764);
plot7(var31);
}
당일제일큰봉에다 위수식이 나오게하고십습니다 현재제일큰봉에 적용하고 있다면 그봉보다 더큰봉이 나온다면 더크큰봉으로 이동하여 나오게 부탁드립니다~~미리감사드립니다
2017-07-14
105
글번호 111302
답변완료
수식문의드립니다.
키움 사용중인데, 예스 변환부탁드려요.
Stochastics 지지저항선
수식1
sc=stochasticsslow(sto1,sto2);
valuewhen(1,crossdown(sc,lp),low)
수식2
sc=Stochasticsslow(sto1,sto2);
valuewhen(1,crossup(sc,lp),high)
지표조건
sto1 3
sto2 1
hp 70
lp 30
----------------------
2. 볼린저밴드 내부를 색칠하려면 어떻게 해야하는지요?
수고하세요
2017-07-14
173
글번호 111301