커뮤니티

수능일등 사용자함수 수정

프로필 이미지
무명
2011-11-11 13:53:57
452
글번호 44673
답변완료
아래 수식은 수식지왕님이 게시글에 올린 내용인데...인증하면 오류가 뜨네요.. 20줄에 문법에러와 21줄에 선언되지 않은 이름등... 사용자함수로 쓸수 있게 파일첨부 부탁드려요...수고하세요... (사용자함수) _CloseTimeN.yfu -------------------------------------------------------------------------------- Input:n(numeric); Var:월(0),일(0),장종료(0); 월 = int(Date/100)-int(Date/10000)*100; 일 = Date - int(Date/100)*100; if CodeCategory() < 4 then 장종료 = 900; else if ((월 % 3 == 0 and CodeCategory() == 4) or CodeCategory() >= 6) and 일 >= 8 and 일 <= 14 and DayOfWeek(Date) == 4 then 장종료 = 890; else 장종료 = 915; if DayIndex()==0 then var1 = TimeToMinutes(sTime); if var1 == 600 and 월 == 11 then //수능일. 보통 11월에 수능이 있다 장종료 = 장종료 + 60; var2 = 장종료 - n * BarInterval(); _CloseTimeN = MinutesToTime(var2); -------------------------------------------------------------------------------- 시스템식에서 불러 사용할 경우 아래와 같이 사용하면 됩니다. (시스템식) 당일청산_연습.ysg -------------------------------------------------------------------------------- Input:n(4); if DayIndex() == 18 then { if H[DayIndex()] < C then Buy(); if L[DayIndex()] > C then Sell(); } if sTime > _CloseTimeN(n) then { ExitLong(); ExitShort(); } --------------------------------------------------------------------------------
시스템
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2011-11-11 14:52:45

안녕하세요 예스스탁입니다. 수정한 식입니다. Input:n(numeric); Var:월(0),일(0),장종료(0); 월 = int(Date/100)-int(Date/10000)*100; 일 = Date - int(Date/100)*100; if CodeCategory() < 4 then 장종료 = 900; else if ((월 % 3 == 0 and CodeCategory() == 4) or CodeCategory() >= 6) and 일 >= 8 and 일 <= 14 and DayOfWeek(Date) == 4 then 장종료 = 890; else 장종료 = 915; if DayIndex()==0 then var1 = TimeToMinutes(sTime); if var1 == 600 and 월 == 11 then //수능일. 보통 11월에 수능이 있다 장종료 = 장종료 + 60; var2 = 장종료 - n * BarInterval; _CloseTimeN = MinutesToTime(var2); 즐거운 하루되세요 > 무명 님이 쓴 글입니다. > 제목 : 수능일등 사용자함수 수정 > 아래 수식은 수식지왕님이 게시글에 올린 내용인데...인증하면 오류가 뜨네요.. 20줄에 문법에러와 21줄에 선언되지 않은 이름등... 사용자함수로 쓸수 있게 파일첨부 부탁드려요...수고하세요... (사용자함수) _CloseTimeN.yfu -------------------------------------------------------------------------------- Input:n(numeric); Var:월(0),일(0),장종료(0); 월 = int(Date/100)-int(Date/10000)*100; 일 = Date - int(Date/100)*100; if CodeCategory() < 4 then 장종료 = 900; else if ((월 % 3 == 0 and CodeCategory() == 4) or CodeCategory() >= 6) and 일 >= 8 and 일 <= 14 and DayOfWeek(Date) == 4 then 장종료 = 890; else 장종료 = 915; if DayIndex()==0 then var1 = TimeToMinutes(sTime); if var1 == 600 and 월 == 11 then //수능일. 보통 11월에 수능이 있다 장종료 = 장종료 + 60; var2 = 장종료 - n * BarInterval(); _CloseTimeN = MinutesToTime(var2); -------------------------------------------------------------------------------- 시스템식에서 불러 사용할 경우 아래와 같이 사용하면 됩니다. (시스템식) 당일청산_연습.ysg -------------------------------------------------------------------------------- Input:n(4); if DayIndex() == 18 then { if H[DayIndex()] < C then Buy(); if L[DayIndex()] > C then Sell(); } if sTime > _CloseTimeN(n) then { ExitLong(); ExitShort(); } --------------------------------------------------------------------------------