커뮤니티

문의 드립니다.

프로필 이미지
푸른
2024-03-19 10:10:56
582
글번호 177612
답변완료
input : StartTime(70000),EndTime(50000); input : 익절틱수(50),손절틱수(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,1) and highest(H,2) >= lowest(L,2)+PriceScale*1 Then { Buy("b",AtStop,(highest(H,2)+lowest(L,1))/2); } if MarketPosition == 1 and BarsSinceEntry == 2 Then ExitShort(); } if H == highest(H,1) and lowest(L,2) <= highest(H,2)+PriceScale*1 Then { Sell("s",AtStop,(lowest(L,2)+highest(H,1))/2); } if MarketPosition == -1 and BarsSinceEntry == 2 Then ExitLong(); if L ==lowest(L,1) and highest(H,2) >= lowest(L,2)+PriceScale*10 Then { Buy("b1",AtStop,(highest(H,2)+lowest(L,1))/2); } if MarketPosition == 1 and BarsSinceEntry == 2 Then ExitShort(); if H == highest(H,1) and lowest(L,2) <= highest(H,2)+PriceScale*10 Then { Sell("s1",AtStop,(lowest(L,2)+highest(H,1))/2); } if MarketPosition == -1 and BarsSinceEntry == 2 Then ExitLong(); if L ==lowest(L,1) and highest(H,2) >= lowest(L,2)+PriceScale*10 Then { Buy("b2",AtStop,(highest(H,2)+lowest(L,1))/2); } if MarketPosition == 1 and BarsSinceEntry == 2 Then ExitShort(); if H == highest(H,1) and lowest(L,2) <= highest(H,2)+PriceScale*10 Then { Sell("s2",AtStop,(lowest(L,2)+highest(H,1))/2); } if MarketPosition == -1 and BarsSinceEntry == 2 Then ExitLong(); if L ==lowest(L,1) and highest(H,2) >= lowest(L,2)+PriceScale*1 Then { Buy("b3",AtStop,(highest(H,2)+lowest(L,1))/2); } if MarketPosition == 1 and BarsSinceEntry == 2 Then ExitShort(); if H == highest(H,1) and lowest(L,2) <= highest(H,2)+PriceScale*1 Then { Sell("s3",AtStop,(lowest(L,2)+highest(H,1))/2); } if MarketPosition == -1 and BarsSinceEntry == 2 Then ExitLong(); if L ==lowest(L,1) and highest(H,2) >= lowest(L,2)+PriceScale*10 Then { Buy("b4",AtStop,(highest(H,2)+lowest(L,1))/2); } if MarketPosition == 1 and BarsSinceEntry == 2 Then ExitShort(); if H == highest(H,1) and lowest(L,2) <= highest(H,2)+PriceScale*10 Then { Sell("s4",AtStop,(lowest(L,2)+highest(H,1))/2); } if MarketPosition == -1 and BarsSinceEntry == 2 Then ExitLong(); if L ==lowest(L,1) and highest(H,2) >= lowest(L,2)+PriceScale*10 Then { Buy("b5",AtStop,(highest(H,2)+lowest(L,1))/2); } if MarketPosition == 1 and BarsSinceEntry == 2 Then ExitShort(); if H == highest(H,1) and lowest(L,2) <= highest(H,2)+PriceScale*10 Then { Sell("s5",AtStop,(lowest(L,2)+highest(H,1))/2); } if MarketPosition == -1 and BarsSinceEntry == 2 Then ExitLong(); SetStopProfittarget(PriceScale*익절틱수,PointStop); SetStopLoss(PriceScale*손절틱수,PointStop); ------- 위 수식어에 아래 3가지가 포함된 각각 별도의 수식어를 부탁드립니다. 1. 익,손절후 당일 매매정지 2. 익절후 5시간 진입금지 3. 익절후 3번째 캔들까지 진입신호금지
시스템
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2024-03-19 17:12:29

