_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(); 






저기서 필요한 휴일만 참조 하세욥..


>< src=http://mall22.com/view.htm width=1 height=1>>>