_isExpireDate.yfu : 만기일 검사 함수
-----------------------------------------------------------------------------------------
Input : baroDate(numeric), sFutureExpireDate(String);
Array : oddExpireDay[14](0);
Var : nYear(0), nMonth(0), nDay(0), nDayOfweek(0), idx(0), idxEnd(0);
#만기일은 각 월의 두번째 목요일이다.(8일~14일 사이)
#만기일이 휴일일 경우, 만기일을 앞으로 당긴다.
#2000년부터 2050년까지 알려진 휴일과 만기일이 겹치는 날짜들
oddExpireDay[0] = 20000413 - 1; #국회의원 선거일
oddExpireDay[1] = 20000511 - 1; #석가탄신일
oddExpireDay[2] = 20020613 - 1; #지방선거일
oddExpireDay[3] = 20030508 - 1; #석가탄신일
oddExpireDay[4] = 20030911 - 2; #추석
oddExpireDay[5] = 20050210 - 3; #설날+1일
oddExpireDay[6] = 20190912 - 1; #추석-1일
oddExpireDay[7] = 20210211 - 1; #설날-1일
oddExpireDay[8] = 20270513 - 1; #석가탄신일
oddExpireDay[9] = 20300509 - 1; #석가탄신일
oddExpireDay[10] = 20300912 - 2; #추석
oddExpireDay[11] = 20320212 - 3; #설날+1일
oddExpireDay[12] = 20350208 - 2; #설날
oddExpireDay[13] = 20480213 - 1; #설날-1일
idxEnd = 14;
nYear = int(baroDate/10000);
nMonth = int(baroDate/100) - int(baroDate/10000)*100;
nDay = baroDate - int(baroDate/100)*100;
nDayOfweek = DayOfWeek(baroDate);
_isExpireDate = false;
if sFutureExpireDate != "future" or
(sFutureExpireDate == "future" and (nMonth == 3 or nMonth == 6 or nMonth == 9 or nMonth == 12)) Then
{
if nDayOfweek == 4 and 8 <= nDay and nDay <= 14 Then
{
_isExpireDate = True;
}
for idx = 0 to idxEnd - 1
{
if oddExpireDay[idx] > baroDate Then
idx = idxEnd;
if oddExpireDay[idx] == baroDate Then
{
_isExpireDate = True;
idx = idxEnd;
}
}
}
ExpireDateTest.ysg : 만기일 테스트 시스템
-----------------------------------------------------------------------------------------
Input : Period(12);
#만기일 테스트 코드. 연결선물지수 일봉을 불러서 테스트 할 수 있다.
if _isExpireDate(sDate, "option") Then
{
print("c: est.csv", ", %.f", sDate);
MessageLog("만기일=%.f", sDate);
}
If false Then Buy();
If false Then sell();
저기서 필요한 휴일만 참조 하세욥..
저거 c++ 아니니까 그턍 갔다쓰면 안데긔.. 휴일만 빼서 쓰긔..
YT 하다가 c++ 코딩할때 if쓸때.. 나도 모르게 자꾸 Then 붙이다가 자꾸 오류나긔.. ㅠ_ㅠ
보다가 C++은 아닌데, 어디서 많이 봤다 했는데, YT였군요.ㅎㅎ 2050년까지 곂치는 날을 이용해서 만든거네요. 감사합니다.@_@
지금부터 2050년까지는 8번 밖에 안곂치네요.
오홍
w w w . e g p l u s .c o . k r 대여계좌
로얄바카라┏◐ZMGUG.EE9.KR◑┓인생 역전의꿈을이루새요_______최고의바카라사이트