커뮤니티

문의

프로필 이미지
목마와숙녀
2020-12-18 11:07:08
727
글번호 144796
답변완료
1. 옵션 첫날부터 당월 말까지 거래하는 수식입니다. ex) 2020 12 11 ~ 2020 12 31 이 수식에서 월 마지막 주(2020 12 27 ~ 2020 12 31) 거래는 제외하는 수식을 요청합니다. 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) or (sdate == 20141008) or (sdate == 20190911) then { Xdate = sdate; XMonth = Month; } if sdate > Xdate and month == XMonth Then { } 2. 만기일 포함된 달에서 만기일만 제외하고 거래하는 수식입니다. ex) 2020 12 01 ~ 2020 12 09 이 수식에서 만기주(2020 12 06 ~ 2020 12 10) 거래는 제외하는 수식을 요청합니다. var : nday(0),week(0),Xdate(0),entree(false); nday = date - int(date/100)*100; week = DayOfWeek(date); if bdate > bdate[1]+30 Then entree = true; if (nday >= 8 and nday <= 14 and week == 4) or (sdate == 20141008) or (sdate == 20190911) then { entree = false; } if entree == true Then { }
시스템
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2020-12-21 10:03:48

안녕하세요 예스스탁입니다. 1 var : cnt(0),D0(0),D1(0),D2(0),D3(0),LastMonday(0),Xdate(0),X(0); if Bdate != Bdate[1] Then { D0 = Floor(bDate/100)*100; X = 0; For cnt = 1 to 31 { D1 = D0+cnt; D2 = DateToJulian(D1); D3 = Floor(JulianToDate(D2)/100)*100; if (D0 == D3 and DayOfWeek(D1) == 4) or D1 == 20141008 or D1 == 20190911 Then { X = X+1; if X == 2 Then Xdate = D1; } if D0 == D3 and DayOfWeek(D1) == 1 Then LastMonday = D1; } } if Bdate > Xdate and bDate < LastMonday Then { } 2 var : cnt(0),D0(0),D1(0),D2(0),D3(0),Xdate(0),X(0); if Bdate != Bdate[1] Then { D0 = Floor(bDate/100)*100; X = 0; For cnt = 1 to 31 { D1 = D0+cnt; D2 = DateToJulian(D1); D3 = Floor(JulianToDate(D2)/100)*100; if (D0 == D3 and DayOfWeek(D1) == 4) or D1 == 20141008 or D1 == 20190911 Then { X = X+1; if X == 2 Then Xdate = D1; } } } if Bdate > xdate or JulianToDate(Bdate) < JulianToDate(Xdate)-4 Then { } 즐거운 하루되세요 > 목마와숙녀 님이 쓴 글입니다. > 제목 : 문의 > 1. 옵션 첫날부터 당월 말까지 거래하는 수식입니다. ex) 2020 12 11 ~ 2020 12 31 이 수식에서 월 마지막 주(2020 12 27 ~ 2020 12 31) 거래는 제외하는 수식을 요청합니다. 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) or (sdate == 20141008) or (sdate == 20190911) then { Xdate = sdate; XMonth = Month; } if sdate > Xdate and month == XMonth Then { } 2. 만기일 포함된 달에서 만기일만 제외하고 거래하는 수식입니다. ex) 2020 12 01 ~ 2020 12 09 이 수식에서 만기주(2020 12 06 ~ 2020 12 10) 거래는 제외하는 수식을 요청합니다. var : nday(0),week(0),Xdate(0),entree(false); nday = date - int(date/100)*100; week = DayOfWeek(date); if bdate > bdate[1]+30 Then entree = true; if (nday >= 8 and nday <= 14 and week == 4) or (sdate == 20141008) or (sdate == 20190911) then { entree = false; } if entree == true Then { }