커뮤니티
예스랭귀지 Q&A
답변완료
[공지] 예스랭귀지 AI 어시스턴트, '예스나 AI' 출시 및 무료 체험 안내
안녕하세요, 예스스탁 입니다.복잡한 수식 공부 없이 여러분의 아이디어를 말하면 시스템 트레이딩 언어 예스랭귀지로 작성해주는 서비스예스나 AI(YesNa AI)가 출시되었습니다.지금 예스나 AI를 직접 경험해 보실 수 있도록 20크레딧(질문권 20회)를 무료로 증정해 드리고 있습니다.바로 여러분의 아이디어를 코드로 변환해보세요.--------------------------------------------------🚀 YesNa AI 핵심 기능- 지표식/전략식/종목검색식 생성: 자연어로 요청하면 예스랭귀지 문법에 맞는 코드를 작성합니다.- 종목검색식 변환 지원: K증권의 종목 검색식을 예스랭귀지로 변환 지원합니다.- 컴파일 검증: 작성된 코드가 실행 가능한지 컴파일러를 통해 문법 검증을 거쳐 결과물을 제공합니다.상세한 서비스 개요 및 활용 방법은 [서비스 소개 페이지]에서 확인하실 수 있습니다.▶ 서비스 소개 페이지: 바로가기서비스 사용 유의사항 및 결제 환불정책은 [이용약관]을 참고 부탁드립니다.▶ 서비스 이용약관: 바로가기💬 이용 문의사용 중 문의사항은 [프로그램 사용법 Q&A] 게시판에서 [예스나 AI] 카테고리를 설정 후 문의해 주시면 상세히 안내해 드리겠습니다.--------------------------------------------------앞으로도 AI를 활용한 다양한 트레이딩 기능들을 지속적으로 선보일 예정입니다.많은 관심과 기대 부탁드립니다.
2026-02-27
6385
글번호 230811
답변완료
array
안녕하세요?
StandardDevArray(arr,10,1);에서
- 괄호 우측 1은 무엇인가요?
- 2, 3으로 변경해도 결과가 같습니다
2023-08-22
1189
글번호 171758
답변완료
83425번 2항 문의사항 입니다.
83425번
2번항에 해당되는 파인스크립 을 예스 수식으로 변환 부탁드립니다 에서
변환해주신 수식 적용하니 지표가 트레이딩뷰차트랑 예스차트랑 다르게 표기 됩니다.
파일 첨부 하오니 검토 부탁 드리겠습니다.
아래: 파인스크립트 수식 83425번 2번항
atr_length = input(500)
start = input(500)
increment = input(500)
maximum = input(500)
entry_bars = input(500, title='Entry on Nth trend bar')
atr = ta.atr(atr_length)
atr := na(atr) ? ta.tr : atr
psar = 0.0 // PSAR
af = 0.0 // Acceleration Factor
trend_dir = 0 // Current direction of PSAR
ep = 0.0 // Extreme point
trend_bars = 0
sar_long_to_short = trend_dir[1] == 1 and close <= psar[1] // PSAR switches from long to short
sar_short_to_long = trend_dir[1] == -1 and close >= psar[1] // PSAR switches from short to long
trend_change = barstate.isfirst[1] or sar_long_to_short or sar_short_to_long
// Calculate trend direction
trend_dir := barstate.isfirst[1] and close[1] > open[1] ? 1 : barstate.isfirst[1] and close[1] <= open[1] ? -1 : sar_long_to_short ? -1 : sar_short_to_long ? 1 : nz(trend_dir[1])
trend_bars := sar_long_to_short ? -1 : sar_short_to_long ? 1 : trend_dir == 1 ? nz(trend_bars[1]) + 1 : trend_dir == -1 ? nz(trend_bars[1]) - 1 : nz(trend_bars[1])
// Calculate Acceleration Factor
af := trend_change ? start : trend_dir == 1 and high > ep[1] or trend_dir == -1 and low < ep[1] ? math.min(maximum, af[1] + increment) : af[1]
// Calculate extreme point
ep := trend_change and trend_dir == 1 ? high : trend_change and trend_dir == -1 ? low : trend_dir == 1 ? math.max(ep[1], high) : math.min(ep[1], low)
// Calculate PSAR
psar := barstate.isfirst[1] and close[1] > open[1] ? low[1] : barstate.isfirst[1] and close[1] <= open[1] ? high[1] : trend_change ? ep[1] : trend_dir == 1 ? psar[1] + af * atr : psar[1] - af * atr
plot(psar, style=plot.style_cross, color=trend_dir == 1 ? color.green : color.red, linewidth=2)
// Strategy
strategy.entry('Long', strategy.long, when=trend_bars == entry_bars)
strategy.entry('Short', strategy.short, when=trend_bars == -entry_bars)
---------------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------------
아래: 변환해주신 수식 입니다.
2-1 지표
input : atr_length(500),start(500),increment(500),maximum(500),entry_bars(500);
var : atrv(0),psar(0),af(0),trend_dir(0),ep(0),trend_bars(0);
var : sar_long_to_short(False),sar_short_to_long(False);
var : trend_change(False);
atrv = atr(atr_length);
atrv = iff(IsNan(atrv) == true ,TrueRange , atrv);
psar = 0.0; // PSAR
af = 0.0; // Acceleration Factor
trend_dir = 0; // Current direction of PSAR
ep = 0.0; // Extreme point
trend_bars = 0;
sar_long_to_short = trend_dir[1] == 1 and close <= psar[1]; // PSAR switches from long to short
sar_short_to_long = trend_dir[1] == -1 and close >= psar[1]; // PSAR switches from short to long
trend_change = sar_long_to_short or sar_short_to_long;
// Calculate trend direction
trend_dir = iff(close[1] > open[1] , 1 ,
IFf(close[1] <= open[1] , -1 ,
IFf(sar_long_to_short , -1 ,
iff(sar_short_to_long , 1 , iff(isnan(trend_dir[1])==False,trend_dir[1],0)))));
trend_bars = iff(sar_long_to_short , -1 ,
IFf(sar_short_to_long , 1 ,
iff(trend_dir == 1 , iff(isnan(trend_bars[1])==False,trend_bars[1],0)+ 1 ,
IFf( trend_dir == -1 , iff(isnan(trend_bars[1])==False,trend_bars[1],0) - 1 , iff(isnan(trend_bars[1])==False,trend_bars[1],0) ))));
// Calculate Acceleration Factor
af = iff(trend_change , start ,
iff(trend_dir == 1 and high > ep[1] or trend_dir == -1 and low < ep[1] , min(maximum, af[1] + increment) , af[1]));
// Calculate extreme point
ep = iff(trend_change and trend_dir == 1 , high ,
iff(trend_change and trend_dir == -1 , low ,
iff(trend_dir == 1 , max(ep[1], high) , min(ep[1], low))));
// Calculate PSAR
psar = iff(close[1] > open[1] , low[1] ,
IFf(close[1] <= open[1] , high[1] ,
IFf(trend_change , ep[1] ,
IFf(trend_dir == 1 , psar[1] + af * atrv , psar[1] - af * atrv))));
plot1(psar,"psar",iff(trend_dir == 1 , green , red));
2-2 시스템
input : atr_length(500),start(500),increment(500),maximum(500),entry_bars(500);
var : atrv(0),psar(0),af(0),trend_dir(0),ep(0),trend_bars(0);
var : sar_long_to_short(False),sar_short_to_long(False);
var : trend_change(False);
atrv = atr(atr_length);
atrv = iff(IsNan(atrv) == true ,TrueRange , atrv);
psar = 0.0; // PSAR
af = 0.0; // Acceleration Factor
trend_dir = 0; // Current direction of PSAR
ep = 0.0; // Extreme point
trend_bars = 0;
sar_long_to_short = trend_dir[1] == 1 and close <= psar[1]; // PSAR switches from long to short
sar_short_to_long = trend_dir[1] == -1 and close >= psar[1]; // PSAR switches from short to long
trend_change = sar_long_to_short or sar_short_to_long;
// Calculate trend direction
trend_dir = iff(close[1] > open[1] , 1 ,
IFf(close[1] <= open[1] , -1 ,
IFf(sar_long_to_short , -1 ,
iff(sar_short_to_long , 1 , iff(isnan(trend_dir[1])==False,trend_dir[1],0)))));
trend_bars = iff(sar_long_to_short , -1 ,
IFf(sar_short_to_long , 1 ,
iff(trend_dir == 1 , iff(isnan(trend_bars[1])==False,trend_bars[1],0)+ 1 ,
IFf( trend_dir == -1 , iff(isnan(trend_bars[1])==False,trend_bars[1],0) - 1 , iff(isnan(trend_bars[1])==False,trend_bars[1],0) ))));
// Calculate Acceleration Factor
af = iff(trend_change , start ,
iff(trend_dir == 1 and high > ep[1] or trend_dir == -1 and low < ep[1] , min(maximum, af[1] + increment) , af[1]));
// Calculate extreme point
ep = iff(trend_change and trend_dir == 1 , high ,
iff(trend_change and trend_dir == -1 , low ,
iff(trend_dir == 1 , max(ep[1], high) , min(ep[1], low))));
// Calculate PSAR
psar = iff(close[1] > open[1] , low[1] ,
IFf(close[1] <= open[1] , high[1] ,
IFf(trend_change , ep[1] ,
IFf(trend_dir == 1 , psar[1] + af * atrv , psar[1] - af * atrv))));
IF trend_bars == entry_bars TheN
Buy();
IF trend_bars == -entry_bars TheN
Sell();
2-3 종목검색
input : atr_length(500),start(500),increment(500),maximum(500),entry_bars(500);
var : atrv(0),psar(0),af(0),trend_dir(0),ep(0),trend_bars(0);
var : sar_long_to_short(False),sar_short_to_long(False);
var : trend_change(False);
atrv = atr(atr_length);
atrv = iff(IsNan(atrv) == true ,TrueRange , atrv);
psar = 0.0; // PSAR
af = 0.0; // Acceleration Factor
trend_dir = 0; // Current direction of PSAR
ep = 0.0; // Extreme point
trend_bars = 0;
sar_long_to_short = trend_dir[1] == 1 and close <= psar[1]; // PSAR switches from long to short
sar_short_to_long = trend_dir[1] == -1 and close >= psar[1]; // PSAR switches from short to long
trend_change = sar_long_to_short or sar_short_to_long;
// Calculate trend direction
trend_dir = iff(close[1] > open[1] , 1 ,
IFf(close[1] <= open[1] , -1 ,
IFf(sar_long_to_short , -1 ,
iff(sar_short_to_long , 1 , iff(isnan(trend_dir[1])==False,trend_dir[1],0)))));
trend_bars = iff(sar_long_to_short , -1 ,
IFf(sar_short_to_long , 1 ,
iff(trend_dir == 1 , iff(isnan(trend_bars[1])==False,trend_bars[1],0)+ 1 ,
IFf( trend_dir == -1 , iff(isnan(trend_bars[1])==False,trend_bars[1],0) - 1 , iff(isnan(trend_bars[1])==False,trend_bars[1],0) ))));
// Calculate Acceleration Factor
af = iff(trend_change , start ,
iff(trend_dir == 1 and high > ep[1] or trend_dir == -1 and low < ep[1] , min(maximum, af[1] + increment) , af[1]));
// Calculate extreme point
ep = iff(trend_change and trend_dir == 1 , high ,
iff(trend_change and trend_dir == -1 , low ,
iff(trend_dir == 1 , max(ep[1], high) , min(ep[1], low))));
// Calculate PSAR
psar = iff(close[1] > open[1] , low[1] ,
IFf(close[1] <= open[1] , high[1] ,
IFf(trend_change , ep[1] ,
IFf(trend_dir == 1 , psar[1] + af * atrv , psar[1] - af * atrv))));
IF trend_bars == entry_bars TheN
find(1);
즐거운 하루되세요
2023-08-22
1737
글번호 171757
답변완료
전략실행차트 멀티 사용법
안녕하세요.
현재 전략실행차트를 통해 시스템트레이딩을 잘 활용하고 있는데요,
혹시 여러개의 차트를 동시에 활용해서 시스템을 만들 수 있나요?
그리고 수식 작성 시,
당일의 고점, 저점을 dayhigh[1], daylow[1] 함수를 활용하고 있는데요,
최근 한시간 이내의 고점, 저점을 계산해주는 함수가 따로 있을까요?
확인부탁드립니다. 감사합니다.
2023-08-22
1337
글번호 171754
답변완료
스토캐스틱 지표값이 다르게 나옵니다.
input : 모드("현재");
Input : period1(5), period2(3);
var : minv(0),maxv(0);
#모드 현재 또는 미래일때 표시
if 모드 == "현재" or 모드 == "미래" Then
{
Plot2((c-Lowest(l,period1))/(Highest(h,period1)-Lowest(l,period1))*100,"%K",rgb(255, 102, 0));
Plot4(ma((c-Lowest(l,period1))/(Highest(h,period1)-Lowest(l,period1))*100,period2),"%D",rgb(141, 26, 130));
}
이렇게 공식으로 스토캐스틱 현재값을 구현했을 때
실제로 트렌즈차트에 적용되어 있는 스토캐스틱과 비교했을 때 값이 다르게 나올 경우, 어떤 문제가 있다고 보시는지요?
식의 문제인건지..아니면 스토캐스틱을 구하는 다른 방식이 있는 것인지 궁금합니다.
트렌즈차트에 적용된 지표와 제가 만든 지표 사이의 괴리가 발생하는 이유를 알 수 있을까요?
2023-08-22
1283
글번호 171753
답변완료
수식 문의
안녕하세요 .. 키움 신호 수식인데.. 예스 종목검색 수식으로 부탁드려요
A=MACD(5,10)-eavg(MACD(5,10),15);
B=MACD(10,40)-eavg(MACD(10,40),80);
CrossUp(A, B)
2023-08-22
1069
글번호 171738
정구지 님에 의해서 삭제되었습니다.
2023-08-22
36
글번호 171737
답변완료
문의 드립니다.
아래 식에서 수량을 추가할 수 있도록 부탁드립니다.
Input : Period(5);
Var : value(0);
value = ma(bids,period)-ma(asks,period);
if CrossUp(value,0) Then
Buy();
if CrossDown(value,0) Then
ExitLong();
2023-08-22
841
글번호 171736
정구지 님에 의해서 삭제되었습니다.
2023-08-22
39
글번호 171735
답변완료
문의드립니다
안녕하세요?
아래수식에서
if var1 > var1[1] Then
T = 1;
else if var1 < var1[1] Then
T = -1;
Else
T = 0;
Plot1(var1,"1",iff(T==1,Red,iff(T==-1,Blue,Green)));
빨강선이 그린선으로바뀌었다 파랑선으로바뀌면 이란 조건문을 알고싶습니다
감사합니다
2023-08-22
1040
글번호 171734