커뮤니티
예스랭귀지 Q&A
답변완료
[공지] 예스랭귀지 AI 어시스턴트, '예스나 AI' 출시 및 무료 체험 안내
안녕하세요, 예스스탁 입니다.복잡한 수식 공부 없이 여러분의 아이디어를 말하면 시스템 트레이딩 언어 예스랭귀지로 작성해주는 서비스예스나 AI(YesNa AI)가 출시되었습니다.지금 예스나 AI를 직접 경험해 보실 수 있도록 20크레딧(질문권 20회)를 무료로 증정해 드리고 있습니다.바로 여러분의 아이디어를 코드로 변환해보세요.--------------------------------------------------🚀 YesNa AI 핵심 기능- 지표식/전략식/종목검색식 생성: 자연어로 요청하면 예스랭귀지 문법에 맞는 코드를 작성합니다.- 종목검색식 변환 지원: K증권의 종목 검색식을 예스랭귀지로 변환 지원합니다.- 컴파일 검증: 작성된 코드가 실행 가능한지 컴파일러를 통해 문법 검증을 거쳐 결과물을 제공합니다.상세한 서비스 개요 및 활용 방법은 [서비스 소개 페이지]에서 확인하실 수 있습니다.▶ 서비스 소개 페이지: 바로가기서비스 사용 유의사항 및 결제 환불정책은 [이용약관]을 참고 부탁드립니다.▶ 서비스 이용약관: 바로가기💬 이용 문의사용 중 문의사항은 [프로그램 사용법 Q&A] 게시판에서 [예스나 AI] 카테고리를 설정 후 문의해 주시면 상세히 안내해 드리겠습니다.--------------------------------------------------앞으로도 AI를 활용한 다양한 트레이딩 기능들을 지속적으로 선보일 예정입니다.많은 관심과 기대 부탁드립니다.
2026-02-27
3414
글번호 230811
답변완료
해외선물 유로 수익 계산법
해외선물 유로FX 같은경우 수익과 손절을 정하려하는데 어떻게 계산해야할지 모르겠어요.
1000틱이면 몇 PT 인가요? 그리구 0.12080 PT는 몇틱인지요? 좀 쉽게 계산할수 있는 방법좀 알려주세요
2020-04-15
554
글번호 137947
답변완료
문의
선물 5분봉
별첨파일 1은 손절 1.00 인데 1.90 청산된 경우입니다
별첨파일 2는 손절 0.80 인데 1.45 청산된 경우입니다.
1. stop주문이므로 손절가격으로 청산되야 하는데 예외가 발생되는 이유가 궁금합니다.
2.
진입시간과 진입제한시간에 대하여
2016년 7월 31일 이전과 2016년 8월 01일 이후 2개로 구분하여 한 번에 시뮬레이션하고 싶습니다.
input : 진입시간(090000),진입제한시간(132000);
var : tcond(false);
if (sdate != sdate[1] and stime >= 진입시간) or
(sdate == sdate[1] and stime >= 진입시간 and stime[1] < 진입시간) Then
Tcond = true;
if (sdate != sdate[1] and stime >= 진입제한시간) or
(sdate == sdate[1] and stime >= 진입제한시간 and stime[1] < 진입제한시간) Then
Tcond = false;
if 진입수식 and Tcond == true then
****************************************************************************************
input : 고가갱신수2(1),고가갱신수3(1),저가갱신수2(1),저가갱신수3(1);
input : uppyra검증1(0),상승pyra1(0),상승N1(0);
input : up손절1(1.00),up익절1(99999),upTR1(1.00);
input : uppyra검증2(0),상승pyra2(0),상승N2(0);
input : up손절2(0.80),up익절2(99999),upTR2(1.00);
input : uppyra검증3(0),상승pyra3(0),상승N3(0);
input : up손절3(0.60),up익절3(99999),upTR3(1.00);
input : dnpyra검증1(0),하락pyra1(0),하락N1(0);
input : dn손절1(1.00),dn익절1(99999),dnTR1(1.00);
input : dnpyra검증2(0),하락pyra2(0),하락N2(0);
input : dn손절2(0.80),dn익절2(99999),dnTR2(1.00);
input : dnpyra검증3(0),하락pyra3(0),하락N3(0);
input : dn손절3(0.60),dn익절3(99999),dnTR3(1.00);
if dayindex == 0 and MarketPosition == 0 Then{
Condition1 = false;
if C > O Then{
buy("b1",AtMarket);
Condition1 = true;
}
if c < O Then{
sell("s1",AtMarket);
Condition1 = true;
}
}
if MarketPosition == 0 and #현재 무포지션이고
EntryDate(1) == sdate and #직전거래가 오늘 발생한 거래이고
MarketPosition(1) == 1 and #직전거래가 매수거래이고
countif(DayHigh(0) != DayHigh(0)[1],BarsSinceExit(1)) >= 고가갱신수2 Then #청산이후 당일고가 갱신이 n회이상 있었으면
buy("b2");
if MarketPosition == 0 and #현재 무포지션이고
EntryDate(1) == sdate and #직전거래가 오늘 발생한 거래이고
MarketPosition(1) == -1 and #직전거래가 매도거래이고
countif(DayHigh(0) != DayHigh(0)[1],BarsSinceExit(1)) >= 고가갱신수3 Then #청산이후 당일고가 갱신이 n회이상 있었으면
buy("b3");
if MarketPosition == 0 and #현재 무포지션이고
EntryDate(1) == sdate and #직전거래가 오늘 발생한 거래이고
MarketPosition(1) == -1 and #직전거래가 매도거래이고
countif(DayLow(0) != DayLow(0)[1],BarsSinceExit(1)) >= 저가갱신수2 Then #청산이후 당일저가 갱신이 n회이상 있었으면
sell("s2");
if MarketPosition == 0 and #현재 무포지션이고
EntryDate(1) == sdate and #직전거래가 오늘 발생한 거래이고
MarketPosition(1) == 1 and #직전거래가 매수거래이고
countif(DayLow(0) != DayLow(0)[1],BarsSinceExit(1)) >= 저가갱신수3 Then #청산이후 당일저가 갱신이 n회이상 있었으면
sell("s3");
if MarketPosition == 1 and IsEntryName("b1") == true Then
{
if C >= EntryPrice+uppyra검증1 and MaxContracts < 상승N1 Then
buy("bb1",AtStop,LatestEntryPrice(0)+상승Pyra1);
ExitLong("bl1",AtStop,EntryPrice-pointstop*up손절1);
Exitlong("bp1",AtLimit,EntryPrice+pointstop*up익절1);
Exitlong("btr1",AtStop,Highest(h,BarsSinceEntry)-pointstop*upTR1);
}
if MarketPosition == 1 and IsEntryName("b2") == true then
{
if C >= EntryPrice+uppyra검증2 and MaxContracts < 상승N2 Then
buy("bb2",AtStop,LatestEntryPrice(0)+상승Pyra2);
ExitLong("bl2",AtStop,EntryPrice-PointStop*up손절2);
Exitlong("bp2",AtLimit,EntryPrice+PointStop*up익절2);
Exitlong("btr2",AtStop,highest(h,BarsSinceEntry)-PointStop*upTR2);
}
if MarketPosition == 1 and IsEntryName("b3") == true then
{
if C >= EntryPrice+uppyra검증3 and MaxContracts < 상승N3 Then
buy("bb3",AtStop,LatestEntryPrice(0)+상승Pyra3);
ExitLong("bl3",AtStop,EntryPrice-PointStop*up손절3);
Exitlong("bp3",AtLimit,EntryPrice+PointStop*up익절3);
Exitlong("btr3",AtStop,highest(h,BarsSinceEntry)-PointStop*upTR3);
}
if MarketPosition == -1 and IsEntryName("s1") == true Then
{
if C <= EntryPrice-dnpyra검증1 and MaxContracts < 하락N1 Then
sell("ss1",AtStop,LatestEntryPrice(0)-하락Pyra1);
ExitShort("sl1",AtStop,EntryPrice+PointStop*dn손절1);
ExitShort("sp1",AtLimit,EntryPrice-PointStop*dn익절1);
ExitShort("str1",AtStop,Lowest(l,BarsSinceEntry)+PointStop*dnTR1);
}
if MarketPosition == -1 and IsEntryName("s2") == true Then
{
if C <= EntryPrice-dnpyra검증2 and MaxContracts < 하락N2 Then
sell("ss2",AtStop,LatestEntryPrice(0)-하락Pyra2);
ExitShort("sl2",AtStop,EntryPrice+PointStop*dn손절2);
ExitShort("sp2",AtLimit,EntryPrice-PointStop*dn익절2);
ExitShort("str2",AtStop,Lowest(l,BarsSinceEntry)+PointStop*dnTR2);
}
if MarketPosition == -1 and IsEntryName("s3") == true Then
{
if C <= EntryPrice-dnpyra검증3 and MaxContracts < 하락N3 Then
sell("ss3",AtStop,LatestEntryPrice(0)-하락Pyra3);
ExitShort("sl3",AtStop,EntryPrice+PointStop*dn손절3);
ExitShort("sp3",AtLimit,EntryPrice-PointStop*dn익절3);
ExitShort("str3",AtStop,Lowest(l,BarsSinceEntry)+PointStop*dnTR3);
}
2020-04-16
653
글번호 137946
doilzul 님에 의해서 삭제되었습니다.
2020-04-15
2
글번호 137945
답변완료
부탁 드립니다.
.
2020-04-16
539
글번호 137944
답변완료
매수 수식 문의
안녕하세요
분봉 상태에서 코스닥 지수가 일정범위를 돌파하면 주식 종목을 매수하려고 합니다
문제는 시뮬레이션시 선물에서는 매수가 되나
주식 종목에서는 매수가 전혀 일어나지 않습니다
(data1은 ETF종목이고 data2는 코스닥지수 입니다)
무엇을 수정해야 되는지요?
감사합니다
if data2(stime >= 100000 and crossup(C,(dayopen+(dayhigh(1)-daylow(1))*0.5))) Then
buy("L");
2020-04-15
520
글번호 137943
새벽에 님에 의해서 삭제되었습니다.
2020-04-16
8
글번호 137942
답변완료
부탁드립니다.
항상 감사드립니다.
1. 아래의 식에서 R3의 값이 40 이하가 되면 70 까지 도달 할때까지
■가 포함된 신호로 표현하고 싶습니다.
단순히 40~70 사이 값에서 ■ 포함 표시가 아니고,
R3의 값이 40 이하가 되면 ■포함(B1■) 되기 시작되어, 70 도달 전까지 ■포함 되고,
다시 40 이하가 되기 전까지는 일반으로(B1) 표시가 될수 있도록 요청을 드립니다.
R3 60 40 20 30 50 70 90 70 50 40 20
표시 B B■ B■ B■ B■ B B B B B■ B■
2. ###카운트3 에서 0.03 의 값을 전략창 전체 진입수 조건에 따라 변경하고 싶습니다.
300개 <= 전체 진입수 일때는 0.02
200개 <= 전체 진입수 < 300개 일때는 0.04
전체 진입수 < 200개 일때는 0.05
### 부분은 작성을 해본 수식입니다. 수정해 주시면 됩니다. 감사합니다.
input : 손절(20),익절(15),익절하락(3);
input : P1(30), P2(120), p3(240);
input : StartTime(090000),EndTime(050000);
var : tt(0),tx(0),X(false),tx1(0),cnt(0),sum(0);
var: Tcond(false),ht(0),lcnt(0),trcnt(0),R(-1);
Array : XX[200](-1);
var1 = ma(C, P1);
var2 = ma(C, P2);
var3 = ma(C, P3);
if (sdate != sdate[1] and stime >= StartTime) or
(sdate == sdate[1] and stime >= StartTime and stime[1] < StartTime) Then
{
Tcond = true;
tt = 0;
X = false;
}
if Tcond == true then
{
if marketposition == 0 and crossup(var1,var2) Then {
if Condition3 == true and R3 < 50 then #### <-- 수정요청
buy("B1■");
Else
buy("B1");
}
if marketposition == 0 and crossdown(var1,var2) Then {
if Condition3 == true and R3 < 50 then #### <-- 수정요청
sell("S1■");
Else
sell("S1");
}
if marketposition == 0 and crossup(var2,var3) and var3[1] < var3 Then {
if Condition3 == true and R3 < 50 then #### <-- 수정요청
buy("B2■");
Else
buy("B2");
}
if marketposition == 0 and crossdown(var3,var4) and var3[1] > var3 Then {
if Condition3 == true and R3 < 50 then #### <-- 수정요청
sell("S2■");
Else
sell("S2");
}
## 청산
if MarketPosition == 1 then
{
SetStopTrailing(익절하락,익절,PointStop);
SetStopLoss(손절,PointStop);
}
if MarketPosition == -1 Then
{
SetStopTrailing(익절하락,익절,PointStop);
SetStopLoss(손절,PointStop);
}
}
## 카운트3
var : tx3(0),cnt3(0),sum3(0),lcnt3(0),trcnt3(0),R3(-1), TR3(0), GR3(0);
Array : XX3[200](-1);
if TotalTrades > TotalTrades[1] then
{
if IsExitName("StopLoss",1) == true then
{
lcnt3 = lcnt3+1;
XX3[0] = 0;
for cnt3 = 1 to 199
{
XX3[cnt3] = XX3[cnt3-1][1];
}
if Floor((trcnt3+lcnt3)*(0.03)) > 1 then
{
sum3 = 0;
for cnt3 = 0 to Floor((trcnt3+lcnt3)*(0.03))-1
{
if XX3[cnt3] == 1 Then
sum3 = sum3 + 1;
}
R3 = sum3/Floor((trcnt3+lcnt3)*(0.03))*100;
}
}
if IsExitName("StopTrailing",1) == true then
{
trcnt3 = trcnt3+1;
XX3[0] = 1;
for cnt3 = 1 to 199
{
XX3[cnt3] = XX3[cnt3-1][1];
}
if Floor((trcnt3+lcnt3)*(0.03)) > 1 then
{
sum3 = 0;
for cnt3 = 0 to Floor((trcnt3+lcnt3)*(0.03))-1
{
if XX3[cnt3] == 1 Then
sum3 = sum3+1;
}
R3 = sum3/Floor((trcnt3+lcnt3)*(0.03))*100;
}
}
TR3 = trcnt3/(trcnt3+lcnt3)*100 ;
}
### 수정요청↓
if R3 > 40 Then
{
Condition3 = false;
}
else
{
Condition3 = true;
}
if Condition3 == true and R3 >= 70 then
Condition3 = false;
### 수정요청↑
Text_Delete(tx3);
tx3 = Text_New(NextBarSdate,NextBarStime,H,NumToStr(TR3,1)+NewLine+NumToStr(R3,1));
Text_SetSize(tx3,15);
Text_Setstyle(tx3,2,20);
if (sdate != sdate[1] and stime >= EndTime) or
(sdate == sdate[1] and stime >= EndTime and stime[1] < EndTime) Then
{
Tcond = false;
if MarketPosition == 1 Then
{
ExitLong("BE6");
}
if MarketPosition == -1 Then
{
ExitShort("SE6");
}
}
2020-04-15
490
글번호 137941
답변완료
왜 안되는지 봐주시면 감사하겠습니다.
Inputs: Price((H+L)/2), alpha(.07);
Vars: Smooth(0), ITrend(0), Trigger(0);
ITrend = (alpha - alpha*alpha/4)*Price + .5*alpha*alpha*Price[1] - (alpha - .75*alpha*alpha)*Price[2] + 2 *(1 - alpha)*ITrend[1] - (1 - alpha) *(1 - alpha)*Itrend[2];
If currentbar < 7 then ITrend = (Price + 2*Price[1] + Price[2]) / 4;
Trigger = 2*Itrend - ITrend[2];
# 매수/매도청산
If CrossUP(Trigger, ITrend) Then Buy();
# 매도/매수청산
If CrossDown(Trigger, ITrend) Then Sell();
ㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡ
지표로 만들면 정상적으로 출력이 되는데 단순하게 매수매도만 붙였을뿐인데
시스템으로는 국내선물에서 작동을 안하네요 문제를 봐주시면 감사하겟습니다.
2020-04-14
507
글번호 137940
답변완료
장마감후 조회에 대해서
장마감후(18시) 조회하는 거래량, 거래대금의 데이터는 시간외 물량을 포함한 값인가요??
수고하세요~~
2020-04-14
516
글번호 137937