커뮤니티

CME매매 시간설정 문의

프로필 이미지
대구어린울프
2018-11-13 07:15:03
180
글번호 123617
답변완료
안녕하세요? 현재 아래와 같은 수식을 사용하고있습니다. 딱 야간에만 매매하기위하여 스타트 시간을 18:00시작~ 끝나는 시간을 05:0분에 끝나게 설정하 여 시뮬레이션 결과, 현재 문제점은 날짜를 안넣어줘서 그런지 모르겠는데, 자꾸 00시 넘어서 매매를 시작합니다. 문제점이 무엇인가요? 어떻게 해야하는지요? ㅠㅠ 야간에 매매할수있게 도와주세요~ input : n1(1),n2(2), 익절틱수(10),손절틱수(10); input : starttime(090000),endtime(045000); var : Tcond(false); if (sdate != sdate[1] and stime >= starttime) or (sdate == sdate[1] and stime >= starttime and stime[1] < starttime) then { Tcond = true; } if (sdate != sdate[1] and stime >= endtime) or (sdate == sdate[1] and stime >= endtime and stime[1] < endtime) then { Tcond = false; if MarketPosition == 1 Then exitlong(); if MarketPosition == -1 Then ExitShort(); } if MarketPosition == 0 then { if (C > O and C == C[n1] and C[n1] < O[n1]) or (C > O and C == C[n2] and C[n2] < O[n2]) Then buy(); if (C < O and C == C[n1] and C[n1] > O[n1]) or (C < O and C == C[n2] and C[n2] > O[n2]) Then sell(); } SetStopProfittarget(PriceScale*익절틱수,PointStop); SetStopLoss(PriceScale*손절틱수,PointStop);
시스템
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2018-11-14 09:33:45

안녕하세요 예스스탁입니다. 1 해당수식에서 starttime을 18시, endtime을 05시로 지정했는데 0시에서 5시 사이에만 발생하면 당일청산이 설정되어 있는 경우입니다. 현재 작성하신 수식에는 끝시간에 청산하는 내용이 있습니다. 그러므로 수식안에서 SetStopEndofday를 사용하거나 설정창의 강제청산탭에서 당일청산을 이용하면 안됩니다. 현재 올리신 수식에는 SetStopEndofday함수가 사용되지 않았으므로 설정창에서 해당 기능 체크해제 해야 합니다. 2 작성하신 수식에 starttime이면 Tcond가 true가 되고 endtime이 되면 Tcond가 false가 되는 내용은 있지만 해당 변수로 가져가 진입식에 조건으로 지정한 부분이 없습니다. 즉 현재 작성하신 수식의 진입식에는 시간조건이 없습니다. 아래와 같이 진입조건에 Tcond == true 라는 조건을 추가해야 합니다. input : n1(1),n2(2), 익절틱수(10),손절틱수(10); input : starttime(090000),endtime(045000); var : Tcond(false); if (sdate != sdate[1] and stime >= starttime) or (sdate == sdate[1] and stime >= starttime and stime[1] < starttime) then { Tcond = true; } if (sdate != sdate[1] and stime >= endtime) or (sdate == sdate[1] and stime >= endtime and stime[1] < endtime) then { Tcond = false; if MarketPosition == 1 Then exitlong(); if MarketPosition == -1 Then ExitShort(); } if MarketPosition == 0 and Tcond == true then { if (C > O and C == C[n1] and C[n1] < O[n1]) or (C > O and C == C[n2] and C[n2] < O[n2]) Then buy(); if (C < O and C == C[n1] and C[n1] > O[n1]) or (C < O and C == C[n2] and C[n2] > O[n2]) Then sell(); } SetStopProfittarget(PriceScale*익절틱수,PointStop); SetStopLoss(PriceScale*손절틱수,PointStop); 즐거우 하루되세요 > 대구어린울프 님이 쓴 글입니다. > 제목 : CME매매 시간설정 문의 > 안녕하세요? 현재 아래와 같은 수식을 사용하고있습니다. 딱 야간에만 매매하기위하여 스타트 시간을 18:00시작~ 끝나는 시간을 05:0분에 끝나게 설정하 여 시뮬레이션 결과, 현재 문제점은 날짜를 안넣어줘서 그런지 모르겠는데, 자꾸 00시 넘어서 매매를 시작합니다. 문제점이 무엇인가요? 어떻게 해야하는지요? ㅠㅠ 야간에 매매할수있게 도와주세요~ input : n1(1),n2(2), 익절틱수(10),손절틱수(10); input : starttime(090000),endtime(045000); var : Tcond(false); if (sdate != sdate[1] and stime >= starttime) or (sdate == sdate[1] and stime >= starttime and stime[1] < starttime) then { Tcond = true; } if (sdate != sdate[1] and stime >= endtime) or (sdate == sdate[1] and stime >= endtime and stime[1] < endtime) then { Tcond = false; if MarketPosition == 1 Then exitlong(); if MarketPosition == -1 Then ExitShort(); } if MarketPosition == 0 then { if (C > O and C == C[n1] and C[n1] < O[n1]) or (C > O and C == C[n2] and C[n2] < O[n2]) Then buy(); if (C < O and C == C[n1] and C[n1] > O[n1]) or (C < O and C == C[n2] and C[n2] > O[n2]) Then sell(); } SetStopProfittarget(PriceScale*익절틱수,PointStop); SetStopLoss(PriceScale*손절틱수,PointStop);