커뮤니티
예스랭귀지 Q&A
답변완료
[공지] 예스랭귀지 AI 어시스턴트, '예스나 AI' 출시 및 무료 체험 안내
안녕하세요, 예스스탁 입니다.복잡한 수식 공부 없이 여러분의 아이디어를 말하면 시스템 트레이딩 언어 예스랭귀지로 작성해주는 서비스예스나 AI(YesNa AI)가 출시되었습니다.지금 예스나 AI를 직접 경험해 보실 수 있도록 20크레딧(질문권 20회)를 무료로 증정해 드리고 있습니다.바로 여러분의 아이디어를 코드로 변환해보세요.--------------------------------------------------🚀 YesNa AI 핵심 기능- 지표식/전략식/종목검색식 생성: 자연어로 요청하면 예스랭귀지 문법에 맞는 코드를 작성합니다.- 종목검색식 변환 지원: K증권의 종목 검색식을 예스랭귀지로 변환 지원합니다.- 컴파일 검증: 작성된 코드가 실행 가능한지 컴파일러를 통해 문법 검증을 거쳐 결과물을 제공합니다.상세한 서비스 개요 및 활용 방법은 [서비스 소개 페이지]에서 확인하실 수 있습니다.▶ 서비스 소개 페이지: 바로가기서비스 사용 유의사항 및 결제 환불정책은 [이용약관]을 참고 부탁드립니다.▶ 서비스 이용약관: 바로가기💬 이용 문의사용 중 문의사항은 [프로그램 사용법 Q&A] 게시판에서 [예스나 AI] 카테고리를 설정 후 문의해 주시면 상세히 안내해 드리겠습니다.--------------------------------------------------앞으로도 AI를 활용한 다양한 트레이딩 기능들을 지속적으로 선보일 예정입니다.많은 관심과 기대 부탁드립니다.
2026-02-27
5459
글번호 230811
답변완료
확인 부탁드립니다.
안녕하세요
아래 수식을 다시한번 확인 부탁드립니다.
글로 표현하자니 제가 잘 표현하지 못한것 같습니다.
매도(매수)신호 1봉의 3등분이 아니라 매도신호봉과 매수신호봉까지의 고가,중심,저가 입니다.
감사합니다
var : mav1(0),mav2(0),mav3(0),T1(0),T2(0),T3(0);
var : bTL1(0),bTL2(0),bTL3(0);
var : sTL1(0),sTL2(0),sTL3(0);
mav1 = ma(c,5);
mav2 = ma(c,20);
mav3 = ma(c,60);
if mav1 > mav1[1] Then
T1 = 1;
if mav1 < mav1[1] Then
T1 = -1;
if T1 == 1 and T1[1] != 1 Then
var1 = 0;
// if T1 == 1 and C > O and (C+O)/2 >= mav1 and mav2 > mav2[1] and mav3 > mav3[1] Then{ 60이평포함
if T1 == 1 and C > O and (C+O)/2 >= mav1 and mav2 > mav2[1] and mav1 > mav2 Then
{
var1 = var1+1;
if MarketPosition <= 0 and var1 == 1 Then
{
buy("5매수");
value1 = H;
value2 = (H+L)/2;
value3 = L;
TL_Delete(bTL1);
TL_Delete(bTL2);
TL_Delete(bTL3);
bTL1 = TL_New(sDate,sTime,value1,NextBarSdate,NextBarStime,value1);
bTL2 = TL_New(sDate,sTime,value2,NextBarSdate,NextBarStime,value2);
bTL3 = TL_New(sDate,sTime,value3,NextBarSdate,NextBarStime,value3);
TL_SetExtRight(bTL1,true);
TL_SetExtRight(bTL2,true);
TL_SetExtRight(bTL3,true);
TL_SetColor(bTL1,Red);
TL_SetColor(bTL2,Red);
TL_SetColor(bTL3,Red);
}
}
if T1 == -1 and T1[1] != -1 Then
var2 = 0;
// if T1 == -1 and C < O and (C+O)/2 <= mav1 and mav2 < mav2[1] and mav3 < mav3[1] Then{ 60이평포함
if T1 == -1 and C < O and (C+O)/2 <= mav1 and mav2 < mav2[1] and mav1 < mav2 Then
{
var2 = var2+1;
if MarketPosition >= 0 and var2 == 1 Then
{
sell("5매도");
value4 = H;
value5 = (H+L)/2;
value6 = L;
TL_Delete(sTL1);
TL_Delete(sTL2);
TL_Delete(sTL3);
sTL1 = TL_New(sDate,sTime,value4,NextBarSdate,NextBarStime,value4);
sTL2 = TL_New(sDate,sTime,value5,NextBarSdate,NextBarStime,value5);
sTL3 = TL_New(sDate,sTime,value6,NextBarSdate,NextBarStime,value6);
TL_SetExtRight(sTL1,true);
TL_SetExtRight(sTL2,true);
TL_SetExtRight(sTL3,true);
TL_SetColor(sTL1,Blue);
TL_SetColor(sTL2,Blue);
TL_SetColor(sTL3,Blue);
}
}
2024-02-15
872
글번호 176665
답변완료
문의드립니다.
다음 수식을 종목검색식으로 부탁드립니다.
기준봉조건 =
C > C(1) * 종가등락률 &&
H > C(1) * 고가등락률 &&
(V > 거래량기준 or 거래대금 > 거래대금기준) &&
C > O;
기준봉V = Valuewhen(1, 기준봉조건, V);
Sv = sum(V);
K1 = Sv - Valuewhen(1, 기준봉조건, Sv(1)) - 기준봉V;
K = Valuewhen(1, 기준봉조건, V);
CrossUp(k, k1)
2024-02-15
761
글번호 176659
답변완료
항셍 분봉 관련 문의
1. 항셍 3분봉을 예로 들면 오전 10시12분으로 표기되는 봉에 동시호가 체결가가 차트에 점으로 찍히고, (240215 기준 15918)
다음 봉이 10시15분 봉으로 표기되어 시/고/저/종가가 나오는데요,
(240215 기준 시/고/저/종가 15927/15927/15757/15806)
1-1. 수식에 dayOpen은 15918원일까요? 15927원일까요?
1-2. dayindex==0 의 종가는 15918원일까요? 15806원일까요?
2. 제가 2003년도 예스트레이더로 작업하면서 사용자함수를 많이 만들었었는데 하도 오래되서 기억이 잘 안나는 부분이 있어서 문의드려요.
ABC=accumN(iff(L<dayLow(1) && dayindex()==2,1,0),dayindex()+1);
3분봉으로 설명을 하면,
전일 저가보다 dayindex()==2의 저가[10시18분봉_10시18분~21분 거래 결과 (또는 21분봉_10시21분~24분 거래결과)]가 작으면 1, 크면 0
-> 여기까지는 알겠는데
뒤에 dayindex()+1 -->> 이 부분은 어떻게 이해하면 될까요?
늘 감사합니다^^
2024-02-15
718
글번호 176648
답변완료
나스닥 시뮬레이션을 위한 썸머타임, 거래시간, 매매횟수
안녕하세요.
지난번 항셍 거래시간 수식 관련 명쾌한 답변 주셔서 많은 진척이 있었습니다.
깊은 감사드립니다!^^
아래의 조건으로 나스닥 수식 적용 중인데 막히는 부분이 있어 문의 올립니다!
- 3분봉
- 당일청산
- 5년이상 시뮬레이션 예정
수식 문의사항
- 매년 썸머타임 적용 수식
- 거래시간 23시30분~07시
썸머타임 기간에는 (22시30분~06시)
- 매수진입, 매도진입 1일 각 3회까지만 허용
위 수식만 있으면 진입,청산 대입하여 시뮬레이션 돌릴 수 있는 상황입니다!
항상 감사합니다^^
P.S : 회신 주실 때 각 수식에 대해 간단하게 설명해주시면 나중에 조금 변경하거나 응용을 제 스스로 하는데 많은 도움이 될 것 같아요^^
2024-02-15
783
글번호 176647
답변완료
문의 드립니다.
아래 식에서 MACD를 추가하고자 합니다.
매수 때 30분봉에서 MACD 12 26 9 선이 시그널선 위에 있을 때 아래 식을 적용하여 매수
매도 때 30분봉
에서 MACD 12 26 9 선이 시그널선 아래에 있을 때 아래 식을 적용하여 매도
부탁드립니다.
input : ntime(30);
var : S1(0),D1(0),TM(0),TF(0),OO(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%ntime;
if Bdate != Bdate[1] or
(Bdate == Bdate[1] and ntime > 1 and TF < TF[1]) or
(Bdate == Bdate[1] and ntime > 1 and TM >= TM[1]+ntime) or
(Bdate == Bdate[1] and ntime == 1 and TM > TM[1]) Then
{
OO = O;
}
if MarketPosition <= 0 and OO > 0 and C > OO and C > O and C[1] < O[1] Then
Buy();
if MarketPosition == 1 and C < O Then
ExitLong();
}
-------------------------------------------------------------------------------
input : ntime(30);
var : S1(0),D1(0),TM(0),TF(0),OO(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%ntime;
if Bdate != Bdate[1] or
(Bdate == Bdate[1] and ntime > 1 and TF < TF[1]) or
(Bdate == Bdate[1] and ntime > 1 and TM >= TM[1]+ntime) or
(Bdate == Bdate[1] and ntime == 1 and TM > TM[1]) Then
{
OO = O;
}
if MarketPosition >= 0 and OO > 0 and C < OO and C < O and C[1] > O[1] Then
Sell();
if MarketPosition == -1 and C > O Then
ExitShort();
}
2024-02-15
810
글번호 176646
답변완료
옵션 차익 청산
성실한 답변 늘 감사드립니다.
콜 행사가 360 를 3.0을 1개 매수
콜 행사가 362.5를 2.5을 1개 매도
두 행사가 차익이 100,000원발생 했을때 자동청산 수식 부탁드립니다.
2024-02-15
810
글번호 176644
답변완료
문의드립니다:)
안녕하세요:)
답변해주신 시스템에 대해 추가하고 싶은 부분이 있어 문의드립니다.
역사적 신고가나 6년 신고가 가격을 돌파시 진입을 하게 되는 전략인데요:)
제주반도체가 1월25일 진입 조건에 해당하긴 했는데 신고가 갱신이 안된 것인지 전일 신고가 돌파시 진입을 하게 되어서요
해당 부분이 개선될 수 있는지 문의드립니다
-----------------------------------------------------------------
input : 금액(2000000);
var : HisH(0,Data2),cnt(0),YH6(0,Data2),trade(False),dm(0,Data1),entry(0);
var : Rebuy(False,Data1),NegCnt(0,Data1);
Array : YH[20](0,Data2);
#역사적 신고가(참조데이터의 전체봉 중 최고가)
if HisH == 0 or (HisH > 0 and Data2(H) > HisH) Then
HisH = data2(H);
#연간 최고가 계산
if data2(Bdate > Bdate[1]+1000) Then
{
For cnt = 19 DownTo 1
{
YH[cnt] = YH[cnt-1];
}
YH[0] = Data2(H);
}
if YH[0] > 0 and Data2(H) > YH[0] Then
YH[0] = Data2(H);
if Bdate != Bdate[1] Then
{
trade = true;
entry = 0;
dm = 0;
}
dm = dm + m;
if (MarketPosition != 0 and MarketPosition != MarketPosition[1]) or
(MarketPosition == MarketPosition[1] and TotalTrades > TotalTrades[1]) Then
entry = entry+1;
if TotalTrades > TotalTrades[1] Then
{
if IsExitName("bl1",1) == true or IsExitName("bl2",1) == true Then
trade = False;
ReBuy = False;
NegCnt = 0;
}
if Bdate == Bdate[1] Then
{
if h > DayHigh(0)[1] Then
{
rebuy = true;
NegCnt = 0;
}
if rebuy == true and C < O Then
NegCnt = NegCnt+1;
}
if MarketPosition == 0 and trade == true and sTime >= 91000 and sTime < 150000 and dm >= 80000000000 Then
{
#역사적 신고가+1틱이상이면 매수
if entry == 0 Then
Buy("b1",AtStop,HisH+PriceScale*1,Floor(금액/max(NextBarOpen,HisH+PriceScale*1)));
if YH[5] > 0 and entry == 0 Then
{
#6년 최고가 계산
YH6 = 0;
For cnt = 0 to 5
{
if YH6 == 0 or (YH6 > 0 and YH[cnt] > YH6) Then
YH6 = YH[cnt];
}
#6년 최고가 +1틱이면 매수
if YH6 > 0 Then
Buy("b2",AtStop,YH6+PriceScale*1,Floor(금액/max(NextBarOpen,YH6+PriceScale*1)));
}
if entry >= 1 and reBuy == true and NegCnt >= 3 Then
{
Buy("b3",AtStop,DayHigh+PriceScale*1,Floor(금액/max(NextBarOpen,DayHigh+PriceScale*1)));
}
}
if MarketPosition == 1 Then
{
if IsEntryName("b1") == true Then
var1 = HisH[BarsSinceEntry];
if IsEntryName("b2") == true Then
var1 = YH6[BarsSinceEntry];
if IsEntryName("b3") == true Then
var1 = dayhigh[BarsSinceEntry];
if CurrentContracts == MaxContracts Then
ExitLong("bx1",AtLimit,var1*1.02,"",Floor(MaxContracts*0.5),1);
Else
ExitLong("bx2",AtLimit,var1*1.04);
ExitLong("bl1",AtStop,var1*0.985);
ExitLong("bl2",AtStop,EntryPrice*0.96);
}
2024-02-15
1268
글번호 176642
답변완료
문의 드립니다
input : starttime(140000),endtime(50000),n(30);
var : Tcond(false),hh(0),h1(0),ll(0),l1(0);
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;
hh = h;
ll = l;
h1 = hh[1];
l1 = ll[1];
IF Endtime <= starttime Then
{
SetStopEndofday(0);
}
}
input : 익절틱수(0),손절틱수(50);
if NextBarSdate != sDate Then
{
if NextBarOpen != C Then
{
Buy("b",AtStop,NextBarOpen+PriceScale*5);
}
}
ExitLong("bx",AtMarket);
if NextBarOpen != C Then
{
Buy("b1",AtStop,NextBarOpen+PriceScale*5);
}
ExitLong("bx1",AtMarket);
if NextBarOpen != C Then
{
Buy("b3",AtStop,NextBarOpen+PriceScale*5);
}
ExitLong("bx3",AtMarket);
if NextBarOpen != C Then
{
Buy("b4",AtStop,NextBarOpen+PriceScale*5);
}
ExitLong("bx4",AtMarket);
if NextBarOpen != C Then
{
Buy("b5",AtStop,NextBarOpen+PriceScale*5);
}
ExitLong("bx5",AtMarket);
if NextBarOpen == C Then
{
Buy("b6",AtStop,NextBarOpen+PriceScale*5);
}
ExitLong("bx6",AtMarket);
if NextBarOpen == C Then
{
Buy("b7",AtStop,NextBarOpen+PriceScale*5);
}
ExitLong("bx7",AtMarket);
if NextBarOpen == C Then
{
Buy("b8",AtStop,NextBarOpen+PriceScale*5);
}
ExitLong("bx8",AtMarket);
if NextBarOpen == C Then
{
Buy("b9",AtStop,NextBarOpen+PriceScale*5);
}
ExitLong("bx9",AtMarket);
if NextBarOpen == C Then
{
Buy("b10",AtStop,NextBarOpen+PriceScale*5);
}
ExitLong("bx10",AtMarket);
if NextBarOpen == C Then
{
Buy("b11",AtStop,NextBarOpen+PriceScale*5);
}
ExitLong("bx11",AtMarket);
if NextBarSdate != sDate Then
{
if NextBarOpen != C Then
{
Sell("s",AtStop,NextBarOpen-PriceScale*5);
}
}
ExitShort("sx",AtMarket);
if NextBarOpen != C Then
{
Sell("s1",AtStop,NextBarOpen-PriceScale*5);
}
ExitShort("sx1",AtMarket);
if NextBarOpen != C Then
{
Sell("s3",AtStop,NextBarOpen-PriceScale*5);
}
ExitShort("sx3",AtMarket);
if NextBarOpen != C Then
{
Sell("s4",AtStop,NextBarOpen-PriceScale*5);
}
ExitShort("sx4",AtMarket);
if NextBarOpen != C Then
{
Sell("s5",AtStop,NextBarOpen-PriceScale*5);
}
ExitShort("sx5",AtMarket);
if NextBarOpen == C Then
{
Sell("s6",AtStop,NextBarOpen-PriceScale*5);
}
ExitShort("sx6",AtMarket);
if NextBarOpen == C Then
{
Sell("s7",AtStop,NextBarOpen-PriceScale*5);
}
ExitShort("sx7",AtMarket);
if NextBarOpen == C Then
{
Sell("s8",AtStop,NextBarOpen-PriceScale*5);
}
ExitShort("sx8",AtMarket);
if NextBarOpen == C Then
{
Sell("s9",AtStop,NextBarOpen-PriceScale*5);
}
ExitShort("sx9",AtMarket);
if NextBarOpen == C Then
{
Sell("s10",AtStop,NextBarOpen-PriceScale*5);
}
ExitShort("sx10",AtMarket);
if NextBarOpen == C Then
{
Sell("s11",AtStop,NextBarOpen-PriceScale*5);
}
ExitShort("sx11",AtMarket);
SetStopProfittarget(PriceScale*익절틱수,PointStop);
SetStopLoss(PriceScale*손절틱수,PointStop);
-----------
위 수식어의 매매시간이 14시부터 익일 5시까지이고
매매의 청산싯점도 5시이고 잔고도 없는것으로 보면 정확한지요?
2024-02-15
1129
글번호 176638
답변완료
선물거래식에서 2개의 챠트에 동시 발생한 신호의 청산시간이 다릅니다.
선물거래식에서 2개의 챠트에
각각 동시 발생한 신호의 청산시간이 다릅니다.
한 화면에 2개의 챠트를 띄우고
각각 시스템-01 과 시스템-02를 운영하고 있습니다.
예제 내용을 보시면 아시겠지만
계좌1 운영--시스템-01 과
계좌2 운영--시스템-02 는 반대로 진입합니다.
당연히 익절, 손절은
아래와같이 동일하게 되어 있구요
buy-stocro-01 --> $익절 +0.95 $손절 -0.95
sell-stocro-01--> $익절 +0.95 $손절 -0.95
buy-stocro-02 --> $익절 +1.05 $손절 -2.25
sell-stocro-02--> $익절 +1.05 $손절 -2.25
그런데 2024-02-06일자 성능보고서를 보면
시스템-01, 시스템-02
같은 시간 09:19:35 에 시스템신호 'sell-stocro-02'
가 발생했으나
청산된 시간이
시스템-01 ---> 12:19:54 에
시스템-02 ---> 09:26:20 입니다.
챠트설정 등 뭔가 다르게 설정되어
이렇게 된 것 같은데 무엇을 설정해야 할까요?
2024-02-15
1029
글번호 176637