커뮤니티

수식

프로필 이미지
한국사람73
2019-12-13 10:14:58
139
글번호 134348
답변완료
안녕하세요. 항상 감사드립니다. 하기 수식 부탁드립니다. 옵션만기 다음날(금요일) 진입금지 조건입니다. 감사합니다.
시스템
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2019-12-13 18:20:39

안녕하세요 예스스탁입니다. 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),trade(false); 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 sdate != sdate[1] then { trade = true; if EX[1] == sdate[1] Then trade = false; } if trade == true then { 진입청산 내용 } 즐거운 하루되세요 > 한국사람73 님이 쓴 글입니다. > 제목 : 수식 > 안녕하세요. 항상 감사드립니다. 하기 수식 부탁드립니다. 옵션만기 다음날(금요일) 진입금지 조건입니다. 감사합니다.