커뮤니티

문의

프로필 이미지
좌오비우오비
2020-12-14 13:34:59
549
글번호 144659
답변완료
답변 고맙습니다. if c > 0 then buy(); 위 진입수식을 아래 수식과 매칭시켜주세요. 제가 해보니 (remain 0 입력) 만기일만 거래하는 내용이 아니며 잔존일 변수에 대응하는 결과들의 변화가 없습니다. 살펴주세요. ******************************************************************* 안녕하세요 예스스탁입니다. input : 리메인(0); Var : Year(0),Month(0); var : ndate1(0),ndate2(0),ndate3(0),ndate4(0),ndate5(0); var : cnt(0),count1(0),count2(0),count3(0),count4(0),count5(0); var : XD1(0),XD2(0),XD3(0),XD4(0),XD5(0); var : Xdate(0),remain(0); Year = Floor(sDate / 10000)*10000; month = Floor(FracPortion(sdate/10000)*100)*100; ndate1 = year+300+1; ndate2 = year+600+1; ndate3 = year+900+1; ndate4 = year+1200+1; ndate5 = (year+10000)+300+1; count1 = 0; count2 = 0; count3 = 0; count4 = 0; count5 = 0; for cnt = 0 to 15 { if dayofweek(ndate1+cnt) == 4 Then { count1 = count1+1; if count1 == 2 Then { XD1 = ndate1+cnt; } } if dayofweek(ndate2+cnt) == 4 Then { count2 = count2+1; if count2 == 2 Then { XD2 = nDate2+cnt; } } if dayofweek(ndate3+cnt) == 4 Then { count3 = count3+1; if count3 == 2 Then { XD3 = nDate3+cnt; } } if dayofweek(ndate4+cnt) == 4 Then { count4 = count4+1; if count4 == 2 Then { XD4 = nDate4+cnt; } } if dayofweek(ndate5+cnt) == 4 Then { count5 = count5+1; if count5 == 2 Then { XD5 = nDate5+cnt; } } } if sDate <= XD1 Then { Xdate = XD1; } else if sDate > XD1 and sDate <= XD2 Then { Xdate = XD2; } else if sDate > XD2 and sDate <= XD3 Then { Xdate = XD3; } else if sDate > XD3 and sDate <= XD4 Then { Xdate = XD4; } Else { Xdate = XD5; } if Xdate > 0 Then { remain = DateToJulian(Xdate)-DateToJulian(sDate); } 즐거운 하루되세요 > 좌오비우오비 님이 쓴 글입니다. > 제목 : 문의 > 아래는 옵션 만기일 기준으로 날짜를 리턴하는 수식입니다. 선물 만기일(3개월) 기준 수식을 부탁드립니다. 항상 고맙습니다.
시스템
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2020-12-15 09:23:47

안녕하세요 예스스탁입니다. 첨부된 그림과 같이 리메인이 0이면 만기일에만 거래가 됩니다. input : 리메인(0); Var : Year(0),Month(0); var : ndate1(0),ndate2(0),ndate3(0),ndate4(0),ndate5(0); var : cnt(0),count1(0),count2(0),count3(0),count4(0),count5(0); var : XD1(0),XD2(0),XD3(0),XD4(0),XD5(0); var : Xdate(0),remain(0); Year = Floor(sDate / 10000)*10000; month = Floor(FracPortion(sdate/10000)*100)*100; ndate1 = year+300+1; ndate2 = year+600+1; ndate3 = year+900+1; ndate4 = year+1200+1; ndate5 = (year+10000)+300+1; count1 = 0; count2 = 0; count3 = 0; count4 = 0; count5 = 0; for cnt = 0 to 15 { if dayofweek(ndate1+cnt) == 4 Then { count1 = count1+1; if count1 == 2 Then { XD1 = ndate1+cnt; } } if dayofweek(ndate2+cnt) == 4 Then { count2 = count2+1; if count2 == 2 Then { XD2 = nDate2+cnt; } } if dayofweek(ndate3+cnt) == 4 Then { count3 = count3+1; if count3 == 2 Then { XD3 = nDate3+cnt; } } if dayofweek(ndate4+cnt) == 4 Then { count4 = count4+1; if count4 == 2 Then { XD4 = nDate4+cnt; } } if dayofweek(ndate5+cnt) == 4 Then { count5 = count5+1; if count5 == 2 Then { XD5 = nDate5+cnt; } } } if sDate <= XD1 Then { Xdate = XD1; } else if sDate > XD1 and sDate <= XD2 Then { Xdate = XD2; } else if sDate > XD2 and sDate <= XD3 Then { Xdate = XD3; } else if sDate > XD3 and sDate <= XD4 Then { Xdate = XD4; } Else { Xdate = XD5; } if Xdate > 0 Then { remain = DateToJulian(Xdate)-DateToJulian(sDate); if c > o and remain == 리메인 then buy(); } SetStopEndofday(150000); 즐거운 하루되세요 > 좌오비우오비 님이 쓴 글입니다. > 제목 : 문의 > 답변 고맙습니다. if c > 0 then buy(); 위 진입수식을 아래 수식과 매칭시켜주세요. 제가 해보니 (remain 0 입력) 만기일만 거래하는 내용이 아니며 잔존일 변수에 대응하는 결과들의 변화가 없습니다. 살펴주세요. ******************************************************************* 안녕하세요 예스스탁입니다. input : 리메인(0); Var : Year(0),Month(0); var : ndate1(0),ndate2(0),ndate3(0),ndate4(0),ndate5(0); var : cnt(0),count1(0),count2(0),count3(0),count4(0),count5(0); var : XD1(0),XD2(0),XD3(0),XD4(0),XD5(0); var : Xdate(0),remain(0); Year = Floor(sDate / 10000)*10000; month = Floor(FracPortion(sdate/10000)*100)*100; ndate1 = year+300+1; ndate2 = year+600+1; ndate3 = year+900+1; ndate4 = year+1200+1; ndate5 = (year+10000)+300+1; count1 = 0; count2 = 0; count3 = 0; count4 = 0; count5 = 0; for cnt = 0 to 15 { if dayofweek(ndate1+cnt) == 4 Then { count1 = count1+1; if count1 == 2 Then { XD1 = ndate1+cnt; } } if dayofweek(ndate2+cnt) == 4 Then { count2 = count2+1; if count2 == 2 Then { XD2 = nDate2+cnt; } } if dayofweek(ndate3+cnt) == 4 Then { count3 = count3+1; if count3 == 2 Then { XD3 = nDate3+cnt; } } if dayofweek(ndate4+cnt) == 4 Then { count4 = count4+1; if count4 == 2 Then { XD4 = nDate4+cnt; } } if dayofweek(ndate5+cnt) == 4 Then { count5 = count5+1; if count5 == 2 Then { XD5 = nDate5+cnt; } } } if sDate <= XD1 Then { Xdate = XD1; } else if sDate > XD1 and sDate <= XD2 Then { Xdate = XD2; } else if sDate > XD2 and sDate <= XD3 Then { Xdate = XD3; } else if sDate > XD3 and sDate <= XD4 Then { Xdate = XD4; } Else { Xdate = XD5; } if Xdate > 0 Then { remain = DateToJulian(Xdate)-DateToJulian(sDate); } 즐거운 하루되세요 > 좌오비우오비 님이 쓴 글입니다. > 제목 : 문의 > 아래는 옵션 만기일 기준으로 날짜를 리턴하는 수식입니다. 선물 만기일(3개월) 기준 수식을 부탁드립니다. 항상 고맙습니다.