커뮤니티
선물옵션 만기전주 필터링
2018-12-11 02:05:55
188
글번호 124331
수고하십니다.
선물옵션을 거래함에 있어서 만기주와 만기 전주에만 거래를 하고 싶은데
어떻게 구현할수 있을까요?
답변 1
예스스탁 예스스탁 답변
2018-12-12 09:44:05
안녕하세요
예스스탁입니다.
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);
Year = Floor(sDate / 10000)*10000;
month = Floor(FracPortion(sdate/10000)*100)*100;
ndate1 = year+month+1;
if Month+100 <= 1200 Then
ndate2 = year+(month+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;
}
}
}
entry = true;
if sdate <= Xdate1 Then
{
entry = false;
}
Else
{
count3 = 0;
Condition3 = false;
for cnt = 0 to 15
{
value1 = DateToJulian(xdate2);
value2 = JulianToDate(value1-cnt);
if dayofweek(value2) == 1 Then
count3 = count3+1;
if Condition3 == false and count3 == 2 Then
{
Condition3 = true;
Xdate3 = value2;
}
}
if sdate >= Xdate3 Then
entry = false;
}
if entry == true then
{
진입청산 수식
}
즐거운 하루되세요
> 몽거루 님이 쓴 글입니다.
> 제목 : 선물옵션 만기전주 필터링
> 수고하십니다.
선물옵션을 거래함에 있어서 만기주와 만기 전주에만 거래를 하고 싶은데
어떻게 구현할수 있을까요?