커뮤니티

수식문의드립니다

프로필 이미지
toal
2018-06-28 21:14:40
170
글번호 120156
답변완료
저번에 소수점이하 지정가 매매수식으로 문의 드렸었는데 var1 = Floor(c); if MarketPosition <= 0 and H < var1+0.75 Then buy("b",AtStop,var1+0.75); if MarketPosition >= 0 and L > var1+0.25 Then sell("s",AtStop,var1+0.25); 이렇게 답주셨는데 이번엔 정수지정가 매매를 작성하려고 하는데 어떻게 작성해야하나요? 예를들어 XX70.00 매수진입매도청산, XX20.00 매도진입매수청산 시간지정매매도 답변주셨는데 되지를 않네요 한번 확인해주세요~ if (bdate != bdate[1] and stime >= 80000) or (bdate == bdate[1] and stime >= 80000 and stime[1] < 80000) Then Tcond = true; if (bdate != bdate[1] and stime >= 150000) or (bdate == bdate[1] and stime >= 150000 and stime[1] < 150000) Then Tcond = false; if (bdate != bdate[1] and stime >= 200000) or (bdate == bdate[1] and stime >= 200000 and stime[1] < 200000) Then Tcond = true; if (bdate != bdate[1] and stime >= 010000) or (bdate == bdate[1] and stime >= 010000 and stime[1] < 010000) Then Tcond = false;
시스템
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2018-06-29 09:30:36

안녕하세요 예스스탁입니다. 1 소수점이하를 모두 제외하신 다면 아래와 같이 작성하시면 됩니다. floor(c)가 소수제외한 값입니다. var1 = Floor(c); if MarketPosition <= 0 and H < var1 Then buy("b",AtStop,var1); if MarketPosition >= 0 and L > var1 Then sell("s",AtStop,var1); 2 수식에 이상이 없습니다. 8시가 되면 tcond는 true 15시가 되면 tcond는 false 20시가 되면 tcond는 true 01시가 되면 tcond는 false 가 됩니다. 각 진입/청산 수식에 tcond == true 조건 추가해 지정하시면 됩니다. var : Tcond(false); if (bdate != bdate[1] and stime >= 80000) or (bdate == bdate[1] and stime >= 80000 and stime[1] < 80000) Then Tcond = true; if (bdate != bdate[1] and stime >= 150000) or (bdate == bdate[1] and stime >= 150000 and stime[1] < 150000) Then Tcond = false; if (bdate != bdate[1] and stime >= 200000) or (bdate == bdate[1] and stime >= 200000 and stime[1] < 200000) Then Tcond = true; if (bdate != bdate[1] and stime >= 010000) or (bdate == bdate[1] and stime >= 010000 and stime[1] < 010000) Then Tcond = false; if Tcond == true and crossup(C,ma(C,20)) Then buy(); if Tcond == true and CrossDown(C,ma(C,20)) Then sell(); 즐거운 하루되세요 > toal 님이 쓴 글입니다. > 제목 : 수식문의드립니다 > 저번에 소수점이하 지정가 매매수식으로 문의 드렸었는데 var1 = Floor(c); if MarketPosition <= 0 and H < var1+0.75 Then buy("b",AtStop,var1+0.75); if MarketPosition >= 0 and L > var1+0.25 Then sell("s",AtStop,var1+0.25); 이렇게 답주셨는데 이번엔 정수지정가 매매를 작성하려고 하는데 어떻게 작성해야하나요? 예를들어 XX70.00 매수진입매도청산, XX20.00 매도진입매수청산 시간지정매매도 답변주셨는데 되지를 않네요 한번 확인해주세요~ if (bdate != bdate[1] and stime >= 80000) or (bdate == bdate[1] and stime >= 80000 and stime[1] < 80000) Then Tcond = true; if (bdate != bdate[1] and stime >= 150000) or (bdate == bdate[1] and stime >= 150000 and stime[1] < 150000) Then Tcond = false; if (bdate != bdate[1] and stime >= 200000) or (bdate == bdate[1] and stime >= 200000 and stime[1] < 200000) Then Tcond = true; if (bdate != bdate[1] and stime >= 010000) or (bdate == bdate[1] and stime >= 010000 and stime[1] < 010000) Then Tcond = false;