커뮤니티

거래 시간 설정 문의 드립니다.

프로필 이미지
비정성시
2023-12-11 15:28:30
1018
글번호 174743
답변완료
항상 많은 도움 감사드립니다.시스템식에 여러가지 매수식이 들어가 있을 경우 시간을 따로 설정해 줄 수 있는 방법이 있나요? 아래와 같이 수식을 작성한다면 if sTime >= 80000 and sTime < 154000 Then { if A조건 then buy ("A매수",atmarket,def,1); if B조건 then buy ("B매수",atmarket,def,1); if C조건 then (시간이 11시 부터 15시라면) buy ("C매수",atmarket,def,1); } SetStopEndofday(154000); A,B매수는 전체 시스템 작동 시간을 따라 가고 C매수만 거래 시간을 따로 지정하고 싶은데요. 도움 부탁드립니다.
시스템
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2023-12-12 09:27:30

안녕하세요 예스스탁입니다. input : 시작시간1(80000),끝시간1(154000); input : 시작시간2(110000),끝시간2(150000); var : Tcond1(false),Tcond2(False); if (sdate != sdate[1] and stime >= 시작시간1) or (sdate == sdate[1] and stime >= 시작시간1 and stime[1] < 시작시간1) Then { Tcond1 = true; } if (sdate != sdate[1] and stime >= 끝시간1) or (sdate == sdate[1] and stime >= 끝시간1 and stime[1] < 끝시간1) Then { Tcond1 = False; } if (sdate != sdate[1] and stime >= 시작시간2) or (sdate == sdate[1] and stime >= 시작시간2 and stime[1] < 시작시간2) Then { Tcond2 = true; } if (sdate != sdate[1] and stime >= 끝시간2) or (sdate == sdate[1] and stime >= 끝시간2 and stime[1] < 끝시간2) Then { Tcond2 = False; } if Tcond1 == true Then { if A조건 then buy ("A매수",atmarket,def,1); if B조건 then buy ("B매수",atmarket,def,1); } if Tcond2 == true Then { if C조건 then buy ("C매수",atmarket,def,1); } SetStopEndofday(154000); 즐거운 하루되세요 > 비정성시 님이 쓴 글입니다. > 제목 : 거래 시간 설정 문의 드립니다. > 항상 많은 도움 감사드립니다.시스템식에 여러가지 매수식이 들어가 있을 경우 시간을 따로 설정해 줄 수 있는 방법이 있나요? 아래와 같이 수식을 작성한다면 if sTime >= 80000 and sTime < 154000 Then { if A조건 then buy ("A매수",atmarket,def,1); if B조건 then buy ("B매수",atmarket,def,1); if C조건 then (시간이 11시 부터 15시라면) buy ("C매수",atmarket,def,1); } SetStopEndofday(154000); A,B매수는 전체 시스템 작동 시간을 따라 가고 C매수만 거래 시간을 따로 지정하고 싶은데요. 도움 부탁드립니다.