커뮤니티

문의 드립니다

프로필 이미지
푸른
2024-02-21 07:10:52
962
글번호 176804
답변완료
input : StartTime(80000),EndTime(40000); input : 익절틱수(400),손절틱수(200); 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(); if L ==lowest(L,2) and highest(H,2) >= lowest(L,2)+PriceScale*1 Then { Buy("b6",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("s6",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("b7",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("s7",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("b8",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("s8",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("b9",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("s9",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("b10",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("s10",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("b11",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("s11",AtStop,(lowest(L,3)+highest(H,1))/2); } if MarketPosition == -1 and BarsSinceEntry == 2 Then ExitLong(); SetStopProfittarget(PriceScale*익절틱수,PointStop); SetStopLoss(PriceScale*손절틱수,PointStop); 위 수식어의 해외선물에서 4가지 변경된 수식어를 부탁 드립니다. 1. 전일잔고를 아침 7시40분 ~8시사이 업데이트 시간 이후 특정한 시간에 청산되는 변경된 수식어 2. startTime에 진입후 체결과 endTime에 잔고가 청산되는 변경된 수식어 3. 익절과 손절후 잔고가 없는 변경된 수식어 4. 익절후 매매정지
시스템
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2024-02-21 11:20:09

안녕하세요 예스스탁입니다. 1,2 1번과 2번은 수식은 동일합니다. 단지 사용자분이 시작시간과 종료시간 지정만 달리 지정하시면 됩니다. 1번과 같은 경우 종료시간을 8시 이후 시간으로, 시작시간을 해당 종료시간 이후의 시간으로만 지정하시면 됩니다. input : StartTime(80000),EndTime(40000); input : 익절틱수(400),손절틱수(200); 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(); if L ==lowest(L,2) and highest(H,2) >= lowest(L,2)+PriceScale*1 Then { Buy("b6",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("s6",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("b7",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("s7",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("b8",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("s8",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("b9",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("s9",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("b10",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("s10",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("b11",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("s11",AtStop,(lowest(L,3)+highest(H,1))/2); } if MarketPosition == -1 and BarsSinceEntry == 2 Then ExitLong(); } SetStopProfittarget(PriceScale*익절틱수,PointStop); SetStopLoss(PriceScale*손절틱수,PointStop); 3 익절이나 손절이 발생하면 매매정지하는 내용으로 보고 작성해 드립니다. input : StartTime(80000),EndTime(40000); input : 익절틱수(400),손절틱수(200); var : Tcond(False),entry(0); Variables: Mom(0),Xcond(False); 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); } Xcond = False; } if (sdate != sdate[1] and stime >= EndTime) or (sdate == sdate[1] and stime >= EndTime and stime[1] < EndTime) Then { Tcond = False; } if TotalTrades > TotalTrades[1] Then { if IsExitName("StopLoss",1) == true or IsExitName("StopProfittarget",1) == true then Xcond = true; } if Tcond == true and Xcond == 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(); if L ==lowest(L,2) and highest(H,2) >= lowest(L,2)+PriceScale*1 Then { Buy("b6",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("s6",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("b7",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("s7",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("b8",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("s8",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("b9",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("s9",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("b10",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("s10",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("b11",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("s11",AtStop,(lowest(L,3)+highest(H,1))/2); } if MarketPosition == -1 and BarsSinceEntry == 2 Then ExitLong(); } SetStopProfittarget(PriceScale*익절틱수,PointStop); SetStopLoss(PriceScale*손절틱수,PointStop); 4 input : StartTime(80000),EndTime(40000); input : 익절틱수(400),손절틱수(200); var : Tcond(False),entry(0); Variables: Mom(0),Xcond(False); 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); } Xcond = False; } if (sdate != sdate[1] and stime >= EndTime) or (sdate == sdate[1] and stime >= EndTime and stime[1] < EndTime) Then { Tcond = False; } if TotalTrades > TotalTrades[1] Then { if IsExitName("StopProfittarget",1) == true then Xcond = true; } if Tcond == true and Xcond == 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(); if L ==lowest(L,2) and highest(H,2) >= lowest(L,2)+PriceScale*1 Then { Buy("b6",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("s6",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("b7",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("s7",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("b8",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("s8",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("b9",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("s9",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("b10",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("s10",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("b11",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("s11",AtStop,(lowest(L,3)+highest(H,1))/2); } if MarketPosition == -1 and BarsSinceEntry == 2 Then ExitLong(); } SetStopProfittarget(PriceScale*익절틱수,PointStop); SetStopLoss(PriceScale*손절틱수,PointStop); 즐거운 하루되세요 > 푸른 님이 쓴 글입니다. > 제목 : 문의 드립니다 > input : StartTime(80000),EndTime(40000); input : 익절틱수(400),손절틱수(200); 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(); if L ==lowest(L,2) and highest(H,2) >= lowest(L,2)+PriceScale*1 Then { Buy("b6",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("s6",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("b7",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("s7",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("b8",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("s8",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("b9",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("s9",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("b10",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("s10",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("b11",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("s11",AtStop,(lowest(L,3)+highest(H,1))/2); } if MarketPosition == -1 and BarsSinceEntry == 2 Then ExitLong(); SetStopProfittarget(PriceScale*익절틱수,PointStop); SetStopLoss(PriceScale*손절틱수,PointStop); 위 수식어의 해외선물에서 4가지 변경된 수식어를 부탁 드립니다. 1. 전일잔고를 아침 7시40분 ~8시사이 업데이트 시간 이후 특정한 시간에 청산되는 변경된 수식어 2. startTime에 진입후 체결과 endTime에 잔고가 청산되는 변경된 수식어 3. 익절과 손절후 잔고가 없는 변경된 수식어 4. 익절후 매매정지