커뮤니티

문의 드립니다

프로필 이미지
푸른
2024-02-22 12:23:26
831
글번호 176868
답변완료
input : StartTime(144000),EndTime(40000); input : 익절틱수(0),손절틱수(0); var : Tcond(False),entry(0); Variables: Mom(0); IF Endtime > starttime Then SetStopEndofday(Endtime); Else { if sDate != sDate[1] Then SetStopEndofday(Endtime); } if (sdate != sdate[1] and stime >= StartTime) or (sdate == sdate[1] and stime >= StartTime and stime[1] < StartTime) Then { Tcond = true; IF Endtime <= starttime Then { SetStopEndofday(0); } } if (sdate != sdate[1] and stime >= EndTime) or (sdate == sdate[1] and stime >= EndTime and stime[1] < EndTime) Then { Tcond = False; } if Tcond == true Then { if L ==lowest(L,2) and highest(H,2) >= lowest(L,2)+PriceScale*1 Then { Buy("b",AtStop,(highest(H,2)+lowest(L,2))/2); } if MarketPosition == 1 and BarsSinceEntry == 2 Then ExitShort(); } if H == highest(H,2) and lowest(L,2) <= highest(H,2)+PriceScale*1 Then { Sell("s",AtStop,(lowest(L,2)+highest(H,2))/2); } if MarketPosition == -1 and BarsSinceEntry == 2 Then ExitLong(); if L ==lowest(L,1) and highest(H,3) >= lowest(L,2)+PriceScale*10 Then { Buy("b1",AtStop,(highest(H,3)+lowest(L,1))/2); } if MarketPosition == 1 and BarsSinceEntry == 2 Then ExitShort(); if H == highest(H,1) and lowest(L,3) <= highest(H,2)+PriceScale*10 Then { Sell("s1",AtStop,(lowest(L,3)+highest(H,1))/2); } if MarketPosition == -1 and BarsSinceEntry == 2 Then ExitLong(); if L ==lowest(L,1) and highest(H,3) >= lowest(L,2)+PriceScale*10 Then { Buy("b2",AtStop,(highest(H,3)+lowest(L,1))/2); } if MarketPosition == 1 and BarsSinceEntry == 2 Then ExitShort(); if H == highest(H,1) and lowest(L,3) <= highest(H,2)+PriceScale*10 Then { Sell("s2",AtStop,(lowest(L,3)+highest(H,1))/2); } if MarketPosition == -1 and BarsSinceEntry == 2 Then ExitLong(); if L ==lowest(L,2) and highest(H,2) >= lowest(L,2)+PriceScale*1 Then { Buy("b3",AtStop,(highest(H,2)+lowest(L,2))/2); } if MarketPosition == 1 and BarsSinceEntry == 2 Then ExitShort(); if H == highest(H,2) and lowest(L,2) <= highest(H,2)+PriceScale*1 Then { Sell("s3",AtStop,(lowest(L,2)+highest(H,2))/2); } if MarketPosition == -1 and BarsSinceEntry == 2 Then ExitLong(); if L ==lowest(L,1) and highest(H,3) >= lowest(L,2)+PriceScale*10 Then { Buy("b4",AtStop,(highest(H,3)+lowest(L,1))/2); } if MarketPosition == 1 and BarsSinceEntry == 2 Then ExitShort(); if H == highest(H,1) and lowest(L,3) <= highest(H,2)+PriceScale*10 Then { Sell("s4",AtStop,(lowest(L,3)+highest(H,1))/2); } if MarketPosition == -1 and BarsSinceEntry == 2 Then ExitLong(); if L ==lowest(L,1) and highest(H,3) >= lowest(L,2)+PriceScale*10 Then { Buy("b5",AtStop,(highest(H,3)+lowest(L,1))/2); } if MarketPosition == 1 and BarsSinceEntry == 2 Then ExitShort(); if H == highest(H,1) and lowest(L,3) <= highest(H,2)+PriceScale*10 Then { Sell("s5",AtStop,(lowest(L,3)+highest(H,1))/2); } if MarketPosition == -1 and BarsSinceEntry == 2 Then ExitLong(); SetStopProfittarget(PriceScale*익절틱수,PointStop); SetStopLoss(PriceScale*손절틱수,PointStop); ------------------------------ EndTime이 04시00분인데 60분봉은 EndTime이 맞고 400분봉 설정에선 EndTime은 14시 40분에 EndTime이 됩니다. 다른방법이 있는지 문의 드리고 매매시간을 AM 4시부터 AM 7시까지의 변경된 수식어를 부탁드립니다.
시스템
답변 2
프로필 이미지

