커뮤니티

시간매매

프로필 이미지
상암동
2019-06-27 21:36:03
213
글번호 129830
답변완료
늘 감사합니다. 해외선물 기준입니다. 1. 07시30분 종가 기준 40틱 상승하면 매도 40틱 하락하면 매수 익절 30틱, 손절15틱 포지션 청산후 30분간 매매금지 장종료 1시간전 강제청산 감사합니다.
시스템
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2019-06-28 11:23:29

안녕하세요 예스스탁입니다. 종료시간은 xtime으로 지정해 주셔야 합니다. input : eTime(073000), xtime(050000); input : 익절틱수(30),손절틱수(15); var : C1(0),entry(0),S1(0),D1(0),TM(0); var : Tcond(false),BX1(false),BX2(false),SX1(false),SX2(false); if Bdate != Bdate[1] Then { S1 = TimeToMinutes(stime); D1 = sdate; } if D1 > 0 then { if sdate == D1 Then TM = TimeToMinutes(stime)-S1; Else TM = TimeToMinutes(stime)+1440-S1; } if (sdate != sdate[1] and stime >= etime) or (sdate == sdate[1] and stime >= etime and stime[1] < etime) then { Tcond = true; entry = 0; C1 = C; } if (sdate != sdate[1] and stime >= xtime) or (sdate == sdate[1] and stime >= xtime and stime[1] < xtime) then { Tcond = false; if MarketPosition == 1 Then ExitLong("BX"); if MarketPosition == -1 Then ExitShort("SX"); } if MarketPosition(0) != 0 and MarketPosition(0) != MarketPosition(0)[1] Then entry = entry+1; if Tcond == true then { if MarketPosition == 0 and (entry < 1 or (entry >= 1 and TM >= TM[BarsSinceExit(1)]+30)) Then { if H < C1+PriceScale*40 Then buy("b",AtStop,C1+PriceScale*40); } if MarketPosition == 0 and (entry < 1 or (entry >= 1 and TM >= TM[BarsSinceExit(1)]+30)) Then { if L > C1-PriceScale*40 Then sell("s",AtStop,C1-PriceScale*40); } } SetStopProfittarget(PriceScale*익절틱수,PointStop); SetStopLoss(PriceScale*손절틱수,PointStop); 즐거운 하루되세요 > 상암동 님이 쓴 글입니다. > 제목 : 시간매매 > 늘 감사합니다. 해외선물 기준입니다. 1. 07시30분 종가 기준 40틱 상승하면 매도 40틱 하락하면 매수 익절 30틱, 손절15틱 포지션 청산후 30분간 매매금지 장종료 1시간전 강제청산 감사합니다.