커뮤니티
예스랭귀지 Q&A
답변완료
[공지] 예스랭귀지 AI 어시스턴트, '예스나 AI' 출시 및 무료 체험 안내
안녕하세요, 예스스탁 입니다.복잡한 수식 공부 없이 여러분의 아이디어를 말하면 시스템 트레이딩 언어 예스랭귀지로 작성해주는 서비스예스나 AI(YesNa AI)가 출시되었습니다.지금 예스나 AI를 직접 경험해 보실 수 있도록 20크레딧(질문권 20회)를 무료로 증정해 드리고 있습니다.바로 여러분의 아이디어를 코드로 변환해보세요.--------------------------------------------------🚀 YesNa AI 핵심 기능- 지표식/전략식/종목검색식 생성: 자연어로 요청하면 예스랭귀지 문법에 맞는 코드를 작성합니다.- 종목검색식 변환 지원: K증권의 종목 검색식을 예스랭귀지로 변환 지원합니다.- 컴파일 검증: 작성된 코드가 실행 가능한지 컴파일러를 통해 문법 검증을 거쳐 결과물을 제공합니다.상세한 서비스 개요 및 활용 방법은 [서비스 소개 페이지]에서 확인하실 수 있습니다.▶ 서비스 소개 페이지: 바로가기서비스 사용 유의사항 및 결제 환불정책은 [이용약관]을 참고 부탁드립니다.▶ 서비스 이용약관: 바로가기💬 이용 문의사용 중 문의사항은 [프로그램 사용법 Q&A] 게시판에서 [예스나 AI] 카테고리를 설정 후 문의해 주시면 상세히 안내해 드리겠습니다.--------------------------------------------------앞으로도 AI를 활용한 다양한 트레이딩 기능들을 지속적으로 선보일 예정입니다.많은 관심과 기대 부탁드립니다.
2026-02-27
7585
글번호 230811
답변완료
부탁합니다.
아래는 수식지왕님께서 블로그에 올리신 꺾은선차트입니다.
시스템으로 적용하고 싶습니다. 도와주십시오.
#==========================================#
# 지표명 : 꺾은선차트
# 작성자 : 수식지왕
# 블로그 : http://yahoosir.blog.me
#==========================================#
Input:상승전환가격(5),하락전환가격(5);
Var:j(0),꺾은선(0),방향(0),상승(100),하락(-100),
기준고(0),기준저(0),기준고Bar(0),기준저Bar(0);
Array:고[20](0),저[20](0),고Bar[20](0),저Bar[20](0);
#==========================================#
# 전고점,전저점 index 증가
#==========================================#
For j = 1 To 19
{
고Bar[j] = 고Bar[j] + 1;
저Bar[j] = 저Bar[j] + 1;
}
#==========================================#
# 최근 고,저 갱신
#==========================================#
If 기준고 <= C || 기준고 == 0 || IsNaN(기준고) == True Then
{
기준고 = C;
기준고Bar = 0;
}
Else
기준고Bar = 기준고Bar + 1;
If 기준저 >= C || 기준저 == 0 || IsNaN(기준저) == True Then
{
기준저 = C;
기준저Bar = 0;
}
Else
기준저Bar = 기준저Bar + 1;
#==========================================#
# 추세방향 결정
#==========================================#
If 기준저[1] + 상승전환가격 > C[1] && 기준저[1] + 상승전환가격 <= C Then 방향 = 상승;
If 기준고[1] - 하락전환가격 < C[1] && 기준고[1] - 하락전환가격 >= C Then 방향 = 하락;
#==========================================#
# 추세변화에 따른 변곡점 처리
#==========================================#
If 방향[1] == 하락 && 방향 == 상승 Then
{
For j = 18 DownTo 1
{
저[j+1] = 저[j];
저Bar[j+1] = 저Bar[j];
}
저[1] = 기준저;
저Bar[1] = 기준저Bar;
꺾은선 = 기준저;
기준저 = C;
기준저Bar = 0;
기준고 = C;
기준고Bar = 0;
}
Else If 방향[1] == 상승 && 방향 == 하락 Then
{
For j = 18 DownTo 1
{
고[j+1] = 고[j];
고Bar[j+1] = 고Bar[j];
}
고[1] = 기준고;
고Bar[1] = 기준고Bar;
꺾은선 = 기준고;
기준고 = C;
기준고Bar = 0;
기준저 = C;
기준저Bar = 0;
}
Else If 방향[1] == 하락 && 방향 == 하락 Then
{
If 기준고[1] - 하락전환가격 <= C[1] &&
기준고[1] - 하락전환가격 > C &&
고[1] < 기준고 Then
{
고[1] = 기준고;
고Bar[1] = 기준고Bar;
꺾은선 = 기준고;
기준고 = C;
기준고Bar = 0;
}
}
Else If 방향[1] == 상승 && 방향 == 상승 Then
{
If 기준저[1] + 상승전환가격 >= C[1] &&
기준저[1] + 상승전환가격 < C &&
저[1] > 기준저 Then
{
저[1] = 기준저;
저Bar[1] = 기준저Bar;
꺾은선 = 기준저;
기준저 = C;
기준저Bar = 0;
}
}
#==========================================#
# 지표식 출력
#==========================================#
If 꺾은선[1] != 꺾은선 Then Plot1(꺾은선);
Else If LastBarOnChart == 1 Then plot1(Iff(방향 == 상승,기준고,기준저));
+++++++++++++++++++++++
참, 한가지만 더요.
당일시가(유로fx니까 오전8시로 하죠) 보다 몇틱 오르면 매수, 몇틱 내리면 매도진입.
그리고 익일 오전 6시55분에 당일청산. 부탁합니다.
2013-02-25
316
글번호 59879
답변완료
주문취소물량 확인
10 호가 창을 보면 물량 변화가 심하게 일어나는데요
각 호가 마다
얼마만의 물량이 신규로 들어오고 취소되었는지
알아 보는 함수는 없나요?
2013-02-24
265
글번호 59878
답변완료
타주기 참조관련 문의
연결선물을 data2로 참조해서 kodex레버리지를 주종목으로 매매하는 로직을 만들었습니다. 둘다 30분차트 기준입니다. 나머지는 전부 구현이 되었는데 손절 로직이 문제입니다. 연결선물에서 일정p 이상 손실이 발생하면 kodex레버리지를 청산하는 로직을 구현하고 싶어서 setstoploss 함수를 data2안에 넣고 만들어보기도 하고 별짓을 다해봤는데 손절로직에서 참조를 안하는 것 같습니다. 다시 말해 참조 데이터인 연결선물에서 손절신호발생시 주종목에 즉시 매도 주문이 나가게 하고 싶습니다. 가능할런지요? 수고많으십니다~
2013-02-24
279
글번호 59877
답변완료
수식부탁
지수(코스피,코스닥,업종)등
지수 등락률은 어떻게 계산하나요?
2013-02-24
279
글번호 59876
노단 님에 의해서 삭제되었습니다.
2013-04-17
53
글번호 59875
답변완료
문의
당일베이시스 고점저점을 선으로 나타나게 하고 싶습니다
2013-02-24
241
글번호 59874
aaace 님에 의해서 삭제되었습니다.
2013-02-23
188
글번호 59873
답변완료
문의 합니다.
1. 오늘 종가가 전일대비 +10%~ +15% 사이에 상승한 종목검색식
2. 오늘 종가가 전일대비 +1%~ +5% 사이에있으며 양봉인 종목검색식
이두가지 검색식 문의드립니다.
2013-02-22
215
글번호 59872
답변완료
문의
solar wind 란 지표인데
예스에서 지원안하는것 같더라구요
#property copyright "Copyright ?2005, Yura Prokofiev"
#property link "Yura.prokofiev@gmail.com"
#property indicator_separate_window
#property indicator_buffers 3
#property indicator_color1 Black
#property indicator_color2 Blue
#property indicator_color3 Red
extern int period=10;
extern bool DoAlert = true;
double ExtBuffer0[];
double ExtBuffer1[];
double ExtBuffer2[];
int init()
{
SetIndexStyle(0,DRAW_NONE);
SetIndexStyle(1,DRAW_HISTOGRAM);
SetIndexStyle(2,DRAW_HISTOGRAM);
IndicatorDigits(Digits+1);
SetIndexBuffer(0,ExtBuffer0);
SetIndexBuffer(1,ExtBuffer1);
SetIndexBuffer(2,ExtBuffer2);
IndicatorShortName("SOLAR WIND");
SetIndexLabel(1,NULL);
SetIndexLabel(2,NULL);
return(0);
}
int start()
{
//int period=10;
int limit;
int counted_bars=IndicatorCounted();
double prev,current,old;
double Value=0,Value1=0,Value2=0,Fish=0,Fish1=0,Fish2=0;
double price;
double MinL=0;
double MaxH=0;
if(counted_bars>0) counted_bars--;
limit=Bars-counted_bars;
for(int i=0; i<limit; i++)
{ MaxH = High[Highest(NULL,0,MODE_HIGH,period,i)];
MinL = Low[Lowest(NULL,0,MODE_LOW,period,i)];
price = (High[i]+Low[i])/2;
Value = 0.33*2*((price-MinL)/(MaxH-MinL)-0.5) + 0.67*Value1;
Value=MathMin(MathMax(Value,-0.999),0.999);
ExtBuffer0[i]=0.5*MathLog((1+Value)/(1-Value))+0.5*Fish1;
Value1=Value;
Fish1=ExtBuffer0[i];
}
bool up=true;
static datetime cDT = 0;
if (cDT == 0) { cDT = iTime(NULL,0,0); } // Don't alert when start
for(i=limit-2; i>=0; i--)
{
current=ExtBuffer0[i];
prev=ExtBuffer0[i+1];
if (((current<0)&&(prev>0))||(current<0)) up= false;
if (((current>0)&&(prev<0))||(current>0)) up= true;
if(!up)
{
ExtBuffer2[i]=current;
ExtBuffer1[i]=0.0;
if (DoAlert && (cDT != iTime(NULL,0,0)) && (ExtBuffer2[i+1]==0))
{
cDT = iTime(NULL,0,0);
Print("** Solar wind crossed down");
PlaySound("Alert1.wav");
}
}
else
{
ExtBuffer1[i]=current;
ExtBuffer2[i]=0.0;
if (DoAlert && (cDT != iTime(NULL,0,0)) && (ExtBuffer1[i+1]==0))
{
cDT = iTime(NULL,0,0);
Print("** Solar wind crossed up");
PlaySound("Alert1.wav");
}
}
}
return(0);
}
위소스인데 예스에 적용하려면 어찌하는지요??
=====
//+------------------------------------------------------------------+
//| TrendEnvelopes_v1.mq4 |
//| Copyright ?2006, TrendLaboratory Ltd. |
//| http://finance.groups.yahoo.com/group/TrendLaboratory |
//| E-mail: igorad2003@yahoo.co.uk |
//+------------------------------------------------------------------+
#property copyright "Copyright ?2006, TrendLaboratory Ltd."
#property link "http://finance.groups.yahoo.com/group/TrendLaboratory"
//---- indicator settings
#property indicator_chart_window
#property indicator_buffers 4
#property indicator_color1 LightBlue
#property indicator_color2 Orange
#property indicator_width1 2
#property indicator_width2 2
#property indicator_color3 LightBlue
#property indicator_color4 Orange
#property indicator_width3 2
#property indicator_width4 2
//---- indicator parameters
extern int MA_Period =14;
extern int MA_Shift =0;
extern int MA_Method =3;
extern int Applied_Price=0;
extern double Deviation =0.2;
extern int UseSignal =0;
//---- indicator buffers
double UpBuffer[];
double DnBuffer[];
double UpSignal[];
double DnSignal[];
double smax[];
double smin[];
double trend[];
//----
int ExtCountedBars=0;
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int init()
{
int draw_begin;
string short_name;
//---- drawing settings
IndicatorBuffers(7);
SetIndexStyle(0,DRAW_LINE);
SetIndexShift(0,MA_Shift);
SetIndexStyle(1,DRAW_LINE);
SetIndexShift(1,MA_Shift);
//
SetIndexStyle(2,DRAW_ARROW);
SetIndexShift(2,MA_Shift);
SetIndexArrow(2,233);
SetIndexStyle(3,DRAW_ARROW);
SetIndexShift(3,MA_Shift);
SetIndexArrow(3,234);
//
IndicatorDigits(MarketInfo(Symbol(),MODE_DIGITS));
if(MA_Period<2) MA_Period=14;
draw_begin=MA_Period-1;
//---- indicator short name
IndicatorShortName("Env("+MA_Period+")");
SetIndexLabel(0,"UpTrendEnv");
SetIndexLabel(1,"DnTrendEnv");
SetIndexLabel(2,"UpSignal");
SetIndexLabel(3,"DnSignal");
SetIndexDrawBegin(0,draw_begin);
SetIndexDrawBegin(1,draw_begin);
SetIndexDrawBegin(2,draw_begin);
SetIndexDrawBegin(3,draw_begin);
//---- indicator buffers mapping
SetIndexBuffer(0,UpBuffer);
SetIndexBuffer(1,DnBuffer);
SetIndexBuffer(2,UpSignal);
SetIndexBuffer(3,DnSignal);
SetIndexBuffer(4,smax);
SetIndexBuffer(5,smin);
SetIndexBuffer(6,trend);
if(Deviation<0.1) Deviation=0.1;
if(Deviation>100.0) Deviation=100.0;
//---- initialization done
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator iteration function |
//+------------------------------------------------------------------+
int start()
{
int limit;
if(Bars<=MA_Period) return(0);
ExtCountedBars=IndicatorCounted();
//---- check for possible errors
if (ExtCountedBars<0) return(-1);
//---- last counted bar will be recounted
if (ExtCountedBars>0) ExtCountedBars--;
limit=Bars-ExtCountedBars;
//---- EnvelopesM counted in the buffers
for(int i=limit; i>=0; i--)
{
smax[i]=(1+Deviation/100)*iMA(NULL,0,MA_Period,0,MA_Method,Applied_Price,i);
smin[i]=(1-Deviation/100)*iMA(NULL,0,MA_Period,0,MA_Method,Applied_Price,i);
trend[i]=trend[i+1];
if (Close[i]>smax[i+1]) trend[i]=1;
if (Close[i]<smin[i+1]) trend[i]=-1;
if(trend[i]>0)
{
if (smin[i]<smin[i+1]) smin[i]=smin[i+1];
UpBuffer[i]=smin[i];
if (UseSignal>0)
if (trend[i+1]<0) UpSignal[i]=Low[i]-0.5*iATR(NULL,0,MA_Period,i);
DnBuffer[i]=EMPTY_VALUE;
}
else
{
if(smax[i]>smax[i+1]) smax[i]=smax[i+1];
DnBuffer[i]=smax[i];
if (UseSignal>0)
if (trend[i+1]>0) DnSignal[i]=High[i]+0.5*iATR(NULL,0,MA_Period,i);
UpBuffer[i]=EMPTY_VALUE;
}
}
//---- done
return(0);
}
//+------------------------------------------------------------------+
위소스 총 2개 변환부탁드립니다
2013-02-22
1020
글번호 59871