커뮤니티
예스랭귀지 Q&A
답변완료
[공지] 예스랭귀지 AI 어시스턴트, '예스나 AI' 출시 및 무료 체험 안내
안녕하세요, 예스스탁 입니다.복잡한 수식 공부 없이 여러분의 아이디어를 말하면 시스템 트레이딩 언어 예스랭귀지로 작성해주는 서비스예스나 AI(YesNa AI)가 출시되었습니다.지금 예스나 AI를 직접 경험해 보실 수 있도록 20크레딧(질문권 20회)를 무료로 증정해 드리고 있습니다.바로 여러분의 아이디어를 코드로 변환해보세요.--------------------------------------------------🚀 YesNa AI 핵심 기능- 지표식/전략식/종목검색식 생성: 자연어로 요청하면 예스랭귀지 문법에 맞는 코드를 작성합니다.- 종목검색식 변환 지원: K증권의 종목 검색식을 예스랭귀지로 변환 지원합니다.- 컴파일 검증: 작성된 코드가 실행 가능한지 컴파일러를 통해 문법 검증을 거쳐 결과물을 제공합니다.상세한 서비스 개요 및 활용 방법은 [서비스 소개 페이지]에서 확인하실 수 있습니다.▶ 서비스 소개 페이지: 바로가기서비스 사용 유의사항 및 결제 환불정책은 [이용약관]을 참고 부탁드립니다.▶ 서비스 이용약관: 바로가기💬 이용 문의사용 중 문의사항은 [프로그램 사용법 Q&A] 게시판에서 [예스나 AI] 카테고리를 설정 후 문의해 주시면 상세히 안내해 드리겠습니다.--------------------------------------------------앞으로도 AI를 활용한 다양한 트레이딩 기능들을 지속적으로 선보일 예정입니다.많은 관심과 기대 부탁드립니다.
2026-02-27
1689
글번호 230811
답변완료
지표 수식
첨부된 그리과 같이 MDD (MAX DRAW DOWN)를 나타내는 지표 수식을 부탁드립니다.
기간이 필요하다면 변수로 적용해 주시고요.
만약 첨부와 같이 되지 않는다면 작성할 수 있는 다른 방법으로 부탁드립니다.
먼저 감사드립니다.
수고하세요
2021-10-24
846
글번호 153107
답변완료
수식 부탁합니다
안녕하세요?
오랫만에 수식 작성하려니 다잊어버려서 도움을 받으려 합니다.
죄송합니다.
주가이동평균선60주기와 일목균형표의 선행스펜의 가격차이가 2%이내이고
전일 종가 기준 주가가 60이평선과 선행스펜 구름대 가격 위에 있고 스토캐스틱(5,3,3)
의 20이하에 있는 종목검색식을 만들려고 합니다.
감사합니다.
2021-10-24
683
글번호 153106
답변완료
수식부탁드립니다
안녕하세요
일봉20이평과 5이평 모두 위에서 매수 아래에서 매도하는 수식 부탁드립니다
감사합니다
2021-10-24
755
글번호 153105
답변완료
시스템 작성 의뢰
수고 하십니다 !
Input : Period1(1), Period2(15), Period3(30), Period4(60), Period5(120),period6(240),Period7(480), Period8(960), Period9(1920), Period10(3840),period11(7680);
이동평균선 8선 이 이동평균선 10선 을 크로스다운 하고 난 다음에 이동평균선 3선이
이동평균선 4선 을 크로스업 할때는 매수 를 ,
이동평균선 8선 이 이동평균선 10선 을 크로스업 하고 난 다음에 이동평균선 3선이
이동평균선 4선 을 크로스다운 할때는 매도 를 할수있는 수식을 부탁 드립니다.
*** 수고 하세요 ***
2021-10-24
682
글번호 153104
답변완료
문의 드립니다.
20이평과 120이평 정배열이면서
MACD 12 26 9가 0선 아래 지점에서 골든 크로스 때 매수 진입
손절 50틱 익절100틱
(MACD 0선 위에서 발생하는 골든 크로스는 매수하지 않음)
20이평과 120이평 역배열이면서
MACD 12 26 9가 0선 위 지점에서 데드 크로스 때 매도 진입
손절 50틱 익절100틱
(MACD 0선 아래에서 발생하는 데드 크로스는 매도하지 않음)
부탁드립니다.
2021-10-23
800
글번호 153103
답변완료
부탁 드립니다.
도움에 감사 드립니다.
타주기 수식 부탁 드립니다.
1)분봉차트 지표를 분봉에서
2)일봉차트 지표를 분봉에서
3)주봉차트 지표를 분봉에서
input:p(10),sig(5);
var1=c-c[p];
var2=ma(var1,sig);
참고 지표)
input : 타주기분(30),Length(10),sig(5);
var : S1(0),D1(0),TM(0),TF(0);
var : cnt(0),SumSqr(0);
var : sum(0),XMean(0),XVariance(0),BBdn(0);
Array : CC[100](0),EStd[100](0);
if Bdate != Bdate[1] Then
{
S1 = TimeToMinutes(stime);
D1 = sdate;
}
if D1 > 0 then
{
if sdate == D1 Then
TM = TimeToMinutes(stime)-S1;
Else
TM = TimeToMinutes(stime)+1440-S1;
TF = TM%타주기분;
if Bdate != Bdate[1] or
(Bdate == Bdate[1] and 타주기분 > 1 and TF < TF[1]) or
(Bdate == Bdate[1] and 타주기분 > 1 and TM >= TM[1]+타주기분) or
(Bdate == Bdate[1] and 타주기분 == 1 and TM > TM[1]) Then
{
for cnt = 1 to 99
2021-10-23
828
글번호 153102
답변완료
문의드립니다
항상 감사드립니다~~
6분봉과 30분봉, 매수 매도 신호가 나오도록 해주세요.
1. 10번째 이전 캔들의 고가를 돌파할때 매수 신호, 저가를 깰때 매도 신호가 나오도록 해주세요. 종가가 아닌 돌파나 깰때 바로 나오도록 해주세요.
2. 현재 캔들에서 10번째 이전 캔들의 고가를 돌파하거나 저가를 깨는 일이 같이 일어날 때는 일어나는 그 시각에 해당되는 매수, 매도 신호가 나오도록 해주세요.
3. 10번째 이전 캔들의 고가 위에서 현재 캔들이 앞 캔들의 고가를 높이는 경우, 매수 신호가 나오도록 해주세요.
4. 10번째 이전 캔들의 저가 아래에서 현재 캔들이 앞 캔들의 저가를 깨는 경우 매도 신호가 나오도록 해주세요.
5. 6분봉과 30분봉이 같은 방향으로 신호가 있을 때만 그 방향으로 매수, 매도 진입하도록 해주세요.
4. 같은 방향의 신호가 있을 시 6분봉의 종가에 매수, 매도 진입합니다.
5. 같은 방향으로 진입신호가 나왔어도 아래의 경우 진입하지 않게 해주세요.
- 앞캔들의 고가를 높이거나 저가를 깨거나 하지 않고 끝난 캔들.
- 매수는 양봉 종가에만, 매도는 음봉 종가에만 진입하도록 해주세요.
6.진입한 후 익절, 손절 청산 후에 6분과 30분봉에 같은 방향 신호가 있으면 같은 조건으로 계속 거래되도록 해주세요.
아래 수식에서 수정 부탁드립니다
감사합니다~~^^
input : ntime1(6),ntime2(30),n(10);
input : StartTime(222500),EndTime(010000);
input : 익절틱수(50),손절틱수(50);
var : S1(0),D1(0),TM(0),TF1(0),TF2(0),cnt(0);
Array : H1[50](0),L1[50](0),H2[50](0),L2[50](0);
var : Tcond(false);
if (sdate != sdate[1] and stime >= EndTime) or
(sdate == sdate[1] and stime >= EndTime and stime[1] < EndTime) Then
Tcond = False;
if (sdate != sdate[1] and stime >= StartTime) or
(sdate == sdate[1] and stime >= StartTime and stime[1] < StartTime) Then
Tcond = true;
if Bdate != Bdate[1] Then
{
S1 = TimeToMinutes(stime);
D1 = sdate;
}
if D1 > 0 then
{
if sdate == D1 Then
TM = TimeToMinutes(stime)-S1;
Else
TM = TimeToMinutes(stime)+1440-S1;
TF1 = TM%ntime1;
TF2 = TM%ntime2;
if Bdate != Bdate[1] or
(Bdate == Bdate[1] and ntime1 > 1 and TF1 < TF1[1]) or
(Bdate == Bdate[1] and ntime1 > 1 and TM >= TM[1]+ntime1) or
(Bdate == Bdate[1] and ntime1 == 1 and TM > TM[1]) Then
{
H1[0] = H;
L1[0] = L;
For cnt = 1 to 49
{
H1[cnt] = H1[cnt-1][1];
L1[cnt] = L1[cnt-1][1];
}
}
if H1[0] > 0 and H > H1[0] Then
H1[0] = H;
if L1[0] > 0 and L < L1[0] Then
L1[0] = L;
if Bdate != Bdate[1] or
(Bdate == Bdate[1] and ntime2 > 1 and TF2 < TF2[1]) or
(Bdate == Bdate[1] and ntime2 > 1 and TM >= TM[1]+ntime2) or
(Bdate == Bdate[1] and ntime2 == 1 and TM > TM[1]) Then
{
H2[0] = H;
L2[0] = L;
For cnt = 1 to 49
{
H2[cnt] = H2[cnt-1][1];
L2[cnt] = L2[cnt-1][1];
}
}
if H2[0] > 0 and H > H2[0] Then
H2[0] = H;
if L2[0] > 0 and L < L2[0] Then
L2[0] = L;
if Tcond == true Then
{
if H1[n] > 0 and H2[n] > 0 and C > H1[n] and C > H2[n] and C > O Then
Buy();
if L1[n] > 0 and L2[n] > 0 and C < L1[n] and C < L2[n] and C < O Then
Sell();
if MarketPosition == 1 Then
ExitLong("bx",AtStop,L-PriceScale*1);
if MarketPosition == -1 Then
ExitShort("sx",AtStop,H+PriceScale*1);
}
}
SetStopProfittarget(PriceScale*익절틱수,PointStop);
SetStopLoss(PriceScale*손절틱수,PointStop);
IF Endtime > starttime Then
SetStopEndofday(Endtime);
Else
{
if sDate != sDate[1] Then
SetStopEndofday(Endtime);
}
if (sdate != sdate[1] and stime >= StartTime) or
(sdate == sdate[1] and stime >= StartTime and stime[1] < StartTime) Then
{
IF Endtime <= starttime Then
{
SetStopEndofday(0);
}
}
2021-10-23
940
글번호 153101
예스요 님에 의해서 삭제되었습니다.
2021-10-24
18
글번호 153100
답변완료
수식 수정 의뢰드립니다!
안녕하세요!
아래 수식에 오타가 있는지 검증에서 에러가 발생을 합니다!
확인 좀 부탁드릴께요!
감사합니다!
Input:length(10);
Var:lastHi(0),lastLo(0),lastVertex(""),procBit(""),
sBar(0),TL1(0),TL2(0),TL3(0),
hiTLSlope(0),hiTLBeginBar(0),hiTLBeginVal(0),hiTLEndVal(0),
loTLSlope(0),loTLBeginBar(0),loTLBeginVal(0),loTLEndVal(0);
//ssssssssssssssssssssssssssssssssss
Var:hiTLBeginBN(0),loTLBeginBN(0);
//eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee
Var:PK1(0),PK2(0),PK3(0),PK4(0),PK5(0),PK6(0),PK7(0),PK8(0),PK9(0),PK10(0),
VL1(0),VL2(0),VL3(0),VL4(0),VL5(0),VL6(0),VL7(0),VL8(0),VL9(0),VL10(0),
pkBN1(0),pkBN2(0),pkBN3(0),pkBN4(0),pkBN5(0),
pkBN6(0),pkBN7(0),pkBN8(0),pkBN9(0),pkBN10(0),
vlBN1(0),vlBN2(0),vlBN3(0),vlBN4(0),vlBN5(0),
vlBN6(0),vlBN7(0),vlBN8(0),vlBN9(0),vlBN10(0);
//==========================================
Condition1 = Highest(H,length) = H and lastHi <> H;
Condition2 = Lowest (L,length) = L and lastLo <> L;
procBit = "";
If Condition1 and Condition2 Then Begin
If lastVertex = "Valley" Then Begin
If VL1 > L Then procBit = "Valley"
Else procBit = "Peak";
End
Else If lastVertex = "Peak" Then Begin
If PK1 < H Then procBit = "Peak"
Else procBit = "Valley";
End;
End
Else If Condition1 Then procBit = "Peak"
Else If Condition2 Then procBit = "Valley";
//==========================================
If procBit = "Peak" Then Begin
lastHi = H;
If lastVertex = "Valley" Then Begin
PK9 = PK8; pkBN9 = pkBN8;
PK8 = PK7; pkBN8 = pkBN7;
PK7 = PK6; pkBN7 = pkBN6;
PK6 = PK5; pkBN6 = pkBN5;
PK5 = PK4; pkBN5 = pkBN4;
PK4 = PK3; pkBN4 = pkBN3;
PK3 = PK2; pkBN3 = pkBN2;
PK2 = PK1; pkBN2 = pkBN1;
PK1 = H; pkBN1 = BarNumber;
sBar = BarNumber - vlBN1;
TL1 = TL_New(Date[sBar],Time[sBar],VL1,Date,Time,PK1);
TL_SetSize(TL1,2);
TL_SetColor(TL1,GREEN);
End
Else If PK1 < H Then Begin
PK1 = H; pkBN1 = BarNumber;
TL_SetEnd(TL1,Date,Time,PK1);
End ;
{ High Trend Line }
//ssssssssssssssssssssssssssssssssss
// 이전 단계에서는 1번 고점만 변경되어도 아래 루틴을 탔는데
// 2번 고점이 변경되지 않았으면 불필요한 계산이므로
// 2번 고점이 바뀌었을 때만 아래 루틴을 수행하도록 조건을 추가
// price는 동일 값이 나올 수 있어 비교할 수 없으나 BarNumber는 유일한 값이므로 비교 가능하다
If pkBN2[1] <> pkBN2 Then Begin
//eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee
hiTLEndVal = 0; hiTLSlope = 0; hiTLBeginVal = 0; hiTLBeginBar = 0;
If PK2 < PK3 Then Begin
hiTLSlope = (PK2 - PK3)/(pkBN2 - pkBN3);
hiTLBeginVal = PK3;
//ssssssssssssssssssssssssssssssssss
// 2번 고점이 바뀌지 않았다면 y 절편과 기울기는 그대로이고 거리에 해당하는 hiTLBeginBar 값에 변동이 있다.
// 2번 고점이 변경되지 않았을 때의 hiTLBeginBar를 계산하려면 시작점의 BarNumber를 알면 되므로
// 새로 추가한 hiTLBeginBN 변수에 고점의 BarNumber를 넘겨준다.
hiTLBeginBN = pkBN3;
//eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee
End
Else If PK2 < PK4 Then Begin
hiTLSlope = (PK2 - PK4)/(pkBN2 - pkBN4);
hiTLBeginVal = PK4;
//ssssssssssssssssssssssssssssssssss
hiTLBeginBN = pkBN4;
//eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee
End
Else If PK2 < PK5 Then Begin
hiTLSlope = (PK2 - PK5)/(pkBN2 - pkBN5);
hiTLBeginVal = PK5;
//ssssssssssssssssssssssssssssssssss
hiTLBeginBN = pkBN5;
//eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee
End
Else If PK2 < PK6 Then Begin
hiTLSlope = (PK2 - PK6)/(pkBN2 - pkBN6);
hiTLBeginVal = PK6;
//ssssssssssssssssssssssssssssssssss
hiTLBeginBN = pkBN6;
//eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee
End
Else If PK2 < PK7 Then Begin
hiTLSlope = (PK2 - PK7)/(pkBN2 - pkBN7);
hiTLBeginVal = PK7;
//ssssssssssssssssssssssssssssssssss
hiTLBeginBN = pkBN7;
//eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee
End
Else If PK2 < PK8 Then Begin
hiTLSlope = (PK2 - PK8)/(pkBN2 - pkBN8);
hiTLBeginVal = PK8;
//ssssssssssssssssssssssssssssssssss
hiTLBeginBN = pkBN8;
//eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee
End
Else If PK2 < PK9 Then Begin
hiTLSlope = (PK2 - PK9)/(pkBN2 - pkBN9);
hiTLBeginVal = PK9;
//ssssssssssssssssssssssssssssssssss
hiTLBeginBN = pkBN9;
End ;
hiTLBeginBar = BarNumber - hiTLBeginBN;
//eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee
hiTLEndVal = hiTLSlope * hiTLBeginBar + hiTLBeginVal;
If hiTLEndVal > 0 Then Begin
TL2 = TL_New(Date[hiTLBeginBar],Time[hiTLBeginBar],hiTLBeginVal,Date,Time,hiTLEndVal);
TL_SetSize(TL2,1);
TL_SetColor(TL2,RED);
End ;
End
//ssssssssssssssssssssssssssssssssss
// 2번 고점이 변경되지 않았으나 고추세선의 값이 살아있다면(0으로 초기화되지 않았다면)
Else If hiTLEndVal[1] > 0 Then Begin
// 거리 = 현재 봉의 BarNumber - 시작점의 BarNumber
hiTLEndVal = hiTLSlope * (BarNumber - hiTLBeginBN) + hiTLBeginVal;
TL_SetEnd(TL2,Date,Time,hiTLEndVal);
End ;
//eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee
lastVertex = "Peak";
End ;
//==========================================
If procBit = "Valley" Then Begin
lastLo = L;
If lastVertex = "Peak" then Begin
VL9 = VL8; vlBN9 = vlBN8;
VL8 = VL7; vlBN8 = vlBN7;
VL7 = VL6; vlBN7 = vlBN6;
VL6 = VL5; vlBN6 = vlBN5;
VL5 = VL4; vlBN5 = vlBN4;
VL4 = VL3; vlBN4 = vlBN3;
VL3 = VL2; vlBN3 = vlBN2;
VL2 = VL1; vlBN2 = vlBN1;
VL1 = L; vlBN1 = BarNumber;
sBar = BarNumber - pkBN1;
TL1 = TL_New(Date[sBar],Time[sBar],PK1,Date,Time,VL1);
TL_SetSize(TL1,2);
TL_SetColor(TL1,GREEN);
End
Else If VL1 > L then Begin
VL1 = L; vlBN1 = BarNumber;
TL_SetEnd(TL1,Date,Time,VL1);
End ;
{ Low Trend Line }
//ssssssssssssssssssssssssssssssssss
If vlBN2[1] <> vlBN2 Then Begin
//eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee
loTLEndVal = 0; loTLSlope = 0; loTLBeginVal = 0; loTLBeginBar = 0;
If VL2 > VL3 and VL3 > 0 Then Begin
loTLSlope = (VL2 - VL3)/(vlBN2 - vlBN3);
loTLBeginVal = VL3;
//ssssssssssssssssssssssssssssssssss
loTLBeginBN = vlBN3;
//eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee
End
Else If VL2 > VL4 and VL4 > 0 Then Begin
loTLSlope = (VL2 - VL4)/(vlBN2 - vlBN4);
loTLBeginVal = VL4;
//ssssssssssssssssssssssssssssssssss
loTLBeginBN = vlBN4;
//eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee
End
Else If VL2 > VL5 and VL5 > 0 Then Begin
loTLSlope = (VL2 - VL5)/(vlBN2 - vlBN5);
loTLBeginVal = VL5;
//ssssssssssssssssssssssssssssssssss
loTLBeginBN = vlBN5;
//eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee
End
Else If VL2 > VL6 and VL6 > 0 Then Begin
loTLSlope = (VL2 - VL6)/(vlBN2 - vlBN6);
loTLBeginVal = VL6;
//ssssssssssssssssssssssssssssssssss
loTLBeginBN = vlBN6;
//eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee
End
Else If VL2 > VL7 and VL7 > 0 Then Begin
loTLSlope = (VL2 - VL7)/(vlBN2 - vlBN7);
loTLBeginVal = VL7;
//ssssssssssssssssssssssssssssssssss
loTLBeginBN = vlBN7;
//eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee
End
Else If VL2 > VL8 and VL8 > 0 Then Begin
loTLSlope = (VL2 - VL8)/(vlBN2 - vlBN8);
loTLBeginVal = VL8;
//ssssssssssssssssssssssssssssssssss
loTLBeginBN = vlBN8;
//eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee
End
Else If VL2 > VL9 and VL9 > 0 Then Begin
loTLSlope = (VL2 - VL9)/(vlBN2 - vlBN9);
loTLBeginVal = VL9;
//ssssssssssssssssssssssssssssssssss
loTLBeginBN = vlBN9;
End ;
loTLBeginBar = BarNumber - loTLBeginBN;
//eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee
loTLEndVal = loTLSlope * loTLBeginBar + loTLBeginVal;
If loTLEndVal > 0 Then Begin
TL3 = TL_New(Date[loTLBeginBar],Time[loTLBeginBar],loTLBeginVal,Date,Time,loTLEndVal);
TL_SetSize(TL3,1);
TL_SetColor(TL3,BLUE);
End ;
End
//ssssssssssssssssssssssssssssssssss
Else If loTLEndVal[1] > 0 Then Begin
loTLEndVal = loTLSlope * (BarNumber - loTLBeginBN) + loTLBeginVal;
TL_SetEnd(TL3,Date,Time,loTLEndVal);
End ;
//eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee
lastVertex = "Valley";
End ;
2021-10-23
570
글번호 153099