커뮤니티

문의 드립니다.

프로필 이미지
푸른
2024-03-19 18:46:55
458
글번호 177652
답변완료
게시판 86286 3가지 답변의 수식어 신호가 전혀 없습니다. 어떠한 문제가 있는지요.
시스템
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2024-03-19 19:07:21

안녕하세요 예스스탁입니다. 변수 할당에 오류가 있어 수정했습니다. 현재 모든 진입이 봉완성시에 셋팅이 되어 다음봉 미완성시에 진입하는 내용입니다. 기본적으로 진입에 대한 제어는 if문으로 지정이 되어야 하는데 if문은 봉완성시를 기준으로 하므로 봉 중간에 청산조건이 조건충족되어도 미완성시에 발생하는 신호는 막을 방법이 없습니다. 이용에 참고하시기 바랍니다. 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 == 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); 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) Then { Trade = False; X = TM; } } if Trade == False and TM >= X+300 Then Trade = true; if Tcond == true and Trade == 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 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) Then { Trade = False; X = Index; } } if Trade == False and Index > X+3 Then Trade = true; if Tcond == true and Trade == 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); 즐거운 하루되세요 > 푸른 님이 쓴 글입니다. > 제목 : 문의 드립니다. > 게시판 86286 3가지 답변의 수식어 신호가 전혀 없습니다. 어떠한 문제가 있는지요.