예스스탁
예스스탁 답변
2019-11-20 17:05:18
안녕하세요
예스스탁입니다.
1
input : 옵션만기일기준(1);
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);
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;
}
}
}
if sdate <= Xdate1 Then
EX = Xdate1;
Else
Ex = Xdate2;
If EX == 20141009 Then
EX = 20141008;
If EX == 20190912 Then
EX = 20190911;
if DateToJulian(sdate) == DateToJulian(EX)-옵션만기일기준 Then
{
}
2
input : 옵션만기일하루전기준(3);
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);
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;
}
}
}
if sdate <= Xdate1 Then
EX = Xdate1;
Else
Ex = Xdate2;
If EX == 20141009 Then
EX = 20141008;
If EX == 20190912 Then
EX = 20190911;
if DateToJulian(sdate) >= DateToJulian(EX)-옵션만기일하루전기준 and DateToJulian(sdate) <= DateToJulian(EX)-1 Then
{
}
즐거운 하루되세요
> 좌오비우오비 님이 쓴 글입니다.
> 제목 : 문의
> 시뮬레이션 기준날짜 : 2012년 6월 15일부터 2019년 11월 19일까지
1) 첫번째 수식에서 옵션만기일(0)을 입력했습니다.
만기일이 휴일인 2개는 결과가 나오지 않습니다.
수요일이 만기인 날짜들을 입력하면 그 날 결과를 포함시키는 수식을 요청드립니다.
*만기날의 결과는 빠짐없이 보자는 목적임.
2014년 10월 8일 수요일(만기일)
2019년 9월 11일 수요일(만기일)
2) 두번째 수식에서 요청사항입니다.
만기일이 휴일인 경우 하루 앞당겨지는 때가 있습니다.
수요일이 만기인 날짜들을 입력하면 그 날 결과를 제외시키는 수식도 요청드립니다.
*만기날의 결과는 제외하자는 목적임.
2014년 10월 8일 수요일(만기일)
2019년 9월 11일 수요일(만기일)
*********************************************************************************
1
input : 옵션만기일기준(1);
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);
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;
}
}
}
if sdate <= Xdate1 Then
EX = Xdate1;
Else
Ex = Xdate2;
if DateToJulian(sdate) == DateToJulian(EX)-옵션만기일기준 Then
{
}
2
input : 옵션만기일하루전기준(3);
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);
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;
}
}
}
if sdate <= Xdate1 Then
EX = Xdate1;
Else
Ex = Xdate2;
if DateToJulian(sdate) >= DateToJulian(EX)-옵션만기일하루전기준 and DateToJulian(sdate) <= DateToJulian(EX)-1 Then
{
}
즐거운 하루되세요