예스스탁 예스스탁 답변

2024-02-22 14:20:36

안녕하세요 예스스탁입니다. 1 주기가 크면 한봉에서 시가와 종가의 날짜가 다른데 그 다음봉에서 셋팅이 되므로 14시40분봉의 시가에 청산이 되었습니다. 시가와 종가의 날짜가 다르면 셋팅이 되게 수정해 드립니다. input : StartTime(144000),EndTime(40000); input : 익절틱수(0),손절틱수(0); var : Tcond(False),entry(0); Variables: Mom(0); IF Endtime > starttime Then SetStopEndofday(Endtime); Else { if sDate != sDate[1] or (sDate != Date) Then SetStopEndofday(Endtime); } if (sdate != sdate[1] and stime >= StartTime) or (sdate == sdate[1] and stime >= StartTime and stime[1] < StartTime) Then { Tcond = true; IF Endtime <= starttime Then { SetStopEndofday(0); } } if (sdate != sdate[1] and stime >= EndTime) or (sdate == sdate[1] and stime >= EndTime and stime[1] < EndTime) Then { Tcond = False; } if Tcond == true Then { if L ==lowest(L,2) and highest(H,2) >= lowest(L,2)+PriceScale*1 Then { Buy("b",AtStop,(highest(H,2)+lowest(L,2))/2); } if MarketPosition == 1 and BarsSinceEntry == 2 Then ExitShort(); } if H == highest(H,2) and lowest(L,2) <= highest(H,2)+PriceScale*1 Then { Sell("s",AtStop,(lowest(L,2)+highest(H,2))/2); } if MarketPosition == -1 and BarsSinceEntry == 2 Then ExitLong(); if L ==lowest(L,1) and highest(H,3) >= lowest(L,2)+PriceScale*10 Then { Buy("b1",AtStop,(highest(H,3)+lowest(L,1))/2); } if MarketPosition == 1 and BarsSinceEntry == 2 Then ExitShort(); if H == highest(H,1) and lowest(L,3) <= highest(H,2)+PriceScale*10 Then { Sell("s1",AtStop,(lowest(L,3)+highest(H,1))/2); } if MarketPosition == -1 and BarsSinceEntry == 2 Then ExitLong(); if L ==lowest(L,1) and highest(H,3) >= lowest(L,2)+PriceScale*10 Then { Buy("b2",AtStop,(highest(H,3)+lowest(L,1))/2); } if MarketPosition == 1 and BarsSinceEntry == 2 Then ExitShort(); if H == highest(H,1) and lowest(L,3) <= highest(H,2)+PriceScale*10 Then { Sell("s2",AtStop,(lowest(L,3)+highest(H,1))/2); } if MarketPosition == -1 and BarsSinceEntry == 2 Then ExitLong(); if L ==lowest(L,2) and highest(H,2) >= lowest(L,2)+PriceScale*1 Then { Buy("b3",AtStop,(highest(H,2)+lowest(L,2))/2); } if MarketPosition == 1 and BarsSinceEntry == 2 Then ExitShort(); if H == highest(H,2) and lowest(L,2) <= highest(H,2)+PriceScale*1 Then { Sell("s3",AtStop,(lowest(L,2)+highest(H,2))/2); } if MarketPosition == -1 and BarsSinceEntry == 2 Then ExitLong(); if L ==lowest(L,1) and highest(H,3) >= lowest(L,2)+PriceScale*10 Then { Buy("b4",AtStop,(highest(H,3)+lowest(L,1))/2); } if MarketPosition == 1 and BarsSinceEntry == 2 Then ExitShort(); if H == highest(H,1) and lowest(L,3) <= highest(H,2)+PriceScale*10 Then { Sell("s4",AtStop,(lowest(L,3)+highest(H,1))/2); } if MarketPosition == -1 and BarsSinceEntry == 2 Then ExitLong(); if L ==lowest(L,1) and highest(H,3) >= lowest(L,2)+PriceScale*10 Then { Buy("b5",AtStop,(highest(H,3)+lowest(L,1))/2); } if MarketPosition == 1 and BarsSinceEntry == 2 Then ExitShort(); if H == highest(H,1) and lowest(L,3) <= highest(H,2)+PriceScale*10 Then { Sell("s5",AtStop,(lowest(L,3)+highest(H,1))/2); } if MarketPosition == -1 and BarsSinceEntry == 2 Then ExitLong(); SetStopProfittarget(PriceScale*익절틱수,PointStop); SetStopLoss(PriceScale*손절틱수,PointStop); 2 400분봉에서 4시와 7시는 한개의 봉입니다. 당일청산은 해당 시간이 포함된 봉에서는 신호를 발생할 수 없으므로 당일청산 사용이 무의미 하게 되고 시작시간 끝시간 지정도 무의미합니다. 아래와 같이 단지 시가가 4시인 봉에서만 신호가 발생하게 하셔야 하고 종가에 청산하게 하셔야 합니다. input : 익절틱수(0),손절틱수(0); Variables: Mom(0); if NextBarStime >= 40000 and time < 40000 Then { if L ==lowest(L,2) and highest(H,2) >= lowest(L,2)+PriceScale*1 Then { Buy("b",AtStop,(highest(H,2)+lowest(L,2))/2); } if MarketPosition == 1 and BarsSinceEntry == 2 Then ExitShort(); if H == highest(H,2) and lowest(L,2) <= highest(H,2)+PriceScale*1 Then { Sell("s",AtStop,(lowest(L,2)+highest(H,2))/2); } if MarketPosition == -1 and BarsSinceEntry == 2 Then ExitLong(); if L ==lowest(L,1) and highest(H,3) >= lowest(L,2)+PriceScale*10 Then { Buy("b1",AtStop,(highest(H,3)+lowest(L,1))/2); } if MarketPosition == 1 and BarsSinceEntry == 2 Then ExitShort(); if H == highest(H,1) and lowest(L,3) <= highest(H,2)+PriceScale*10 Then { Sell("s1",AtStop,(lowest(L,3)+highest(H,1))/2); } if MarketPosition == -1 and BarsSinceEntry == 2 Then ExitLong(); if L ==lowest(L,1) and highest(H,3) >= lowest(L,2)+PriceScale*10 Then { Buy("b2",AtStop,(highest(H,3)+lowest(L,1))/2); } if MarketPosition == 1 and BarsSinceEntry == 2 Then ExitShort(); if H == highest(H,1) and lowest(L,3) <= highest(H,2)+PriceScale*10 Then { Sell("s2",AtStop,(lowest(L,3)+highest(H,1))/2); } if MarketPosition == -1 and BarsSinceEntry == 2 Then ExitLong(); if L ==lowest(L,2) and highest(H,2) >= lowest(L,2)+PriceScale*1 Then { Buy("b3",AtStop,(highest(H,2)+lowest(L,2))/2); } if MarketPosition == 1 and BarsSinceEntry == 2 Then ExitShort(); if H == highest(H,2) and lowest(L,2) <= highest(H,2)+PriceScale*1 Then { Sell("s3",AtStop,(lowest(L,2)+highest(H,2))/2); } if MarketPosition == -1 and BarsSinceEntry == 2 Then ExitLong(); if L ==lowest(L,1) and highest(H,3) >= lowest(L,2)+PriceScale*10 Then { Buy("b4",AtStop,(highest(H,3)+lowest(L,1))/2); } if MarketPosition == 1 and BarsSinceEntry == 2 Then ExitShort(); if H == highest(H,1) and lowest(L,3) <= highest(H,2)+PriceScale*10 Then { Sell("s4",AtStop,(lowest(L,3)+highest(H,1))/2); } if MarketPosition == -1 and BarsSinceEntry == 2 Then ExitLong(); if L ==lowest(L,1) and highest(H,3) >= lowest(L,2)+PriceScale*10 Then { Buy("b5",AtStop,(highest(H,3)+lowest(L,1))/2); } if MarketPosition == 1 and BarsSinceEntry == 2 Then ExitShort(); if H == highest(H,1) and lowest(L,3) <= highest(H,2)+PriceScale*10 Then { Sell("s5",AtStop,(lowest(L,3)+highest(H,1))/2); } if MarketPosition == -1 and BarsSinceEntry == 2 Then ExitLong(); } ExitLong(); ExitShort(); SetStopProfittarget(PriceScale*익절틱수,PointStop); SetStopLoss(PriceScale*손절틱수,PointStop); 즐거운 하루되세요 > 푸른 님이 쓴 글입니다. > 제목 : 문의 드립니다 > input : StartTime(144000),EndTime(40000); input : 익절틱수(0),손절틱수(0); var : Tcond(False),entry(0); Variables: Mom(0); IF Endtime > starttime Then SetStopEndofday(Endtime); Else { if sDate != sDate[1] Then SetStopEndofday(Endtime); } if (sdate != sdate[1] and stime >= StartTime) or (sdate == sdate[1] and stime >= StartTime and stime[1] < StartTime) Then { Tcond = true; IF Endtime <= starttime Then { SetStopEndofday(0); } } if (sdate != sdate[1] and stime >= EndTime) or (sdate == sdate[1] and stime >= EndTime and stime[1] < EndTime) Then { Tcond = False; } if Tcond == true Then { if L ==lowest(L,2) and highest(H,2) >= lowest(L,2)+PriceScale*1 Then { Buy("b",AtStop,(highest(H,2)+lowest(L,2))/2); } if MarketPosition == 1 and BarsSinceEntry == 2 Then ExitShort(); } if H == highest(H,2) and lowest(L,2) <= highest(H,2)+PriceScale*1 Then { Sell("s",AtStop,(lowest(L,2)+highest(H,2))/2); } if MarketPosition == -1 and BarsSinceEntry == 2 Then ExitLong(); if L ==lowest(L,1) and highest(H,3) >= lowest(L,2)+PriceScale*10 Then { Buy("b1",AtStop,(highest(H,3)+lowest(L,1))/2); } if MarketPosition == 1 and BarsSinceEntry == 2 Then ExitShort(); if H == highest(H,1) and lowest(L,3) <= highest(H,2)+PriceScale*10 Then { Sell("s1",AtStop,(lowest(L,3)+highest(H,1))/2); } if MarketPosition == -1 and BarsSinceEntry == 2 Then ExitLong(); if L ==lowest(L,1) and highest(H,3) >= lowest(L,2)+PriceScale*10 Then { Buy("b2",AtStop,(highest(H,3)+lowest(L,1))/2); } if MarketPosition == 1 and BarsSinceEntry == 2 Then ExitShort(); if H == highest(H,1) and lowest(L,3) <= highest(H,2)+PriceScale*10 Then { Sell("s2",AtStop,(lowest(L,3)+highest(H,1))/2); } if MarketPosition == -1 and BarsSinceEntry == 2 Then ExitLong(); if L ==lowest(L,2) and highest(H,2) >= lowest(L,2)+PriceScale*1 Then { Buy("b3",AtStop,(highest(H,2)+lowest(L,2))/2); } if MarketPosition == 1 and BarsSinceEntry == 2 Then ExitShort(); if H == highest(H,2) and lowest(L,2) <= highest(H,2)+PriceScale*1 Then { Sell("s3",AtStop,(lowest(L,2)+highest(H,2))/2); } if MarketPosition == -1 and BarsSinceEntry == 2 Then ExitLong(); if L ==lowest(L,1) and highest(H,3) >= lowest(L,2)+PriceScale*10 Then { Buy("b4",AtStop,(highest(H,3)+lowest(L,1))/2); } if MarketPosition == 1 and BarsSinceEntry == 2 Then ExitShort(); if H == highest(H,1) and lowest(L,3) <= highest(H,2)+PriceScale*10 Then { Sell("s4",AtStop,(lowest(L,3)+highest(H,1))/2); } if MarketPosition == -1 and BarsSinceEntry == 2 Then ExitLong(); if L ==lowest(L,1) and highest(H,3) >= lowest(L,2)+PriceScale*10 Then { Buy("b5",AtStop,(highest(H,3)+lowest(L,1))/2); } if MarketPosition == 1 and BarsSinceEntry == 2 Then ExitShort(); if H == highest(H,1) and lowest(L,3) <= highest(H,2)+PriceScale*10 Then { Sell("s5",AtStop,(lowest(L,3)+highest(H,1))/2); } if MarketPosition == -1 and BarsSinceEntry == 2 Then ExitLong(); SetStopProfittarget(PriceScale*익절틱수,PointStop); SetStopLoss(PriceScale*손절틱수,PointStop); ------------------------------ EndTime이 04시00분인데 60분봉은 EndTime이 맞고 400분봉 설정에선 EndTime은 14시 40분에 EndTime이 됩니다. 다른방법이 있는지 문의 드리고 매매시간을 AM 4시부터 AM 7시까지의 변경된 수식어를 부탁드립니다.
프로필 이미지