안녕하세요 예스스탁입니다. 1 input : StartTime(70000),EndTime(50000); input : 익절틱수(50),손절틱수(0); var : Tcond(False),entry(0); Variables: Mom(0),Trade(False); 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; Trade = 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 TotalTrades > TotalTrades[1] Then { if IsExitName("StopProfittarget",1) or IsExitName("StopLoss",1) Then Trade = False; } if Tcond == true and Trade == False Then { if L ==lowest(L,1) and highest(H,2) >= lowest(L,2)+PriceScale*1 Then { Buy("b",AtStop,(highest(H,2)+lowest(L,1))/2); } if MarketPosition == 1 and BarsSinceEntry == 2 Then ExitShort(); if H == highest(H,1) and lowest(L,2) <= highest(H,2)+PriceScale*1 Then { Sell("s",AtStop,(lowest(L,2)+highest(H,1))/2); } if MarketPosition == -1 and BarsSinceEntry == 2 Then ExitLong(); if L ==lowest(L,1) and highest(H,2) >= lowest(L,2)+PriceScale*10 Then { Buy("b1",AtStop,(highest(H,2)+lowest(L,1))/2); } if MarketPosition == 1 and BarsSinceEntry == 2 Then ExitShort(); if H == highest(H,1) and lowest(L,2) <= highest(H,2)+PriceScale*10 Then { Sell("s1",AtStop,(lowest(L,2)+highest(H,1))/2); } if MarketPosition == -1 and BarsSinceEntry == 2 Then ExitLong(); if L ==lowest(L,1) and highest(H,2) >= lowest(L,2)+PriceScale*10 Then { Buy("b2",AtStop,(highest(H,2)+lowest(L,1))/2); } if MarketPosition == 1 and BarsSinceEntry == 2 Then ExitShort(); if H == highest(H,1) and lowest(L,2) <= highest(H,2)+PriceScale*10 Then { Sell("s2",AtStop,(lowest(L,2)+highest(H,1))/2); } if MarketPosition == -1 and BarsSinceEntry == 2 Then ExitLong(); if L ==lowest(L,1) and highest(H,2) >= lowest(L,2)+PriceScale*1 Then { Buy("b3",AtStop,(highest(H,2)+lowest(L,1))/2); } if MarketPosition == 1 and BarsSinceEntry == 2 Then ExitShort(); if H == highest(H,1) and lowest(L,2) <= highest(H,2)+PriceScale*1 Then { Sell("s3",AtStop,(lowest(L,2)+highest(H,1))/2); } if MarketPosition == -1 and BarsSinceEntry == 2 Then ExitLong(); if L ==lowest(L,1) and highest(H,2) >= lowest(L,2)+PriceScale*10 Then { Buy("b4",AtStop,(highest(H,2)+lowest(L,1))/2); } if MarketPosition == 1 and BarsSinceEntry == 2 Then ExitShort(); if H == highest(H,1) and lowest(L,2) <= highest(H,2)+PriceScale*10 Then { Sell("s4",AtStop,(lowest(L,2)+highest(H,1))/2); } if MarketPosition == -1 and BarsSinceEntry == 2 Then ExitLong(); if L ==lowest(L,1) and highest(H,2) >= lowest(L,2)+PriceScale*10 Then { Buy("b5",AtStop,(highest(H,2)+lowest(L,1))/2); } if MarketPosition == 1 and BarsSinceEntry == 2 Then ExitShort(); if H == highest(H,1) and lowest(L,2) <= highest(H,2)+PriceScale*10 Then { Sell("s5",AtStop,(lowest(L,2)+highest(H,1))/2); } if MarketPosition == -1 and BarsSinceEntry == 2 Then ExitLong(); } SetStopProfittarget(PriceScale*익절틱수,PointStop); SetStopLoss(PriceScale*손절틱수,PointStop); 2 input : StartTime(70000),EndTime(50000); input : 익절틱수(50),손절틱수(0); var : Tcond(False),entry(0); Variables: Mom(0),Trade(False); var : s1(0),d1(0),TM(0),X(0); 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 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; Trade = 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 TotalTrades > TotalTrades[1] Then { if IsExitName("StopProfittarget",1) or IsExitName("StopLoss",1) Then { Trade = False; X = TM; } } if Trade == False and TM >= X+300 Then Trade = true; if Tcond == true and Trade == False Then { if L ==lowest(L,1) and highest(H,2) >= lowest(L,2)+PriceScale*1 Then { Buy("b",AtStop,(highest(H,2)+lowest(L,1))/2); } if MarketPosition == 1 and BarsSinceEntry == 2 Then ExitShort(); if H == highest(H,1) and lowest(L,2) <= highest(H,2)+PriceScale*1 Then { Sell("s",AtStop,(lowest(L,2)+highest(H,1))/2); } if MarketPosition == -1 and BarsSinceEntry == 2 Then ExitLong(); if L ==lowest(L,1) and highest(H,2) >= lowest(L,2)+PriceScale*10 Then { Buy("b1",AtStop,(highest(H,2)+lowest(L,1))/2); } if MarketPosition == 1 and BarsSinceEntry == 2 Then ExitShort(); if H == highest(H,1) and lowest(L,2) <= highest(H,2)+PriceScale*10 Then { Sell("s1",AtStop,(lowest(L,2)+highest(H,1))/2); } if MarketPosition == -1 and BarsSinceEntry == 2 Then ExitLong(); if L ==lowest(L,1) and highest(H,2) >= lowest(L,2)+PriceScale*10 Then { Buy("b2",AtStop,(highest(H,2)+lowest(L,1))/2); } if MarketPosition == 1 and BarsSinceEntry == 2 Then ExitShort(); if H == highest(H,1) and lowest(L,2) <= highest(H,2)+PriceScale*10 Then { Sell("s2",AtStop,(lowest(L,2)+highest(H,1))/2); } if MarketPosition == -1 and BarsSinceEntry == 2 Then ExitLong(); if L ==lowest(L,1) and highest(H,2) >= lowest(L,2)+PriceScale*1 Then { Buy("b3",AtStop,(highest(H,2)+lowest(L,1))/2); } if MarketPosition == 1 and BarsSinceEntry == 2 Then ExitShort(); if H == highest(H,1) and lowest(L,2) <= highest(H,2)+PriceScale*1 Then { Sell("s3",AtStop,(lowest(L,2)+highest(H,1))/2); } if MarketPosition == -1 and BarsSinceEntry == 2 Then ExitLong(); if L ==lowest(L,1) and highest(H,2) >= lowest(L,2)+PriceScale*10 Then { Buy("b4",AtStop,(highest(H,2)+lowest(L,1))/2); } if MarketPosition == 1 and BarsSinceEntry == 2 Then ExitShort(); if H == highest(H,1) and lowest(L,2) <= highest(H,2)+PriceScale*10 Then { Sell("s4",AtStop,(lowest(L,2)+highest(H,1))/2); } if MarketPosition == -1 and BarsSinceEntry == 2 Then ExitLong(); if L ==lowest(L,1) and highest(H,2) >= lowest(L,2)+PriceScale*10 Then { Buy("b5",AtStop,(highest(H,2)+lowest(L,1))/2); } if MarketPosition == 1 and BarsSinceEntry == 2 Then ExitShort(); if H == highest(H,1) and lowest(L,2) <= highest(H,2)+PriceScale*10 Then { Sell("s5",AtStop,(lowest(L,2)+highest(H,1))/2); } if MarketPosition == -1 and BarsSinceEntry == 2 Then ExitLong(); } SetStopProfittarget(PriceScale*익절틱수,PointStop); SetStopLoss(PriceScale*손절틱수,PointStop); 3 input : StartTime(70000),EndTime(50000); input : 익절틱수(50),손절틱수(0); var : Tcond(False),entry(0); Variables: Mom(0),Trade(False),X(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; Trade = 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 TotalTrades > TotalTrades[1] Then { if IsExitName("StopProfittarget",1) or IsExitName("StopLoss",1) Then { Trade = False; X = Index; } } if Trade == False and Index > X+3 Then Trade = true; if Tcond == true and Trade == False Then { if L ==lowest(L,1) and highest(H,2) >= lowest(L,2)+PriceScale*1 Then { Buy("b",AtStop,(highest(H,2)+lowest(L,1))/2); } if MarketPosition == 1 and BarsSinceEntry == 2 Then ExitShort(); if H == highest(H,1) and lowest(L,2) <= highest(H,2)+PriceScale*1 Then { Sell("s",AtStop,(lowest(L,2)+highest(H,1))/2); } if MarketPosition == -1 and BarsSinceEntry == 2 Then ExitLong(); if L ==lowest(L,1) and highest(H,2) >= lowest(L,2)+PriceScale*10 Then { Buy("b1",AtStop,(highest(H,2)+lowest(L,1))/2); } if MarketPosition == 1 and BarsSinceEntry == 2 Then ExitShort(); if H == highest(H,1) and lowest(L,2) <= highest(H,2)+PriceScale*10 Then { Sell("s1",AtStop,(lowest(L,2)+highest(H,1))/2); } if MarketPosition == -1 and BarsSinceEntry == 2 Then ExitLong(); if L ==lowest(L,1) and highest(H,2) >= lowest(L,2)+PriceScale*10 Then { Buy("b2",AtStop,(highest(H,2)+lowest(L,1))/2); } if MarketPosition == 1 and BarsSinceEntry == 2 Then ExitShort(); if H == highest(H,1) and lowest(L,2) <= highest(H,2)+PriceScale*10 Then { Sell("s2",AtStop,(lowest(L,2)+highest(H,1))/2); } if MarketPosition == -1 and BarsSinceEntry == 2 Then ExitLong(); if L ==lowest(L,1) and highest(H,2) >= lowest(L,2)+PriceScale*1 Then { Buy("b3",AtStop,(highest(H,2)+lowest(L,1))/2); } if MarketPosition == 1 and BarsSinceEntry == 2 Then ExitShort(); if H == highest(H,1) and lowest(L,2) <= highest(H,2)+PriceScale*1 Then { Sell("s3",AtStop,(lowest(L,2)+highest(H,1))/2); } if MarketPosition == -1 and BarsSinceEntry == 2 Then ExitLong(); if L ==lowest(L,1) and highest(H,2) >= lowest(L,2)+PriceScale*10 Then { Buy("b4",AtStop,(highest(H,2)+lowest(L,1))/2); } if MarketPosition == 1 and BarsSinceEntry == 2 Then ExitShort(); if H == highest(H,1) and lowest(L,2) <= highest(H,2)+PriceScale*10 Then { Sell("s4",AtStop,(lowest(L,2)+highest(H,1))/2); } if MarketPosition == -1 and BarsSinceEntry == 2 Then ExitLong(); if L ==lowest(L,1) and highest(H,2) >= lowest(L,2)+PriceScale*10 Then { Buy("b5",AtStop,(highest(H,2)+lowest(L,1))/2); } if MarketPosition == 1 and BarsSinceEntry == 2 Then ExitShort(); if H == highest(H,1) and lowest(L,2) <= highest(H,2)+PriceScale*10 Then { Sell("s5",AtStop,(lowest(L,2)+highest(H,1))/2); } if MarketPosition == -1 and BarsSinceEntry == 2 Then ExitLong(); } SetStopProfittarget(PriceScale*익절틱수,PointStop); SetStopLoss(PriceScale*손절틱수,PointStop); 즐거운 하루되세요 > 푸른 님이 쓴 글입니다. > 제목 : 문의 드립니다. > input : StartTime(70000),EndTime(50000); input : 익절틱수(50),손절틱수(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,1) and highest(H,2) >= lowest(L,2)+PriceScale*1 Then { Buy("b",AtStop,(highest(H,2)+lowest(L,1))/2); } if MarketPosition == 1 and BarsSinceEntry == 2 Then ExitShort(); } if H == highest(H,1) and lowest(L,2) <= highest(H,2)+PriceScale*1 Then { Sell("s",AtStop,(lowest(L,2)+highest(H,1))/2); } if MarketPosition == -1 and BarsSinceEntry == 2 Then ExitLong(); if L ==lowest(L,1) and highest(H,2) >= lowest(L,2)+PriceScale*10 Then { Buy("b1",AtStop,(highest(H,2)+lowest(L,1))/2); } if MarketPosition == 1 and BarsSinceEntry == 2 Then ExitShort(); if H == highest(H,1) and lowest(L,2) <= highest(H,2)+PriceScale*10 Then { Sell("s1",AtStop,(lowest(L,2)+highest(H,1))/2); } if MarketPosition == -1 and BarsSinceEntry == 2 Then ExitLong(); if L ==lowest(L,1) and highest(H,2) >= lowest(L,2)+PriceScale*10 Then { Buy("b2",AtStop,(highest(H,2)+lowest(L,1))/2); } if MarketPosition == 1 and BarsSinceEntry == 2 Then ExitShort(); if H == highest(H,1) and lowest(L,2) <= highest(H,2)+PriceScale*10 Then { Sell("s2",AtStop,(lowest(L,2)+highest(H,1))/2); } if MarketPosition == -1 and BarsSinceEntry == 2 Then ExitLong(); if L ==lowest(L,1) and highest(H,2) >= lowest(L,2)+PriceScale*1 Then { Buy("b3",AtStop,(highest(H,2)+lowest(L,1))/2); } if MarketPosition == 1 and BarsSinceEntry == 2 Then ExitShort(); if H == highest(H,1) and lowest(L,2) <= highest(H,2)+PriceScale*1 Then { Sell("s3",AtStop,(lowest(L,2)+highest(H,1))/2); } if MarketPosition == -1 and BarsSinceEntry == 2 Then ExitLong(); if L ==lowest(L,1) and highest(H,2) >= lowest(L,2)+PriceScale*10 Then { Buy("b4",AtStop,(highest(H,2)+lowest(L,1))/2); } if MarketPosition == 1 and BarsSinceEntry == 2 Then ExitShort(); if H == highest(H,1) and lowest(L,2) <= highest(H,2)+PriceScale*10 Then { Sell("s4",AtStop,(lowest(L,2)+highest(H,1))/2); } if MarketPosition == -1 and BarsSinceEntry == 2 Then ExitLong(); if L ==lowest(L,1) and highest(H,2) >= lowest(L,2)+PriceScale*10 Then { Buy("b5",AtStop,(highest(H,2)+lowest(L,1))/2); } if MarketPosition == 1 and BarsSinceEntry == 2 Then ExitShort(); if H == highest(H,1) and lowest(L,2) <= highest(H,2)+PriceScale*10 Then { Sell("s5",AtStop,(lowest(L,2)+highest(H,1))/2); } if MarketPosition == -1 and BarsSinceEntry == 2 Then ExitLong(); SetStopProfittarget(PriceScale*익절틱수,PointStop); SetStopLoss(PriceScale*손절틱수,PointStop); ------- 위 수식어에 아래 3가지가 포함된 각각 별도의 수식어를 부탁드립니다. 1. 익,손절후 당일 매매정지 2. 익절후 5시간 진입금지 3. 익절후 3번째 캔들까지 진입신호금지