커뮤니티
예스랭귀지 Q&A
[공지] 예스랭귀지 AI 어시스턴트, '예스나 AI' 출시 및 무료 체험 안내
안녕하세요, 예스스탁 입니다.복잡한 수식 공부 없이 여러분의 아이디어를 말하면 시스템 트레이딩 언어 예스랭귀지로 작성해주는 서비스예스나 AI(YesNa AI)가 출시되었습니다.지금 예스나 AI를 직접 경험해 보실 수 있도록 20크레딧(질문권 20회)를 무료로 증정해 드리고 있습니다.바로 여러분의 아이디어를 코드로 변환해보세요.--------------------------------------------------🚀 YesNa AI 핵심 기능- 지표식/전략식/종목검색식 생성: 자연어로 요청하면 예스랭귀지 문법에 맞는 코드를 작성합니다.- 종목검색식 변환 지원: K증권의 종목 검색식을 예스랭귀지로 변환 지원합니다.- 컴파일 검증: 작성된 코드가 실행 가능한지 컴파일러를 통해 문법 검증을 거쳐 결과물을 제공합니다.상세한 서비스 개요 및 활용 방법은 [서비스 소개 페이지]에서 확인하실 수 있습니다.▶ 서비스 소개 페이지: 바로가기서비스 사용 유의사항 및 결제 환불정책은 [이용약관]을 참고 부탁드립니다.▶ 서비스 이용약관: 바로가기💬 이용 문의사용 중 문의사항은 [프로그램 사용법 Q&A] 게시판에서 [예스나 AI] 카테고리를 설정 후 문의해 주시면 상세히 안내해 드리겠습니다.--------------------------------------------------앞으로도 AI를 활용한 다양한 트레이딩 기능들을 지속적으로 선보일 예정입니다.많은 관심과 기대 부탁드립니다.
2026-02-27
1344
글번호 230811
답변완료
공통부분 바탕색 표시
1,호가잔량 상승하락 바탕색 표시 수식
var :value(0), T(0,Data1),box(0),dd(0),tt(0),hh(0),ll(0);
Inputs:단기(5),중기(20);
var5 = bids-asks;#잔량차(매수호가잔량-매도호가잔량)
Var1 = ma(var5,단기)[1];
Var2 = ma(var5,중기)[1];
if CrossUp(var1,Var2) Then
{
T = 1;
dd = sDate;
tt = sTime;
HH = L;
LL = L;
box = box_new(sDate,sTime,hh,NextBarSdate,NextBarStime,ll);
Box_SetColor(box,Yellow);
Box_SetFill(box,true,50,true);
Box_SetExtFill(box,true);
}
if CrossDown(var1,Var2) Then
{
T = -1;
dd = sDate;
tt = sTime;
HH = L;
LL = L;
box = box_new(sDate,sTime,hh,NextBarSdate,NextBarStime,ll);
Box_SetColor(box,Gray);
Box_SetFill(box,true,50,true);
Box_SetExtFill(box,true);
}
if T == 1 Then
{
if H > hh Then
hh = h;
if l < ll Then
ll = l;
Box_SetBegin(box,dd,tt,hh);
Box_SetEnd(box,NextBarSdate,NextBarStime,ll);
}
if T == -1 Then
{
if H > hh Then
hh = h;
if l < ll Then
ll = l;
Box_SetBegin(box,dd,tt,hh);
Box_SetEnd(box,NextBarSdate,NextBarStime,ll);
}
2,20 이평 상승하락 바탕색 표시
input : P(20);
var : T(0),box(0),value(0),dd(0),tt(0),hh(0),ll(0);;
var1 = ma(c,P);
if var1 > var1[1] Then
T = 1;
if var1 < var1[1] Then
T = -1;
if var1>Var1[1] Then
{
T = 1;
dd = sDate;
tt = sTime;
HH = L;
LL = L;
box = box_new(sDate,sTime,hh,NextBarSdate,NextBarStime,ll);
Box_SetColor(box,Yellow);
Box_SetFill(box,true,50,true);
Box_SetExtFill(box,true);
}
if var1<Var1[1] Then
{
T = -1;
dd = sDate;
tt = sTime;
HH = L;
LL = L;
box = box_new(sDate,sTime,hh,NextBarSdate,NextBarStime,ll);
Box_SetColor(box,lightBlue);
Box_SetFill(box,true,50,true);
Box_SetExtFill(box,true);
}
if T == 1 Then
{
if H > hh Then
hh = h;
if l < ll Then
ll = l;
Box_SetBegin(box,dd,tt,hh);
Box_SetEnd(box,NextBarSdate,NextBarStime,ll);
}
if T == -1 Then
{
if H > hh Then
hh = h;
if l < ll Then
ll = l;
Box_SetBegin(box,dd,tt,hh);
Box_SetEnd(box,NextBarSdate,NextBarStime,ll);
}
3,1번과 2번 공통부분바탕색을 표시 부탁드립니다
2025-01-09
530
글번호 187068
답변완료
시스템식 부탁드립니다.
안녕하세요.
항상 도움 주셔서 감사합니다.
아래 조건에 맞는 시스템식 부탁드립니다.
제가 초보입니다.
죄송하지만 주석도 같이 부탁드립니다.
종목 : 해외선물
차트 : 10분봉
요청식 1
1. 장시작 시간이 아침 8시 이지만 8시 30분 이후부터 매매를 시작하고 싶습니다.
2. 장마감 시간이 아침 7시 이지만 6시에 모든 포지션을 청산하고 싶습니다.
3. 하루에 2번 매매하는데 첫번째 매매가 수익청산 이면 매매 중단
첫번째 매매가 손실청산이면 2번까지 매매 하고 싶습니다.
4. 익일 리셋
요청식 2
1. 장시작 시간이 아침 8시 이지만 8시 30분 이후부터 매매를 시작하고 싶습니다.
2. 장마감 시간이 아침 7시 이지만 6시에 모든 포지션을 청산하고 싶습니다.
3. 하루의 2번 매매하는데 첫번째 청산이익 또는 청산손실이 40틱 이면 매매 중단
청산이익 및 청산손실이 40틱 미달하면 2번까지 매매 하고 싶습니다.
4. 익일 리셋
감사합니다.
아래 수식에서 수정 부탁드립니다.
1.
Input : 당일수익틱수(100);
input : pt(20), sl(20);
input : StartTime(83000),EndTime(060000);
var : ma10(0),ma20(0) ;
Var : N1(0),dayPl(0),당일수익(0);
var : Tcond(false),Xcond(false);
IF Endtime > starttime Then
SetStopEndofday(Endtime);
Else
{
if sDate != sDate[1] Then
SetStopEndofday(Endtime);
}
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
{
IF Endtime <= starttime Then
{
SetStopEndofday(0);
}
Tcond = true;
Xcond = False;
N1 = NetProfit;
}
2.
당일수익 = PriceScale*당일수익틱수;
daypl = NetProfit-N1;
if TotalTrades > TotalTrades[1] then
{
if daypl >= 당일수익 Then
Xcond = true;
if (IsExitName("dbp",1) == true or
IsExitName("dsp",1) == true) then
Xcond = true;
}
ma10 = ma(c,10);
ma20 = ma(c,20);
if Xcond == false and Tcond == true then
{
if marketposition <= 0 then
{
if MA10 > MA20 then
buy("b",atlimit,C,1) ;
}
if marketposition >= 0 then
{
if MA10 < MA20 then
sell("s",atlimit,C,1) ;
}
}
if MarketPosition == 1 then
{
ExitLong("dbp",atlimit,EntryPrice+((당일수익-daypl)/CurrentContracts));
}
if MarketPosition == -1 then{
ExitShort("dsp",atlimit,EntryPrice-((당일수익-daypl)/CurrentContracts));
}
setstopprofittarget(pt*pricescale,pointstop);
setstoploss(sl*pricescale,pointstop);
2025-01-09
571
글번호 187067
답변완료
수식 확인 부탁드립니다.
input : Price(2465);
if CrossUp(C,Price) Then
buy();
SetStopEndofday(151500);
안녕하십니까
특정가격 2465원을 상향돌파하면 매수하는 식으로 작성해주셨는데
실제 매매에서 3분봉에 적용해보니 2465원을 상향돌파 후 3분봉이 완성되는 시점에
매수주문이 나가는데
지정 가격에 도달 했을경우 주문이 바로 나갈수 있게 수정가능 할까요?
그리고 가능하다면 원하는 가격에 매수주문을 넣을수 있게 부탁드립니다.
(예를들어 감시가격:2465 매수주문가격 : 2470)
잘 부탁드립니다.
감사합니다.
2025-01-09
588
글번호 187066
답변완료
매수 후 5일 뒤 종가 매도 문의드립니다
안녕하세요.
# 매수 진입
if condition1 and condition2 and condition3 and condition4 and condition5 and condition6 then {
buy();
매수후경과일 = 0; # 매수 시 0으로 초기화
}
# 매도 조건: 매수 후 5번째 일봉 종가 매도
if MarketPosition == 1 and 매수후경과일 == 4 then {
sell();
}
# 매수 후 경과일 계산
if MarketPosition == 1 then {
매수후경과일 = 매수후경과일 + 1;
} else {
매수후경과일 = 0; # 포지션 청산 시 0으로 초기화
이렇게 했을때 시스템 성능 보고서의 거래내역을 보면,
대부분은 봉 개수가 5개로 되어 있는데,
일부는 봉 개수가 6개, 8개, 9개 짜리도 나옵니다.
9일 뒤에 매도가 되는 경우도 발생한다는 뜻인데요.
어떤게 잘못 된거지 잘 모르겠습니다.
매수 후 5일 뒤 종가에 매도할 수 있는 수식 작성 부탁드립니다!
2025-01-09
560
글번호 187065
답변완료
검색식 부탁 드려요
1. 보조지표 시그마 (20) 가 "-2 이하" 에서 내려가다가 상승으로 돌아서는
첫양봉 검색식 부탁드립니다.
2025-01-09
485
글번호 187064
살빼고싶다 님에 의해서 삭제되었습니다.
2025-01-09
67
글번호 187063
답변완료
피보30분 130 10 30
input:length(5),a틱(30),b틱(30),c틱(5);
Var:j(0),lastHiVal(0),lastLoVal(0),sBar(0),eBar(0),TL1(0),Text1(0),process(0),T(0);
Array:HH[10,2](0),LL[10,2](0);
input : StartTime(100000),EndTime(50000);
var : Tcond(false);
IF Endtime > starttime Then
SetStopEndofday(Endtime);
Else
{
if sDate != sDate[1] Then
SetStopEndofday(Endtime);
}
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 Endtime <= starttime Then
{
SetStopEndofday(0);
}
}
process = 0;
If Highest(H,length) == H and lastHiVal <> H and Lowest(L,length) == L and lastLoVal <> L Then
{
If LL[1,1] > L Then process = -1;
If HH[1,1] < H Then process = 1;
}
Else If Highest(H,length) == H and lastHiVal <> H Then process = 1;
Else If Lowest(L,length) == L and lastLoVal <> L Then process = -1;
If process == 1 Then
{
T = 1;
lastHiVal = H;
If HH[1,2] < LL[1,2] Then
{
For j = 10 DownTo 2
{
HH[j,1] = HH[j-1,1];
HH[j,2] = HH[j-1,2];
}
}
If HH[1,2] < LL[1,2] or HH[1,1] < H Then
{
HH[1,1] = H;
HH[1,2] = Index;
sBar = Index - LL[1,2];
eBar = 0;
If TL_GetBeginDate(TL1) == sDate[sBar] and TL_GetBeginTime(TL1) == sTime[sBar] Then
{
TL_Delete(TL1);
Text_Delete(Text1);
}
if LL[1,1] > 0 Then
{
TL1 = TL_New(sDate[sBar],sTime[sBar],LL[1,1],sDate[eBar],sTime[eBar],HH[1,1]);
Text1 = Text_New(sDate[eBar],sTime[eBar],HH[1,1],"+"+NumToStr(abs(HH[1,1]-LL[1,1])/PriceScale,0));
Text_SetStyle(Text1, 2, 1);
}
Else
{
Text_Delete(text1);
Text1 = Text_New(sDate[eBar],sTime[eBar],HH[1,1],"+"+NumToStr(abs(HH[1,1]-LL[1,1])/PriceScale,2));
Text_SetStyle(Text1, 2, 1);
}
Text_SetStyle(Text1, 2, 1);
}
if MarketPosition <= 0 and
HH[2,1] >= LL[2,1]+PriceScale*a틱 and
LL[1,1] <= HH[2,1]-PriceScale*b틱 and
Tcond == true Then
Buy("b",AtStop,HH[2,1]+PriceScale*c틱);
}
If process == -1 Then
{
T = -1;
lastLoVal = L;
If LL[1,2] < HH[1,2] Then
{
For j = 10 DownTo 2
{
LL[j,1] = LL[j-1,1];
LL[j,2] = LL[j-1,2];
}
}
If LL[1,2] < HH[1,2] or LL[1,1] > L Then
{
LL[1,1] = L;
LL[1,2] = Index;
sBar = Index - HH[1,2];
eBar = 0;
If TL_GetBeginDate(TL1) == sDate[sBar] and TL_GetBeginTime(TL1) == sTime[sBar] Then
{
TL_Delete(TL1);
Text_Delete(Text1);
}
if HH[1,1] > 0 Then
{
TL1 = TL_New(sDate[sBar],sTime[sBar],HH[1,1],sDate[eBar],sTime[eBar],LL[1,1]);
Text1 = Text_New(sDate[eBar],sTime[eBar],LL[1,1],"-"+NumToStr(abs(HH[1,1]-LL[1,1])/PriceScale,0));
Text_SetStyle(Text1, 2, 0);
}
Else
{
Text_Delete(text1);
Text1 = Text_New(sDate[eBar],sTime[eBar],LL[1,1],"-"+NumToStr(abs(HH[1,1]-LL[1,1])/PriceScale,0));
Text_SetStyle(Text1, 2, 0);
}
}
if MarketPosition >= 0 and
LL[2,1] <= HH[2,1]-PriceScale*a틱 and
HH[1,1] >= LL[2,1]+PriceScale*b틱 and
Tcond == true Then
Sell("s",AtStop,LL[2,1]-PriceScale*c틱);
}
if MarketPosition == 1 and IsEntryName("b") == true Then
Sell("bs",AtStop,EntryPrice-PriceScale*20);
if MarketPosition == -1 and IsEntryName("s") == true Then
Buy("sb",AtStop,EntryPrice+PriceScale*20);
2025-01-12
594
글번호 187061
cntbs 님에 의해서 삭제되었습니다.
2025-01-09
0
글번호 187050
답변완료
지표 부탁드립니다
1봉전에서 DI+ 가 DI- 상향 돌파했을경우의 신호수식 부탁드립니다
만약 전날 종가에서 돌파했을경우는
장 시작 첫봉에서 나타나게 부탁드립니다.
2025-01-09
557
글번호 187039