예스스탁
예스스탁 답변
2020-09-07 18:11:16
안녕하세요
예스스탁입니다.
1-1
Input : 이평1(43),이평2(1);
var : sum(0,Data1),mav1(0,data1),mav2(0,Data1);
var : ii(0,Data1),aa(0,Data1),bb(0,Data1);
sum = Data2(c)+data3(c);
if Data1(Bdate != Bdate[1]) Then
ii = 0;
if Data1(Bdate) == Data2(Bdate) and Data1(Bdate) == Data3(Bdate) Then
ii = ii+1;
if ii < 이평1 Then
{
aa = aa + sum;
mav1 = aa/ii;
}
Else
mav1 = data1(ma(sum,이평1));
if ii < 이평2 Then
{
bb = bb + sum;
mav2 = bb/ii;
}
Else
mav2 = data1(ma(sum,이평2));
if CrossUp(mav1,mav2) and Data2(c) > Data3(c) Then
Buy();
1-2
input:차이(16000);
if Data1(Bdate) == Data2(Bdate) and Data1(Bdate) == data3(bdate) and
data2(c) > data3(c) and data2(c)-data3(c) >= 차이 Then
buy();
2
input:차이(16000);
Var : Year(0),Month(0),ndate1(0),ndate2(0);
var : cnt(0),count1(0),count2(0),count3(0);
var : entry(false),Xdate1(0),Xdate2(0),Xdate3(0);
var : EX(0),EXM(0),cond1(False),cond2(False);
Year = Floor(sDate / 10000)*10000;
month = Floor(FracPortion(sdate/10000)*100);
ndate1 = year+(month*100)+1;
if Month+1 <= 12 Then
ndate2 = year+((month*100)+100)+1;
Else
ndate2 = (year+10000)+100+1;
count1 = 0;
count2 = 0;
Cond1 = false;
Cond2 = false;
for cnt = 0 to 15
{
if dayofweek(ndate1+cnt) == 4 Then
{
count1 = count1+1;
if Cond1 == false and count1 == 2 Then
{
Cond1 = true;
Xdate1 = ndate1+cnt;
}
}
if dayofweek(ndate2+cnt) == 4 Then
{
count2 = count2+1;
if Cond2 == false and count2 == 2 Then
{
Cond2 = true;
Xdate2 = ndate2+cnt;
}
}
}
if sdate <= Xdate1 Then
EX = Xdate1;
Else
Ex = Xdate2;
#만기가 휴일이면 직전 영업일 날짜로 지정
If EX == 20141009 Then
EX = 20141008;
If EX == 20190912 Then
EX = 20190911;
EXM = Floor(FracPortion(EX/10000)*100);
#2. 만기달 만기 주만 거래(만기일 제외)
if month%3 == 0 and Month == EXM and
DateToJulian(sdate) >= DateToJulian(EX)-4 and sdate < EX Then
{
if data2(c) > data3(c) and data2(c)-data3(c) >= 차이 Then
buy();
}
즐거운 하루되세요
> 좌오비우오비 님이 쓴 글입니다.
> 제목 : 문의 2가지
> 문의1)
데이트레이딩
금일 발생한 봉으로만 계산하여 진입할 수 있게 수식을 추가해주세요.
가)
Input : 이평1(43),이평2(1);
var : sum(0,Data1),mav1(0,data1),mav2(0,Data1);
sum = Data2(c)+data3(c);
mav1 = data1(ma(sum,이평1));
mav2 = data1(ma(sum,이평2));
if CrossUp(mav1,mav2) and Data2(c) > Data3(c) Then
Buy();
나)
input:차이(16000);
if data2(c) > data3(c) and data2(c)-data3(c) >= 차이 Then
buy();
문의2)
if c > 0 then buy();
위 진입식과 아래 2번 #2. 만기달 만기 주만 거래(만기일 제외)을 결합해주세요.
제가 해보니 수식 검증에 문제는 없는데 시뮬레이션 결과가 나오지 않습니다.
**********************************************************************************
안녕하세요
예스스탁입니다.
Var : Year(0),Month(0),ndate1(0),ndate2(0);
var : cnt(0),count1(0),count2(0),count3(0);
var : entry(false),Xdate1(0),Xdate2(0),Xdate3(0);
var : EX(0),EXM(0);
Year = Floor(sDate / 10000)*10000;
month = Floor(FracPortion(sdate/10000)*100);
ndate1 = year+(month*100)+1;
if Month+1 <= 12 Then
ndate2 = year+((month*100)+100)+1;
Else
ndate2 = (year+10000)+100+1;
count1 = 0;
count2 = 0;
Condition1 = false;
Condition2 = false;
for cnt = 0 to 15
{
if dayofweek(ndate1+cnt) == 4 Then
{
count1 = count1+1;
if Condition1 == false and count1 == 2 Then
{
Condition1 = true;
Xdate1 = ndate1+cnt;
}
}
if dayofweek(ndate2+cnt) == 4 Then
{
count2 = count2+1;
if Condition2 == false and count2 == 2 Then
{
Condition2 = true;
Xdate2 = ndate2+cnt;
}
}
}
if sdate <= Xdate1 Then
EX = Xdate1;
Else
Ex = Xdate2;
#만기가 휴일이면 직전 영업일 날짜로 지정
If EX == 20141009 Then
EX = 20141008;
If EX == 20190912 Then
EX = 20190911;
EXM = Floor(FracPortion(EX/10000)*100);
#1. 만기달 만기일만 거래
if month%3 == 0 and sdate == EX Then
#2. 만기달 만기 주만 거래(만기일 제외)
if month%3 == 0 and Month == EXM and
DateToJulian(sdate) >= DateToJulian(EX)-4 and sdate < EX Then
#3. 만기달 첫날부터 만기일 전까지 거래
if month%3 == 0 and Month == EXM and sdate < EX Then
즐거운 하루되세요
> 좌오비우오비 님이 쓴 글입니다.
> 제목 : 문의
> 3개월 주기인 선물 만기일이 포함된 달만
거래하는 날짜 수식을 3가지 부탁드립니다.
1. 만기달 만기일만 거래
2. 만기달 만기 주만 거래(만기일 제외)
3. 만기달 첫날부터 만기일 전까지 거래