커뮤니티
예스랭귀지 Q&A
답변완료
[공지] 예스랭귀지 AI 어시스턴트, '예스나 AI' 출시 및 무료 체험 안내
안녕하세요, 예스스탁 입니다.복잡한 수식 공부 없이 여러분의 아이디어를 말하면 시스템 트레이딩 언어 예스랭귀지로 작성해주는 서비스예스나 AI(YesNa AI)가 출시되었습니다.지금 예스나 AI를 직접 경험해 보실 수 있도록 20크레딧(질문권 20회)를 무료로 증정해 드리고 있습니다.바로 여러분의 아이디어를 코드로 변환해보세요.--------------------------------------------------🚀 YesNa AI 핵심 기능- 지표식/전략식/종목검색식 생성: 자연어로 요청하면 예스랭귀지 문법에 맞는 코드를 작성합니다.- 종목검색식 변환 지원: K증권의 종목 검색식을 예스랭귀지로 변환 지원합니다.- 컴파일 검증: 작성된 코드가 실행 가능한지 컴파일러를 통해 문법 검증을 거쳐 결과물을 제공합니다.상세한 서비스 개요 및 활용 방법은 [서비스 소개 페이지]에서 확인하실 수 있습니다.▶ 서비스 소개 페이지: 바로가기서비스 사용 유의사항 및 결제 환불정책은 [이용약관]을 참고 부탁드립니다.▶ 서비스 이용약관: 바로가기💬 이용 문의사용 중 문의사항은 [프로그램 사용법 Q&A] 게시판에서 [예스나 AI] 카테고리를 설정 후 문의해 주시면 상세히 안내해 드리겠습니다.--------------------------------------------------앞으로도 AI를 활용한 다양한 트레이딩 기능들을 지속적으로 선보일 예정입니다.많은 관심과 기대 부탁드립니다.
2026-02-27
4484
글번호 230811
답변완료
시스템 수식 문의 드립니다.
안녕하세요~제가 다음과 같은 신호를 사용하고 있는데요...
var1 = Highest(H,2);
var2 = lowest(L,2);
if crossup(c,var1[1]) Then
buy("b");
if CrossDown(c,var2[1]) Then
sell("s");
매수/매도 신호가 나올때 마다 고점과 저점을 잇는 지그재그 선을 넣고 싶습니다~
지그재그선의 색깔과 굵기도 input으로 넣어주시면 정말 감사하겠습니다~
감사합니다.
2019-02-06
231
글번호 125903
답변완료
행사가표시(ceiling,floor함수이용법??)
# 장시작 후 행사가 3~개를 표시하고자 합니다. 지도 부탁합니다.
var :pv(0),r1(0),s1(0);
Var1 = Ceiling(C, 2.5); // 소수분분을 올림한 정수값
Var2 = Floor(C, 2.5); // 소수부분을 내림한 정수값
//Ceiling 함수와 Floor 함수가 구현이 안됩니다,
If Var1 < Var2 Then{
pv = Var1;
}
Else {
pv = Var2;
r1 = pv+2.5;
s1 = pv-2.5;
}
Plot1(r1,"1차행사가",BLACK);
Plot2(pv,"중심선",BLACK);
Plot3(s1,"-차행사가",BLACK);
2019-02-06
243
글번호 125902
답변완료
수식 문의 드립니다^^
1번수식
input : Period(10);
Input : BBP(20), MultiD(2);
var : Counter(0), Lowval(0), Highval(0), DownVel(0),UpVel(0), DnAroon(0),UpAroon(0) ;
var : BBmd(0),BBup(0),BBdn(0);
BBmd = ma(C,BBP);
BBup = BollBandUp(BBP,MultiD);
BBdn = BollBandDown(BBP,MultiD);
Lowval= Lowest(Low, Period+1);
Highval = Highest(High, Period+1);
For counter= 0 To Period {
If Low[counter] == Lowval Then
DownVel = counter;
If High[counter] == highval Then
UpVel = counter;
}
UpAroon = 100*(Period-UpVel)/Period;
DnAroon = 100*(Period-DownVel)/Period;
if crossup(UpAroon,DnAroon) and c > BBup Then
buy("Aroon_LE");
if CrossDown(UpAroon,DnAroon) and C < BBdn Then
sell("Aroon_SE");
2번수식
input : Period(46);
var : Counter(0), Lowval(0), Highval(0), DownVel(0),UpVel(0), DnAroon(0),UpAroon(0) ;
Lowval= Lowest(Low, Period+1);
Highval = Highest(High, Period+1);
For counter= 0 To Period {
If Low[counter] == Lowval Then
DownVel = counter;
If High[counter] == highval Then
UpVel = counter;
}
UpAroon = 100*(Period-UpVel)/Period;
DnAroon = 100*(Period-DownVel)/Period;
if crossup(UpAroon,DnAroon) Then
buy("Aroon_LE");
if CrossDown(UpAroon,DnAroon) Then
sell("Aroon_SE");
질문1 : 수식2번은 꼭 15분봉이어야 한다는 전제 조건이 있습니다.(이럴땐 참조 사용하여야 하나요?)
질문2: 수식1번은 분봉이 바뀔수 있으므로 수식1번과 수식2번이 3봉이내에 신호나오는 곳에서 유효신호가 나왔음 합니다.
예를 들면 수식1번 신호 나오고 3봉 이내에 수식2번이 신호나오면 유효신호 발생
수식2번 신호 나오고 2봉 이내에 수식1번이 신호나오면 유효신호 발생
수식1번 신호 나오고 4봉 지나서 수식2번이 신호나오면 무효 등...
항상 답변을 잘해주셔서 감사합니다~~~
수고 하시고 새해 복 많이 받으십시오^^
2019-02-06
223
글번호 125901
답변완료
문의드립니다.
안녕하세요.
주식 일봉 차트에서
한봉 전의 최근 10봉 중 가장 큰음봉(전일종가 대비)과 두 번째 큰 음봉의
c/c[1]-1과 v 값을 구하는 수식 알려주세요.
수고하세요.
2019-02-06
220
글번호 125900
답변완료
Stochastic, WiliamsR 수식 수정 부탁드립니다.
아래의 수식에서 매수진입과 매도진입 포지션 수식만 변경 부탁드립니다.
매수 조건
1. Stochastic Fast cross Up 과 WiliamsR 20 돌파가 동시에 발생시 매수포지션
2. Stochastic Fast cross Up 발생 이후 WiliamsR 20 돌파 발생시 매수포지션
매도 조건
1. Stochastic Fast cross Down 과 WiliansR 80 이탈이 동시에 발생시 매도포지션
2. Stochastic Fast cress Down 발생 이후 WiliamsR 80 이탈 발생시 매도포지션
나머지 스위칭 조건, 당일누적틱수 관련 수식은 동일합니다. 꾸벅
- 아 래 -
Input : 당일누적수익틱수(200),당일누적손실틱수(150),P(120);
input : startdate(20181003),starttime(100000),enddate(20181031),endtime(172000);
input : sto1(25),sto2(15),sto3(15);
VARS: Tcond(false),N1(0),dayPl(0),당일누적수익(0),당일누적손실(0),Xcond(false),stok(0),stod(0);
if (sdate == enddate and sdate != sdate[1] and stime >= endtime) or
(sdate == enddate and sdate == sdate[1] and stime >= endtime and stime[1] < endtime) then
{
Tcond = false;
if MarketPosition == 1 Then
ExitLong("매수청산");
if MarketPosition == -1 Then
ExitShort("매도청산");
}
if (sdate >= startdate and sdate != sdate[1] and stime >= starttime) or
(sdate >= startdate and sdate == sdate[1] and stime >= starttime and stime[1] < starttime) then
{
Xcond = false;
N1 = NetProfit;
Tcond = true;
}
당일누적수익 = PriceScale*당일누적수익틱수;
당일누적손실 = PriceScale*당일누적손실틱수;
daypl = NetProfit-N1;
if TotalTrades > TotalTrades[1] and
(daypl >= 당일누적수익 or daypl <= -당일누적손실) then
Xcond = true;
stok = StochasticsK(sto1,sto2);
stod = StochasticsD(sto1,sto2,sto3);
if Tcond == true and Xcond == false then
{
if crossup(stok,stod) Then
buy("매수");
if CrossDown(stok,stod) Then
sell("매도");
}
if MarketPosition == 1 then{
ExitLong("매수수익",atlimit,EntryPrice+((당일누적수익-daypl)/CurrentContracts));
ExitLong("매수손실",AtStop,EntryPrice-((당일누적손실+daypl)/CurrentContracts));
}
if MarketPosition == -1 then{
ExitShort("매도수익",atlimit,EntryPrice-((당일누적수익-daypl)/CurrentContracts));
ExitShort("매도손실",AtStop,EntryPrice+((당일누적손실+daypl)/CurrentContracts));
}
if sdate != sdate[1] Then
SetStopEndofday(172000);
if bdate != bdate[1] Then
SetStopEndofday(0);
2019-02-06
224
글번호 125899
답변완료
수식작성부탁드립니다.
adx와 스토캐스틱을 이용한 시스템을 사용하려고합니다.
매수조건
1. adxv가 전봉보다 상승 및 dp>dm, adxv>25 이고
2. 스토캐스틱k값 > d 값
조건 1, 2가 동시에 갖춰지는 최초의 순간에 매수
매도조건
1. adxv가 전봉보다 상승 및 dp<dm, adxv>25이고
2. 스토캐스틱 k값 < d값
조건 1, 2가 동시에 갖춰지는 최초의 순간에 매도
청산조건
1. 10틱 수익시 청산
2. 6틱 손실시 청산
또는
1. 파라볼릭 신호에서 매수/매도신호가 나올경우
(둘중 마음을 못정해서 둘다 써주시면, 선택해서 잘 사용하겠습니다.)
2019-02-06
219
글번호 125898
답변완료
수식부탁드립니다
"새해복 많이 받으세요"
A = plot1
B = plot2
$,아래1)번식에서 ㅡ, 현재가가 A 를 상향돌파후 A 지지를 받고 첫 양봉전환시 점표시(Red)
ㅡ, 현재가가 B 를 하향이탈후 B 저항을 받고 첫 음봉전환시 점표시(Blue)
( per함수 외부변수처리하면 좋겠습니다)
$$,아래2)번식은 Text함수 출력하고저 작성한식인데 내부함수 에러가 자꾸 뜨네요,도움
부탁드립니다.그리고 TL라인 색상과 선굵기 조절도 외부변수처리 되도록 수정
부탁드립니다.
1)
input : Per1(23);
Var : S1(0),S2(1),S3(1),S4(1);
S1 = (dayhigh(0)+daylow(0))/2;
S2 = (dayhigh(1)+daylow(1))/2;
S3 = dayhigh(1);
S4 = daylow(1);
plot1(dayopen()+abs(S3-S4)*(Per1/100),"B");
plot2(dayopen()-abs(S3-S4)*(Per1/100),"S");
2)
input : per1(11.8),per2(23.6),per3(38.2),per4(50.0),per5(61.8),per6(76.4),per7(88.2);
var : hh(0),ll(0),h1(0),l1(0),dd(0),tt(0),d1(0),t1(0);
var : tl1(0),tl2(0),tl3(0),tl4(0),tl5(0),tl6(0),tl7(0),tl8(0),tl9(0);
var : Tx1(0),Tx2(0),Tx3(0),Tx4(0),Tx5(0),Tx6(0),Tx7(0),tx8(0),tx9(0);
if bdate > bdate[1]+30 then
{
hh = h;
ll = l;
h1 = hh[1];
l1 = ll[1];
dd = sdate[1];
tt = stime[1];
d1 = dd[1];
t1 = tt[1];
TL_Delete(tl1);
TL_Delete(tl2);
TL_Delete(tl3);
TL_Delete(tl4);
TL_Delete(tl5);
TL_Delete(tl6);
TL_Delete(tl7);
TL_Delete(tl8);
TL_Delete(tl9);
tl1 = TL_New(dd,tt,hh,sdate,stime,hh);
tl2 = TL_New(dd,tt,hh-(hh-ll)*(per1/100),sdate,stime,hh-(hh-ll)*(per1/100));
tl3 = TL_New(dd,tt,hh-(hh-ll)*(per2/100),sdate,stime,hh-(hh-ll)*(per2/100));
tl4 = TL_New(dd,tt,hh-(hh-ll)*(per3/100),sdate,stime,hh-(hh-ll)*(per3/100));
tl5 = TL_New(dd,tt,hh-(hh-ll)*(per4/100),sdate,stime,hh-(hh-ll)*(per4/100));
tl6 = TL_New(dd,tt,hh-(hh-ll)*(per5/100),sdate,stime,hh-(hh-ll)*(per5/100));
tl7 = TL_New(dd,tt,hh-(hh-ll)*(per6/100),sdate,stime,hh-(hh-ll)*(per6/100));
tl8 = TL_New(dd,tt,hh-(hh-ll)*(per7/100),sdate,stime,hh-(hh-ll)*(per7/100));
tl9 = TL_New(dd,tt,ll,sdate,stime,ll);
}
if h > hh Then
{
hh = h;
TL_Delete(tl1);
TL_Delete(tl2);
TL_Delete(tl3);
TL_Delete(tl4);
TL_Delete(tl5);
TL_Delete(tl6);
TL_Delete(tl7);
TL_Delete(tl8);
TL_Delete(tl9);
tl1 = TL_New(dd,tt,hh,sdate,stime,hh);
tl2 = TL_New(dd,tt,hh-(hh-ll)*(per1/100),sdate,stime,hh-(hh-ll)*(per1/100));
tl3 = TL_New(dd,tt,hh-(hh-ll)*(per2/100),sdate,stime,hh-(hh-ll)*(per2/100));
tl4 = TL_New(dd,tt,hh-(hh-ll)*(per3/100),sdate,stime,hh-(hh-ll)*(per3/100));
tl5 = TL_New(dd,tt,hh-(hh-ll)*(per4/100),sdate,stime,hh-(hh-ll)*(per4/100));
tl6 = TL_New(dd,tt,hh-(hh-ll)*(per5/100),sdate,stime,hh-(hh-ll)*(per5/100));
tl7 = TL_New(dd,tt,hh-(hh-ll)*(per6/100),sdate,stime,hh-(hh-ll)*(per6/100));
tl8 = TL_New(dd,tt,hh-(hh-ll)*(per7/100),sdate,stime,hh-(hh-ll)*(per7/100));
tl9 = TL_New(dd,tt,ll,sdate,stime,ll);
}
if l < ll Then
{
ll = l;
TL_Delete(tl1);
TL_Delete(tl2);
TL_Delete(tl3);
TL_Delete(tl4);
TL_Delete(tl5);
TL_Delete(tl6);
TL_Delete(tl7);
TL_Delete(tl8);
TL_Delete(tl9);
tl1 = TL_New(dd,tt,hh,sdate,stime,hh);
tl2 = TL_New(dd,tt,hh-(hh-ll)*(per1/100),sdate,stime,hh-(hh-ll)*(per1/100));
tl3 = TL_New(dd,tt,hh-(hh-ll)*(per2/100),sdate,stime,hh-(hh-ll)*(per2/100));
tl4 = TL_New(dd,tt,hh-(hh-ll)*(per3/100),sdate,stime,hh-(hh-ll)*(per3/100));
tl5 = TL_New(dd,tt,hh-(hh-ll)*(per4/100),sdate,stime,hh-(hh-ll)*(per4/100));
tl6 = TL_New(dd,tt,hh-(hh-ll)*(per5/100),sdate,stime,hh-(hh-ll)*(per5/100));
tl7 = TL_New(dd,tt,hh-(hh-ll)*(per6/100),sdate,stime,hh-(hh-ll)*(per6/100));
tl8 = TL_New(dd,tt,hh-(hh-ll)*(per7/100),sdate,stime,hh-(hh-ll)*(per7/100));
tl9 = TL_New(dd,tt,ll,sdate,stime,ll);
}
TL_SetExtRight(tl1,true);
TL_SetExtRight(tl2,true);
TL_SetExtRight(tl3,true);
TL_SetExtRight(tl4,true);
TL_SetExtRight(tl5,true);
TL_SetExtRight(tl6,true);
TL_SetExtRight(tl7,true);
TL_SetExtRight(tl8,true);
TL_SetExtRight(tl9,true);
TL_SetStyle(TL1,1);
TL_SetStyle(TL2,5);
TL_SetStyle(TL3,5);
TL_SetStyle(TL4,5);
TL_SetStyle(TL5,1);
TL_SetStyle(TL6,5);
TL_SetStyle(TL7,5);
TL_SetStyle(TL8,5);
TL_SetStyle(TL9,1);
TL_SetColor(tl1,MAGENTA);
TL_SetColor(tl2,MAGENTA);
TL_SetColor(tl3,MAGENTA);
TL_SetColor(tl4,MAGENTA);
TL_SetColor(tl5,LMAGENTA);
TL_SetColor(tl6,BLUE);
TL_SetColor(tl7,BLUE);
TL_SetColor(tl8,BLUE);
TL_SetColor(tl9,BLUE);
TL_SetSize(tl5,1);
Text_Delete(tx1);
Text_Delete(tx2);
Text_Delete(tx3);
Text_Delete(tx4);
Text_Delete(tx5);
Text_Delete(tx6);
Text_Delete(tx7);
Text_Delete(tx8);
Text_Delete(tx9);
tx1 = Text_New(sdate,stime,hh);
tx2 = Text_New(sdate,stime,hh-(hh-ll)*(Per1/100),NumToStr(Per1,2)+"% :" +NumToStr(hh-(hh-ll)*(Per1/100),2));
tx3 = Text_New(sdate,stime,hh-(hh-ll)*(Per2/100),NumToStr(Per2,2)+"% :" +NumToStr(hh-(hh-ll)*(Per2/100),2));
tx4 = Text_New(sdate,stime,hh-(hh-ll)*(Per3/100),NumToStr(Per3,2)+"% :" +NumToStr(hh-(hh-ll)*(Per3/100),2));
tx5 = Text_New(sdate,stime,hh-(hh-ll)*(Per4/100),NumToStr(Per4,2)+"% :" +NumToStr(hh-(hh-ll)*(Per4/100),2));
tx6 = Text_New(sdate,stime,hh-(hh-ll)*(Per5/100),NumToStr(Per5,2)+"% :" +NumToStr(hh-(hh-ll)*(Per5/100),2));
tx7 = Text_New(sdate,stime,hh-(hh-ll)*(Per6/100),NumToStr(Per6,2)+"% :" +NumToStr(hh-(hh-ll)*(Per6/100),2));
tx8 = Text_New(sdate,stime,hh-(hh-ll)*(Per7/100),NumToStr(Per7,2)+"% :" +NumToStr(hh-(hh-ll)*(Per7/100),2));
tx9 = Text_New(sdate,stime,ll);
Text_SetStyle(tx1,1,3);
Text_SetStyle(tx2,1,3);
Text_SetStyle(tx3,1,3);
Text_SetStyle(tx4,1,3);
Text_SetStyle(tx5,1,3);
Text_SetStyle(tx6,1,3);
Text_SetStyle(tx7,1,3);
Text_SetStyle(tx8,1,3);
Text_SetStyle(tx9,1,3);
Text_SetColor(tx1,BLACK);
Text_SetColor(tx2,BLACK);
Text_SetColor(tx3,BLACK);
Text_SetColor(tx4,BLACK);
Text_SetColor(tl5,BLACK);
Text_SetColor(tx6,BLACK);
Text_SetColor(tx7,BLACK);
Text_SetColor(tx8,BLACK);
Text_SetColor(tx9,BLACK);
도움 주심에 늘 감사합니다.
2019-02-06
254
글번호 125897
답변완료
수식문의
지수이평 기준으로 5분차트에서 5이평과60이평의 교차점 발생전의
상하방향의 가격을 알고 싶습니다
5이평이 50이고 60이평이 70일경우 교차된다면
80이나90정도는 되어야 하는데 그 가격을 수평선으로 표시하고 싶습니다
반대로 5이평이 70이고 60이평이 50일 경우
40이나 30은 되어야 하는데 그 가격을 수평선으로 표시하고 싶습니다
감사합니다
2019-02-04
227
글번호 125896
답변완료
수식 부탁드립니다
이해를 돕고자 참조그림을 첨부합니다!
주가가 (볼린저밴 중심선)20선을 상향돌파후 다시 20선 지지받고 음봉이 아래꼬리가 생기며
양봉으로 전환될시 시스템식을 부탁드립니다!
주가가 (볼린저밴드 중신선)20선을 하향돌파후 다시 20선 저항받고 양봉이 위꼬리가 생기며
음봉으로 전환될시 시스템식을 부탁드립니다!
2019-02-07
263
글번호 125895