푸른

2024-02-22 15:43:25

감사합니다. > 예스스탁 님이 쓴 글입니다. > 제목 : Re : 문의 드립니다 > 안녕하세요 예스스탁입니다. 1 주기가 크면 한봉에서 시가와 종가의 날짜가 다른데 그 다음봉에서 셋팅이 되므로 14시40분봉의 시가에 청산이 되었습니다. 시가와 종가의 날짜가 다르면 셋팅이 되게 수정해 드립니다. input : StartTime(144000),EndTime(40000); input : 익절틱수(0),손절틱수(0); var : Tcond(False),entry(0); Variables: Mom(0); IF Endtime > starttime Then SetStopEndofday(Endtime); Else { if sDate != sDate[1] or (sDate != Date) Then SetStopEndofday(Endtime); } if (sdate != sdate[1] and stime >= StartTime) or (sdate == sdate[1] and stime >= StartTime and stime[1] < StartTime) Then { Tcond = true; IF Endtime <= starttime Then { SetStopEndofday(0); } } if (sdate != sdate[1] and stime >= EndTime) or (sdate == sdate[1] and stime >= EndTime and stime[1] < EndTime) Then { Tcond = False; } if Tcond == true Then { if L ==lowest(L,2) and highest(H,2) >= lowest(L,2)+PriceScale*1 Then { Buy("b",AtStop,(highest(H,2)+lowest(L,2))/2); } if MarketPosition == 1 and BarsSinceEntry == 2 Then ExitShort(); } if H == highest(H,2) and lowest(L,2) <= highest(H,2)+PriceScale*1 Then { Sell("s",AtStop,(lowest(L,2)+highest(H,2))/2); } if MarketPosition == -1 and BarsSinceEntry == 2 Then ExitLong(); if L ==lowest(L,1) and highest(H,3) >= lowest(L,2)+PriceScale*10 Then { Buy("b1",AtStop,(highest(H,3)+lowest(L,1))/2); } if MarketPosition == 1 and BarsSinceEntry == 2 Then ExitShort(); if H == highest(H,1) and lowest(L,3) <= highest(H,2)+PriceScale*10 Then { Sell("s1",AtStop,(lowest(L,3)+highest(H,1))/2); } if MarketPosition == -1 and BarsSinceEntry == 2 Then ExitLong(); if L ==lowest(L,1) and highest(H,3) >= lowest(L,2)+PriceScale*10 Then { Buy("b2",AtStop,(highest(H,3)+lowest(L,1))/2); } if MarketPosition == 1 and BarsSinceEntry == 2 Then ExitShort(); if H == highest(H,1) and lowest(L,3) <= highest(H,2)+PriceScale*10 Then { Sell("s2",AtStop,(lowest(L,3)+highest(H,1))/2); } if MarketPosition == -1 and BarsSinceEntry == 2 Then ExitLong(); if L ==lowest(L,2) and highest(H,2) >= lowest(L,2)+PriceScale*1 Then { Buy("b3",AtStop,(highest(H,2)+lowest(L,2))/2); } if MarketPosition == 1 and BarsSinceEntry == 2 Then ExitShort(); if H == highest(H,2) and lowest(L,2) <= highest(H,2)+PriceScale*1 Then { Sell("s3",AtStop,(lowest(L,2)+highest(H,2))/2); } if MarketPosition == -1 and BarsSinceEntry == 2 Then ExitLong(); if L ==lowest(L,1) and highest(H,3) >= lowest(L,2)+PriceScale*10 Then { Buy("b4",AtStop,(highest(H,3)+lowest(L,1))/2); } if MarketPosition == 1 and BarsSinceEntry == 2 Then ExitShort(); if H == highest(H,1) and lowest(L,3) <= highest(H,2)+PriceScale*10 Then { Sell("s4",AtStop,(lowest(L,3)+highest(H,1))/2); } if MarketPosition == -1 and BarsSinceEntry == 2 Then ExitLong(); if L ==lowest(L,1) and highest(H,3) >= lowest(L,2)+PriceScale*10 Then { Buy("b5",AtStop,(highest(H,3)+lowest(L,1))/2); } if MarketPosition == 1 and BarsSinceEntry == 2 Then ExitShort(); if H == highest(H,1) and lowest(L,3) <= highest(H,2)+PriceScale*10 Then { Sell("s5",AtStop,(lowest(L,3)+highest(H,1))/2); } if MarketPosition == -1 and BarsSinceEntry == 2 Then ExitLong(); SetStopProfittarget(PriceScale*익절틱수,PointStop); SetStopLoss(PriceScale*손절틱수,PointStop); 2 400분봉에서 4시와 7시는 한개의 봉입니다. 당일청산은 해당 시간이 포함된 봉에서는 신호를 발생할 수 없으므로 당일청산 사용이 무의미 하게 되고 시작시간 끝시간 지정도 무의미합니다. 아래와 같이 단지 시가가 4시인 봉에서만 신호가 발생하게 하셔야 하고 종가에 청산하게 하셔야 합니다. input : 익절틱수(0),손절틱수(0); Variables: Mom(0); if NextBarStime >= 40000 and time < 40000 Then { if L ==lowest(L,2) and highest(H,2) >= lowest(L,2)+PriceScale*1 Then { Buy("b",AtStop,(highest(H,2)+lowest(L,2))/2); } if MarketPosition == 1 and BarsSinceEntry == 2 Then ExitShort(); if H == highest(H,2) and lowest(L,2) <= highest(H,2)+PriceScale*1 Then { Sell("s",AtStop,(lowest(L,2)+highest(H,2))/2); } if MarketPosition == -1 and BarsSinceEntry == 2 Then ExitLong(); if L ==lowest(L,1) and highest(H,3) >= lowest(L,2)+PriceScale*10 Then { Buy("b1",AtStop,(highest(H,3)+lowest(L,1))/2); } if MarketPosition == 1 and BarsSinceEntry == 2 Then ExitShort(); if H == highest(H,1) and lowest(L,3) <= highest(H,2)+PriceScale*10 Then { Sell("s1",AtStop,(lowest(L,3)+highest(H,1))/2); } if MarketPosition == -1 and BarsSinceEntry == 2 Then ExitLong(); if L ==lowest(L,1) and highest(H,3) >= lowest(L,2)+PriceScale*10 Then { Buy("b2",AtStop,(highest(H,3)+lowest(L,1))/2); } if MarketPosition == 1 and BarsSinceEntry == 2 Then ExitShort(); if H == highest(H,1) and lowest(L,3) <= highest(H,2)+PriceScale*10 Then { Sell("s2",AtStop,(lowest(L,3)+highest(H,1))/2); } if MarketPosition == -1 and BarsSinceEntry == 2 Then ExitLong(); if L ==lowest(L,2) and highest(H,2) >= lowest(L,2)+PriceScale*1 Then { Buy("b3",AtStop,(highest(H,2)+lowest(L,2))/2); } if MarketPosition == 1 and BarsSinceEntry == 2 Then ExitShort(); if H == highest(H,2) and lowest(L,2) <= highest(H,2)+PriceScale*1 Then { Sell("s3",AtStop,(lowest(L,2)+highest(H,2))/2); } if MarketPosition == -1 and BarsSinceEntry == 2 Then ExitLong(); if L ==lowest(L,1) and highest(H,3) >= lowest(L,2)+PriceScale*10 Then { Buy("b4",AtStop,(highest(H,3)+lowest(L,1))/2); } if MarketPosition == 1 and BarsSinceEntry == 2 Then ExitShort(); if H == highest(H,1) and lowest(L,3) <= highest(H,2)+PriceScale*10 Then { Sell("s4",AtStop,(lowest(L,3)+highest(H,1))/2); } if MarketPosition == -1 and BarsSinceEntry == 2 Then ExitLong(); if L ==lowest(L,1) and highest(H,3) >= lowest(L,2)+PriceScale*10 Then { Buy("b5",AtStop,(highest(H,3)+lowest(L,1))/2); } if MarketPosition == 1 and BarsSinceEntry == 2 Then ExitShort(); if H == highest(H,1) and lowest(L,3) <= highest(H,2)+PriceScale*10 Then { Sell("s5",AtStop,(lowest(L,3)+highest(H,1))/2); } if MarketPosition == -1 and BarsSinceEntry == 2 Then ExitLong(); } ExitLong(); ExitShort(); SetStopProfittarget(PriceScale*익절틱수,PointStop); SetStopLoss(PriceScale*손절틱수,PointStop); 즐거운 하루되세요 > 푸른 님이 쓴 글입니다. > 제목 : 문의 드립니다 > input : StartTime(144000),EndTime(40000); input : 익절틱수(0),손절틱수(0); var : Tcond(False),entry(0); Variables: Mom(0); IF Endtime > starttime Then SetStopEndofday(Endtime); Else { if sDate != sDate[1] Then SetStopEndofday(Endtime); } if (sdate != sdate[1] and stime >= StartTime) or (sdate == sdate[1] and stime >= StartTime and stime[1] < StartTime) Then { Tcond = true; IF Endtime <= starttime Then { SetStopEndofday(0); } } if (sdate != sdate[1] and stime >= EndTime) or (sdate == sdate[1] and stime >= EndTime and stime[1] < EndTime) Then { Tcond = False; } if Tcond == true Then { if L ==lowest(L,2) and highest(H,2) >= lowest(L,2)+PriceScale*1 Then { Buy("b",AtStop,(highest(H,2)+lowest(L,2))/2); } if MarketPosition == 1 and BarsSinceEntry == 2 Then ExitShort(); } if H == highest(H,2) and lowest(L,2) <= highest(H,2)+PriceScale*1 Then { Sell("s",AtStop,(lowest(L,2)+highest(H,2))/2); } if MarketPosition == -1 and BarsSinceEntry == 2 Then ExitLong(); if L ==lowest(L,1) and highest(H,3) >= lowest(L,2)+PriceScale*10 Then { Buy("b1",AtStop,(highest(H,3)+lowest(L,1))/2); } if MarketPosition == 1 and BarsSinceEntry == 2 Then ExitShort(); if H == highest(H,1) and lowest(L,3) <= highest(H,2)+PriceScale*10 Then { Sell("s1",AtStop,(lowest(L,3)+highest(H,1))/2); } if MarketPosition == -1 and BarsSinceEntry == 2 Then ExitLong(); if L ==lowest(L,1) and highest(H,3) >= lowest(L,2)+PriceScale*10 Then { Buy("b2",AtStop,(highest(H,3)+lowest(L,1))/2); } if MarketPosition == 1 and BarsSinceEntry == 2 Then ExitShort(); if H == highest(H,1) and lowest(L,3) <= highest(H,2)+PriceScale*10 Then { Sell("s2",AtStop,(lowest(L,3)+highest(H,1))/2); } if MarketPosition == -1 and BarsSinceEntry == 2 Then ExitLong(); if L ==lowest(L,2) and highest(H,2) >= lowest(L,2)+PriceScale*1 Then { Buy("b3",AtStop,(highest(H,2)+lowest(L,2))/2); } if MarketPosition == 1 and BarsSinceEntry == 2 Then ExitShort(); if H == highest(H,2) and lowest(L,2) <= highest(H,2)+PriceScale*1 Then { Sell("s3",AtStop,(lowest(L,2)+highest(H,2))/2); } if MarketPosition == -1 and BarsSinceEntry == 2 Then ExitLong(); if L ==lowest(L,1) and highest(H,3) >= lowest(L,2)+PriceScale*10 Then { Buy("b4",AtStop,(highest(H,3)+lowest(L,1))/2); } if MarketPosition == 1 and BarsSinceEntry == 2 Then ExitShort(); if H == highest(H,1) and lowest(L,3) <= highest(H,2)+PriceScale*10 Then { Sell("s4",AtStop,(lowest(L,3)+highest(H,1))/2); } if MarketPosition == -1 and BarsSinceEntry == 2 Then ExitLong(); if L ==lowest(L,1) and highest(H,3) >= lowest(L,2)+PriceScale*10 Then { Buy("b5",AtStop,(highest(H,3)+lowest(L,1))/2); } if MarketPosition == 1 and BarsSinceEntry == 2 Then ExitShort(); if H == highest(H,1) and lowest(L,3) <= highest(H,2)+PriceScale*10 Then { Sell("s5",AtStop,(lowest(L,3)+highest(H,1))/2); } if MarketPosition == -1 and BarsSinceEntry == 2 Then ExitLong(); SetStopProfittarget(PriceScale*익절틱수,PointStop); SetStopLoss(PriceScale*손절틱수,PointStop); ------------------------------ EndTime이 04시00분인데 60분봉은 EndTime이 맞고 400분봉 설정에선 EndTime은 14시 40분에 EndTime이 됩니다. 다른방법이 있는지 문의 드리고 매매시간을 AM 4시부터 AM 7시까지의 변경된 수식어를 부탁드립니다.