커뮤니티

시스템식 시간수정

프로필 이미지
조민철
2013-04-01 20:11:36
198
글번호 61526
답변완료
항상 감사드립니다. 아래식은 국내선물 틱쟈트에서 구현하고자 하는 시스템식입니다 시간별로 매매방법을 다르게 설정하여 정규장+야간장까지 포함해서 작성했습니다 주간장 11:30까지는 정상적인것 같은데 야간장 신호가 제대로 나오질 않습니다 강제청산이 11:30 / 익일새벽 04:30 있다보니 시간관계식이 에러가나는것 같습니다 수정부탁드립니다 /***********************************/ /******** 09:00 ~ 09:10 매매 *******/ /***********************************/ if (DayOfWeek(sdate) >= 1 and DayOfWeek(sdate) <=5) or (DayOfWeek(sdate) == 6 and stime < 043000) Then{ if (stime >= 90000 and stime <= 091000) then{ 시스템식 1 } /***********************************/ /******** 09:10 ~ 11:30 매매 *******/ /***********************************/ if (stime >= 091000 and stime <= 113500) then{ 시스템식 2 } /***********************************/ /******** 18:00 ~ 18:10 매매 *******/ /***********************************/ if (stime >= 18000 and stime <= 181000) then{ 시스템식 1 } /***********************************/ /******** 18:10 ~ 04:30 매매 *******/ /***********************************/ if (stime >= 181000 and stime <= 043000) then{ 시스템식 2 } } /*************************************************/ /********* 매일 11:30 강제청산(주간선물) *********/ /*************************************************/ if stime == 113000 or (stime > 113000 and stime[1] < 113000) Then{ exitlong("오전매수청산"); ExitShort("오전매도청산"); } /*************************************************/ /********* 매일 04:30 강제청산(야간선물) *********/ /*************************************************/ if stime == 043000 or (stime > 043000 and stime[1] < 043000) Then{ exitlong("야간매수청산"); ExitShort("야간매도청산"); } /****************************************/ /*********토요일 04:30 강제청산 *********/ /****************************************/ if DayOfWeek(sdate) == 6 and (stime == 043000 or (stime > 043000 and stime[1] < 043000)) Then{ exitlong("주말 매수청산"); ExitShort("주말 매도청산"); } ### 손절 ### SetStopLoss(PriceScale*9,PointStop);
시스템
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2013-04-02 15:10:18

안녕하세요 예스스탁입니다. 진입조건 내용 중 (stime >= 181000 and stime <= 043000) 위 내용은 성립되지 않는 조건입니다. 현재봉의 시간이 18시 10분보다 크고 4시 30분보다 작다라는 내용입니다. and를 or로 수정하셔야 합니다. /***********************************/ /******** 18:10 ~ 04:30 매매 *******/ /***********************************/ if (stime >= 181000 OR stime <= 043000) then{ 시스템식 2 } 즐거운 하루되세요 > 조민철 님이 쓴 글입니다. > 제목 : 시스템식 시간수정 > 항상 감사드립니다. 아래식은 국내선물 틱쟈트에서 구현하고자 하는 시스템식입니다 시간별로 매매방법을 다르게 설정하여 정규장+야간장까지 포함해서 작성했습니다 주간장 11:30까지는 정상적인것 같은데 야간장 신호가 제대로 나오질 않습니다 강제청산이 11:30 / 익일새벽 04:30 있다보니 시간관계식이 에러가나는것 같습니다 수정부탁드립니다 /***********************************/ /******** 09:00 ~ 09:10 매매 *******/ /***********************************/ if (DayOfWeek(sdate) >= 1 and DayOfWeek(sdate) <=5) or (DayOfWeek(sdate) == 6 and stime < 043000) Then{ if (stime >= 90000 and stime <= 091000) then{ 시스템식 1 } /***********************************/ /******** 09:10 ~ 11:30 매매 *******/ /***********************************/ if (stime >= 091000 and stime <= 113500) then{ 시스템식 2 } /***********************************/ /******** 18:00 ~ 18:10 매매 *******/ /***********************************/ if (stime >= 18000 and stime <= 181000) then{ 시스템식 1 } /***********************************/ /******** 18:10 ~ 04:30 매매 *******/ /***********************************/ if (stime >= 181000 and stime <= 043000) then{ 시스템식 2 } } /*************************************************/ /********* 매일 11:30 강제청산(주간선물) *********/ /*************************************************/ if stime == 113000 or (stime > 113000 and stime[1] < 113000) Then{ exitlong("오전매수청산"); ExitShort("오전매도청산"); } /*************************************************/ /********* 매일 04:30 강제청산(야간선물) *********/ /*************************************************/ if stime == 043000 or (stime > 043000 and stime[1] < 043000) Then{ exitlong("야간매수청산"); ExitShort("야간매도청산"); } /****************************************/ /*********토요일 04:30 강제청산 *********/ /****************************************/ if DayOfWeek(sdate) == 6 and (stime == 043000 or (stime > 043000 and stime[1] < 043000)) Then{ exitlong("주말 매수청산"); ExitShort("주말 매도청산"); } ### 손절 ### SetStopLoss(PriceScale*9,PointStop);