커뮤니티

문의

프로필 이미지
목마와숙녀
2019-04-02 11:23:59
202
글번호 127570
답변완료

첨부 이미지

ATM연결 등가격 CALL옵션,1분차트,2012년6월15일부터 현재까지 위 조건으로 답변주신 수식을 시뮬레이션해보니 정상으로 결과가 나오는데 예외가 있습니다. 2014년 10월 결과만 이상하게 나옵니다.(2014년 10월9일 만기날은 한글날로 휴일) 첫번째 첨부파일 1.월물초부터 만기전날까지 2014년 10월1일부터 10월31일까지 만기일 이후 결과까지 나옵니다. 두번째 첨부파일 2.만기다음날부터 월말까지 2014년 10월 결과가 없습니다. ********************************************************************* 첫번째 첨부파일 : 월초부터 만기전날까지 2014년 10월1일부터 10월31일까지 결과가 모두 나옵니다. input : 최대(10),최소(0); input : ntime(090000); var : nday(0),week(0),Xdate(0),entry(false); nday = date - int(date/100)*100; week = DayOfWeek(date); if bdate > bdate[1]+30 Then entry = true; if nday >= 8 and nday <= 14 and week == 4 then { entry = false; } if entry == true Then { if 최대 > c and C > 최소 then { if stime == ntime or (stime > ntime and stime[1] < ntime) Then buy(); } } 두번째 첨부파일 : 만기다음날부터 월말까지 2014년 10월 결과가 없습니다. input : 최대(10),최소(0); input : ntime(090000); var : nday(0),week(0),month(0),Xdate(0),XMonth(0); month = int(date/100)-int(date/10000)*100; nday = date - int(date/100)*100; week = DayOfWeek(date); if nday >= 8 and nday <= 14 and week == 4 then { Xdate = sdate; XMonth = Month; } if sdate > Xdate and month == XMonth Then { if 최대 > c and C > 최소 then { if stime == ntime or (stime > ntime and stime[1] < ntime) Then buy(); } }
시스템
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2019-04-02 11:53:04

안녕하세요 예스스탁입니다. 수식으로 만기가 순연된 경우는 알지를 못합니다. 만기가 휴일이면 전일이 만기가 되는데 이경우에는 수식에 아래와 같이 2번째 목요일을 체크하는 부분에 작접 날짜를 직접 지정해 주셔야 합니다. if (nday >= 8 and nday <= 14 and week == 4) or (sdate == 20141008) then { Xdate = sdate; XMonth = Month; } 즐거운 하루되세요 > 목마와숙녀 님이 쓴 글입니다. > 제목 : 문의 > ATM연결 등가격 CALL옵션,1분차트,2012년6월15일부터 현재까지 위 조건으로 답변주신 수식을 시뮬레이션해보니 정상으로 결과가 나오는데 예외가 있습니다. 2014년 10월 결과만 이상하게 나옵니다.(2014년 10월9일 만기날은 한글날로 휴일) 첫번째 첨부파일 1.월물초부터 만기전날까지 2014년 10월1일부터 10월31일까지 만기일 이후 결과까지 나옵니다. 두번째 첨부파일 2.만기다음날부터 월말까지 2014년 10월 결과가 없습니다. ********************************************************************* 첫번째 첨부파일 : 월초부터 만기전날까지 2014년 10월1일부터 10월31일까지 결과가 모두 나옵니다. input : 최대(10),최소(0); input : ntime(090000); var : nday(0),week(0),Xdate(0),entry(false); nday = date - int(date/100)*100; week = DayOfWeek(date); if bdate > bdate[1]+30 Then entry = true; if nday >= 8 and nday <= 14 and week == 4 then { entry = false; } if entry == true Then { if 최대 > c and C > 최소 then { if stime == ntime or (stime > ntime and stime[1] < ntime) Then buy(); } } 두번째 첨부파일 : 만기다음날부터 월말까지 2014년 10월 결과가 없습니다. input : 최대(10),최소(0); input : ntime(090000); var : nday(0),week(0),month(0),Xdate(0),XMonth(0); month = int(date/100)-int(date/10000)*100; nday = date - int(date/100)*100; week = DayOfWeek(date); if nday >= 8 and nday <= 14 and week == 4 then { Xdate = sdate; XMonth = Month; } if sdate > Xdate and month == XMonth Then { if 최대 > c and C > 최소 then { if stime == ntime or (stime > ntime and stime[1] < ntime) Then buy(); } }