커뮤니티

수정부탁드려요..

프로필 이미지
팽구
2016-03-27 06:30:34
68
글번호 96608
답변완료
아래의 수식은 매달 세번째 수요일에 매수하는 식입니다. 일봉으로 아래의 수식을 적용해보면 거의 맞긴한데, 매달 1일이 수요일인 경우에는 4번째 수요일에 매수하게 됩니다. 수정부탁드립니다. //////////////////////////////////////// Var : month(0),NthWeek(0),Week(0); month = int(FracPortion(date/10000)*100); week = DayOfWeek(date); if month != month[1] Then{ if week < week[1] Then Nthweek = 1; Else Nthweek = 0; } if month == month[1] and week < week[1] Then Nthweek = Nthweek+1; #3/6/9/12월 4번째주 월요일 //if Month%분기월 == 0 and Nthweek == 주 and week == 요일 Then Condition1 = Month%1 == 0 and Nthweek == 3 and week == 3; if Condition1 == True Then Buy(); if Condition1 == False Then ExitLong();
시스템
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2016-03-28 11:44:12

안녕하세요 예스스탁입니다. 수정한 식입니다. Var : month(0),NthWeek(0),Week(0); month = int(FracPortion(date/10000)*100); week = DayOfWeek(date); if month != month[1] Then{ if week < week[1] or Week == 3 Then Nthweek = 1; Else Nthweek = 0; } if month == month[1] and week < week[1] Then Nthweek = Nthweek+1; #3/6/9/12월 4번째주 월요일 //if Month%분기월 == 0 and Nthweek == 주 and week == 요일 Then Condition1 = Month%1 == 0 and Nthweek == 3 and week == 3; if Condition1 == True Then Buy(); if Condition1 == False Then ExitLong(); 즐거운 하루되세요 > 팽구 님이 쓴 글입니다. > 제목 : 수정부탁드려요.. > 아래의 수식은 매달 세번째 수요일에 매수하는 식입니다. 일봉으로 아래의 수식을 적용해보면 거의 맞긴한데, 매달 1일이 수요일인 경우에는 4번째 수요일에 매수하게 됩니다. 수정부탁드립니다. //////////////////////////////////////// Var : month(0),NthWeek(0),Week(0); month = int(FracPortion(date/10000)*100); week = DayOfWeek(date); if month != month[1] Then{ if week < week[1] Then Nthweek = 1; Else Nthweek = 0; } if month == month[1] and week < week[1] Then Nthweek = Nthweek+1; #3/6/9/12월 4번째주 월요일 //if Month%분기월 == 0 and Nthweek == 주 and week == 요일 Then Condition1 = Month%1 == 0 and Nthweek == 3 and week == 3; if Condition1 == True Then Buy(); if Condition1 == False Then ExitLong();