커뮤니티
예스랭귀지 Q&A
답변완료
[공지] 예스랭귀지 AI 어시스턴트, '예스나 AI' 출시 및 무료 체험 안내
안녕하세요, 예스스탁 입니다.복잡한 수식 공부 없이 여러분의 아이디어를 말하면 시스템 트레이딩 언어 예스랭귀지로 작성해주는 서비스예스나 AI(YesNa AI)가 출시되었습니다.지금 예스나 AI를 직접 경험해 보실 수 있도록 20크레딧(질문권 20회)를 무료로 증정해 드리고 있습니다.바로 여러분의 아이디어를 코드로 변환해보세요.--------------------------------------------------🚀 YesNa AI 핵심 기능- 지표식/전략식/종목검색식 생성: 자연어로 요청하면 예스랭귀지 문법에 맞는 코드를 작성합니다.- 종목검색식 변환 지원: K증권의 종목 검색식을 예스랭귀지로 변환 지원합니다.- 컴파일 검증: 작성된 코드가 실행 가능한지 컴파일러를 통해 문법 검증을 거쳐 결과물을 제공합니다.상세한 서비스 개요 및 활용 방법은 [서비스 소개 페이지]에서 확인하실 수 있습니다.▶ 서비스 소개 페이지: 바로가기서비스 사용 유의사항 및 결제 환불정책은 [이용약관]을 참고 부탁드립니다.▶ 서비스 이용약관: 바로가기💬 이용 문의사용 중 문의사항은 [프로그램 사용법 Q&A] 게시판에서 [예스나 AI] 카테고리를 설정 후 문의해 주시면 상세히 안내해 드리겠습니다.--------------------------------------------------앞으로도 AI를 활용한 다양한 트레이딩 기능들을 지속적으로 선보일 예정입니다.많은 관심과 기대 부탁드립니다.
2026-02-27
3496
글번호 230811
byheekim 님에 의해서 삭제되었습니다.
2020-01-28
0
글번호 135454
답변완료
시스템식 부탁드립니다.
항상 도움 주셔서 감사합니다.
아래의 Easy Language Code 코드를 예스랭귀지로 변환 부탁드립니다.
감사합니다.
#----------------
# 요청 시스템1
#----------------
Inputs:
TradeUnit(100),
Band1(0), // Should be between 0 and 1
Band2(0), // Should be between 0 and 1
ExitBand(0); // Should be between 0 and .5
Variables:
Support(0), Resistance(0);
If CurrentBar = 1 then Begin
Support = C;
Resistance = C;
End;
If time >= 930 and time <= 1000 then begin
If Close > Resistance then begin
Resistance = Close;
End;
If Close < Support then begin
Support = Close;
End;
End;
#-----------
If time > 1000 and time < 1500 then begin
#-----------
{ Long Entry }
If Close <= (Resistance + Band1) and Close >= (Resistance - Band2) and Close > Close[1] and marketposition = 0 then begin
Buy TradeUnit shares next bar market;
End;
{ Long Exit }
If marketposition = 1 and marketposition = marketposition(1) then begin
Sell TradeUnit shares next bar at (Close - ExitBand) stop;
End;
{ Long Money Management }
If marketposition = 1 and (Close - EntryPrice)*TradeUnit <= -75 then begin
Sell TradeUnit shares next bar market;
End;
{ Short Entry }
If Close <= (Support + Band2) and Close >= (Support - Band1) and Close < Close[1] and marketposition = 0 then begin
Sell short TradeUnit shares next bar market;
End;
{ Short Exit }
If marketposition = -1 and marketposition = marketposition(1) then begin
Buy to cover TradeUnit shares next bar at (Close + ExitBand) stop;
End;
{ Short Money Management }
If marketposition = -1 and (EntryPrice - Close)*TradeUnit <= -75 then begin
Buy to Cover TradeUnit shares next bar market;
End;
#-----------
End;
#-----------
If time >= 1530 then begin
If marketposition = 1 then begin
Sell TradeUnit shares next bar market;
End;
If marketposition = -1 then begin
Buy to Cover TradeUnit shares next bar market;
End;
End;
#----------------
# 요청 시스템2
# Long-Only Strategy
#----------------
Input:
InitialBalance(100000), // The account size at start of trading
NDay(20) // How many days long is this systems basis (20 or 55 day) ;
Variables:
N(0), // Underlying volatility of the stock
DPP(Close), // Dollar per price of the stock
StopLoss(0), // Stop loss value
DollarRisk(0), // Dollar risk value T
radeUnit(100), // How much to trade based on idea that 1N
represents 1% of account equity
UnitsHeld(0), // How many units are currently held NotationalAccount(10000), // Notational Account, hard coded for testing purposes LastAccount(0), // Last account size to reevaluate drawdown Stop_On(False), // Stop loss boolean
Fast_Ave ( 0 ) , // Fast moving average value
Slow_Ave ( 0 ) , // Slow moving average value
Cross_Over (False); // Simple cross-over filter ;
{ Set-up }
Cross_Over = False;
Fast_Ave = Xaverage ( Close , 50 ) ;
Slow_Ave = Xaverage ( Close , 200 ) ;
If Fast_Ave > Slow_Ave and Slow_Ave > Slow_Ave [ 1 ] Then
Cross_Over = True;
{ Position Sizing }
N = VolatilityStdDev(NDay);
DPP = Close; // Price of the stock is equal to its close
DollarRisk = NotationalAccount * 0.01;
TradeUnit = IntPortion(DollarRisk/(N*DPP));
StopLoss = 2 * N;
// Decrease the size of the notational account if 10% drawdown
If NotationalAccount < (LastAccount * 0.9) Then Begin
NotationalAccount = NotationalAccount * 0.8;
Print(File("c: urtle_notational.txt"), NotationalAccount);
End
Else Begin
LastAccount = NotationalAccount;
End;
{ Entry }
// Do not even consider a trade if too many units are on the line
If UnitsHeld < 12 then Begin
// Enter if price exceeds by a single tick high of the preceding NDays)
If Close > HighD(NDay) and Cross_Over then Begin
If marketposition = 0 then begin
Buy ("Long") TradeUnit shares next bar market;
UnitsHeld = UnitsHeld + TradeUnit;
End;
If marketposition = 1 then begin
Buy ("Long more") (TradeUnit / 2) shares next bar market;
UnitsHeld = UnitsHeld + (TradeUnit / 2);
End;
End;
End;
{ Stop }
if ( Close - EntryPrice ) > StopLoss then begin
Stop_On = True;
End
Else begin
Stop_On = False;
End;
{ Exit}
If Close < LowD(NDay/2) and Stop_On then begin
Sell ("Long Exit") currentshares shares next bar market;
UnitsHeld = 0;
End;
#----------------
# 요청 시스템2
# Long-Only Strategy
#----------------
Input:
InitialBalance(100000), // The account size at start of trading
NDay(20) // How many days long is this systems basis (20 or 55 day) ;
Variables:
N(0), // Underlying volatility of the stock
DPP(Close), // Dollar per price of the stock
StopLoss(0), // Stop loss value
DollarRisk(0), // Dollar risk value
TradeUnit(100), // How much to trade based on idea that 1N represents 1% of account equity
UnitsHeld(0), // How many units are currently held NotationalAccount(10000), // Notational Account, hard coded for testing purposes LastAccount(0), // Last account size to reevaluate drawdown Stop_On(False), // Stop loss boolean
Fast_Ave ( 0 ) , // Fast moving average value
Slow_Ave ( 0 ) , // Slow moving average value
Cross_Over (False); // Simple cross-over filter ;
{ Set-up }
Cross_Over = False;
Fast_Ave = Xaverage ( Close , 50 ) ;
Slow_Ave = Xaverage ( Close , 200 ) ;
If Fast_Ave < Slow_Ave and Slow_Ave < Slow_Ave [ 1 ] Then
Cross_Over = True;
{ Position Sizing }
N = VolatilityStdDev(NDay);
DPP = Close; // Price of the stock is equal to its close
DollarRisk = NotationalAccount * 0.01;
TradeUnit = IntPortion(DollarRisk/(N*DPP));
StopLoss = 2 * N;
// Decrease the size of the notational account if 10% drawdown
If NotationalAccount < (LastAccount * 0.9) Then Begin
NotationalAccount = NotationalAccount * 0.8;
Print(File("c: urtle_short_notational.txt"), NotationalAccount);
End
Else Begin
LastAccount = NotationalAccount;
End;
{ Entry }
// Do not even consider a trade if too many units are on the line
#*
If UnitsHeld < 12 then Begin
#*
// Enter if price exceeds by a single tick high of the preceding NDays)
If Close < LowD(NDay) and Cross_Over then Begin
SellShort ("Short") N shares next bar market;
UnitsHeld = UnitsHeld + TradeUnit;
End;
If marketposition = -1 then begin
SellShort ("Short more") (N / 2) shares next bar market;
UnitsHeld = UnitsHeld + (TradeUnit / 2);
End;
End;
#*
End;
#*
{ Stop }
if ( Close - EntryPrice ) < StopLoss then begin
Stop_On = True;
End
Else begin
Stop_On = False;
End;
{ Exit}
If Close > HighD(NDay/2) and Stop_On then begin
BuyToCover ("Short Exit") currentshares shares next bar market;
UnitsHeld = 0;
End;
2020-01-28
534
글번호 135453
참새사냥꾼 님에 의해서 삭제되었습니다.
2020-01-28
2
글번호 135452
답변완료
타주기 이평 부탁드립니다.
아래는 이전에 받은 틱봉을 타주기로 바꾸는 지표입니다.
종가 이평선을 나타낼 수 있도록 부탁드리겠습니다.
감사합니다.
input : n(3);
var : TF(0),S1(0),D1(0),TM(0),cnt(0),idx(0);
Array : OO[10](0), HH[10](0),LL[10](0),CC[10](0);
if Bdate != Bdate[1] Then
{
S1 = TimeToMinutes(stime);
D1 = sdate;
idx = 0;
}
Else
idx = idx+1;
if D1 > 0 then
{
if sdate == D1 Then
TM = TimeToMinutes(stime)-S1;
Else
TM = TimeToMinutes(stime)+1440-S1;
TF = idx%n;
if Bdate != Bdate[1] or (Bdate == Bdate[1] and TF < TF[1]) Then
{
OO[0] = O;
HH[0] = H;
LL[0] = L;
for cnt = 1 to 9
{
OO[cnt] = OO[cnt-1][1];
HH[cnt] = HH[cnt-1][1];
LL[cnt] = LL[cnt-1][1];
CC[cnt] = CC[cnt-1][1];
}
}
if H > HH[0] Then
HH[0] = H;
if L < LL[0] Then
LL[0] = L;
CC[0] = C;
plot1(OO[0],"시가");
plot2(HH[0],"고가");
plot3(LL[0],"저가");
plot4(CC[0],"종가");
}
2020-01-28
232
글번호 135450
답변완료
예스트레이더 수식으로 변환 문의드립니다.
CCI = input(20)
ATR = input(5)
Multiplier=input(1,title='ATR Multiplier')
original=input(true,title='original coloring')
thisCCI = cci(close, CCI)
lastCCI = nz(thisCCI[1])
bufferDn= high + Multiplier * sma(tr,ATR)
bufferUp= low - Multiplier * sma(tr,ATR)
if (thisCCI >= 0 and lastCCI < 0)
bufferUp := bufferDn[1]
if (thisCCI <= 0 and lastCCI > 0)
bufferDn := bufferUp[1]
if (thisCCI >= 0)
if (bufferUp < bufferUp[1])
bufferUp := bufferUp[1]
else
if (thisCCI <= 0)
if (bufferDn > bufferDn[1])
bufferDn := bufferDn[1]
x=thisCCI >= 0 ?bufferUp:thisCCI <= 0 ?bufferDn:x[1]
swap=x>x[1]?1:x<x[1]?-1:swap[1]
swap2=swap==1?lime:red
swap3=thisCCI >=0 ?lime:red
swap4=original?swap3:swap2
plot(x,color=swap4,transp=0,linewidth=3)
감사합니다.
2020-01-28
269
글번호 135436
답변완료
지표 수정 부탁드립니다.
틱봉에서 N분봉으로 변환 후 N분간 고/저점을 나타내는 수식을
이전에 부탁드려 받은 적이 있습니다.
현재 봉이 고가나 저가를 갱신하면 해당 지표의 고/저점도 같이 갱신되므로
사용하지 못하고 있습니다.
1봉 전의 N분간 고/저점을 나타내고 싶은데 수식을 봐도 어디에
[1]을 넣어야 할지 몰라 이렇게 문의 드립니다.
수정 부탁드립니다.
감사합니다.
아래는 이전에 받았던 수식 입니다.
input : n(3),CC(10),CF(3),Per1(25),Per2(50),Per3(75);
input : 굵기1(1),굵기2(1),굵기3(1),굵기4(1),굵기5(1),굵기6(1);
input : 색상1(RED),색상2(MAGENTA),색상3(GREEN),색상4(CYAN),색상5(BLUE),색상6(BLACK);
var : TF(0),S1(0),D1(0),TM(0),cnt(0),T1(0),HH(0),LL(0),ii(0),TT(0);
var : TL1(0),TL2(0),TL3(0),TL4(0),TL5(0),TL6(0);
var : O1(0),H1(0),L1(0),C1(0),sum(0),mav(0),VD(0),VT(0),VM(0),VP(0);
Array : V1[100](0);
if Bdate != Bdate[1] Then
{
S1 = TimeToMinutes(stime);
D1 = sdate;
TT = stime;
ii = 0;
}
Else
ii = ii+1;
if D1 > 0 then
{
#영업일변경 기준으로 경과된 분
if sdate == D1 Then
TM = TimeToMinutes(stime)-S1;
Else
TM = TimeToMinutes(stime)+1440-S1;
//n분 미만
if TM < n then
{
//당일최고와 최저가를 기준으로 선 출력
hh = DayHigh;
ll = daylow;
TL_Delete(TL1);
TL_Delete(TL2);
TL_Delete(TL3);
TL_Delete(TL4);
TL_Delete(TL5);
TL1 = TL_New(D1,TT,HH,Sdate,stime,HH);
TL2 = TL_New(D1,TT,HH-(HH-LL)*0.25,Sdate,stime,HH-(HH-LL)*(Per1/100));
TL3 = TL_New(D1,TT,HH-(HH-LL)*0.50,Sdate,stime,HH-(HH-LL)*(Per2/100));
TL4 = TL_New(D1,TT,HH-(HH-LL)*0.75,Sdate,stime,HH-(HH-LL)*(Per3/100));
TL5 = TL_New(D1,TT,LL,Sdate,stime,LL);
}
else //분이상 경과
{
//최근 n분 이내에서 최고가와 최저가 계산해서 선 출력
HH = H;
LL = L;
for cnt = 0 to ii
{
if TM[cnt] > TM-N then
{
if H[cnt] > HH Then
HH = H[cnt];
if L[cnt] < LL Then
LL = L[cnt];
TT = stime[cnt];
}
if TM[cnt] < TM-N Then
cnt = ii+1;
}
TL_Delete(TL1);
TL_Delete(TL2);
TL_Delete(TL3);
TL_Delete(TL4);
TL_Delete(TL5);
TL1 = TL_New(D1,TT,HH,Sdate,stime,HH);
TL2 = TL_New(D1,TT,HH-(HH-LL)*0.25,Sdate,stime,HH-(HH-LL)*(Per1/100));
TL3 = TL_New(D1,TT,HH-(HH-LL)*0.50,Sdate,stime,HH-(HH-LL)*(Per2/100));
TL4 = TL_New(D1,TT,HH-(HH-LL)*0.75,Sdate,stime,HH-(HH-LL)*(Per3/100));
TL5 = TL_New(D1,TT,LL,Sdate,stime,LL);
}
TL_SetColor(TL1,RED);
TL_SetColor(TL2,MAGENTA);
TL_SetColor(TL3,GREEN);
TL_SetColor(TL4,CYAN);
TL_SetColor(TL5,BLUE);
TL_SetSize(TL1, 굵기1);
TL_SetSize(TL2, 굵기2);
TL_SetSize(TL3, 굵기3);
TL_SetSize(TL4, 굵기4);
TL_SetSize(TL5, 굵기5);
#1분봉 기준(시,고,저,종,거래량 계산)
if bdate != bdate[1] or (Bdate == bdate[1] and TM > TM[1]) Then
{
O1 = O;
H1 = H;
L1 = L;
V1[0] = 0 ;
for cnt = 1 to 99
{
V1[cnt] = v1[cnt-1][1];
}
}
if H > H1 Then
H1 = H;
if L < L1 Then
L1 = L;
C1 = C;
V1[0] = V1[0]+V;
TL_Delete(TL6);
if V1[cc] > 0 then
{
sum = 0;
for cnt = 1 to CC
{
sum = sum + V1[cnt];
}
mav = sum/CC;
//최근 1분거래량이 이전 cc봉 평균대비 CF배 이상이면
if V1[0] >= mav*CF Then
{
//날짜,시간,TM값, 평균값 저장
VD = sdate;
VT = stime;
VM = TM;
VP = (O1+H1+L1+C1)/4;
}
//오늘 거래량조건이 발생한적 있고 현재부터 20분 이내이면 출력
if VD == sdate and VM > TM-n Then
{
TL6 = TL_new(D1,TT,VP,Sdate,stime,VP);
TL_SetColor(TL6,BLACK);
TL_SetSize(TL6,굵기6);
}
}
}
2020-01-28
231
글번호 135434
답변완료
수식 부탁합니다
현재 봉기준 7봉이내에 아래와 같이 거래량이 폭등한 경우
7봉이내 거래량 폭등한 횟수가 3회 이상 발생한 경우 검색식 부탁합니다.
거래량 폭등 : 60이평 거래량 보다 해당봉의 거래량이 7배 이상 폭등
2020-01-28
205
글번호 135433
답변완료
문의 드립니다.
이평선 5 20 60 120 정배열에서 MACD 12 26 9 기준선 0선을 위로 돌파 시 매수 진입
손절과 익절은 MACD 기준선 0선을 아래로 돌파시 매도 청산 완료.
이평선 5 20 60 120 역배열에서 MACD 12 26 9 기준선 0선을 아래로 돌파 시 매도 진입
손절과 익절은 MACD 기준선 0선을 위로 돌파시 매수 청산 완료.
부탁드립니다.
2020-01-28
194
글번호 135432
billiard 님에 의해서 삭제되었습니다.
2020-01-28
30
글번호 135423