커뮤니티

수식작성

프로필 이미지
푸른
2021-05-06 07:05:09
1084
글번호 148688
답변완료

첨부 이미지

input : StartTime(223000),EndTime(0350000); input : 익절틱수(70),손절틱수(20); Input : 당일수익틱수(120); Var : N1(0),dayPl(0),당일수익(0),Xcond(false); var : T(0),Tcond(false); IF Endtime > starttime Then SetStopEndofday(Endtime); Else { if sDate != sDate[1] Then SetStopEndofday(Endtime); } if (sdate != sdate[1] and stime >= EndTime) or (sdate == sdate[1] and stime >= EndTime and stime[1] < EndTime) Then Tcond = False; if (sdate != sdate[1] and stime >= StartTime) or (sdate == sdate[1] and stime >= StartTime and stime[1] < StartTime) Then { Tcond = true; Xcond = false; N1 = NetProfit; IF Endtime <= starttime Then { SetStopEndofday(0); } } 당일수익 = PriceScale*당일수익틱수; daypl = NetProfit-N1; if TotalTrades > TotalTrades[1] then { if daypl >= 당일수익 Then Xcond = true; if IsExitName("dbp",1) == true or IsExitName("dsp",1) == true then Xcond = true; } var1 = ma(C,5); if C > O or (C == O and C >= C[1]) Then T = 1; Else T = -1; if Tcond == true Then { if MarketPosition <= 0 and C > O and CountIf(T == 1,9) >= 5 and C > var1 Then Buy("b"); if MarketPosition >= 0 and C < O and CountIf(T == -1,9) >= 5 and C < var1 Then Sell("s"); if MarketPosition == 1 then { ExitLong("dbp",atlimit,EntryPrice+((당일수익-daypl)/CurrentContracts)); } if MarketPosition == -1 then { ExitShort("dsp",atlimit,EntryPrice-((당일수익-daypl)/CurrentContracts)); } } SetStopProfittarget(PriceScale*익절틱수,PointStop); SetStopLoss(PriceScale*손절틱수,PointStop); ------------------- 매매시간 이외에 진입신호가 있습니다. 수정 부탁드려요~
시스템
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2021-05-06 10:50:19

안녕하세요 예스스탁입니다. endtime이 잘못지정되어 있었습니다. 시간은 6자리인데 0350000로 되어 있어 35시00분00초로 되어 있어 제어가 되지 않았습니다. 03시50분00초로 변경했습니다. 035000 input : StartTime(223000),EndTime(035000); input : 익절틱수(70),손절틱수(20); Input : 당일수익틱수(120); Var : N1(0),dayPl(0),당일수익(0),Xcond(false); var : T(0),Tcond(false); IF Endtime > starttime Then SetStopEndofday(Endtime); Else { if sDate != sDate[1] Then SetStopEndofday(Endtime); } if (sdate != sdate[1] and stime >= EndTime) or (sdate == sdate[1] and stime >= EndTime and stime[1] < EndTime) Then Tcond = False; if (sdate != sdate[1] and stime >= StartTime) or (sdate == sdate[1] and stime >= StartTime and stime[1] < StartTime) Then { Tcond = true; Xcond = false; N1 = NetProfit; IF Endtime <= starttime Then { SetStopEndofday(0); } } 당일수익 = PriceScale*당일수익틱수; daypl = NetProfit-N1; if TotalTrades > TotalTrades[1] then { if daypl >= 당일수익 Then Xcond = true; if IsExitName("dbp",1) == true or IsExitName("dsp",1) == true then Xcond = true; } var1 = ma(C,5); if C > O or (C == O and C >= C[1]) Then T = 1; Else T = -1; if Tcond == true Then { if MarketPosition <= 0 and C > O and CountIf(T == 1,9) >= 5 and C > var1 Then Buy("b"); if MarketPosition >= 0 and C < O and CountIf(T == -1,9) >= 5 and C < var1 Then Sell("s"); if MarketPosition == 1 then { ExitLong("dbp",atlimit,EntryPrice+((당일수익-daypl)/CurrentContracts)); } if MarketPosition == -1 then { ExitShort("dsp",atlimit,EntryPrice-((당일수익-daypl)/CurrentContracts)); } } SetStopProfittarget(PriceScale*익절틱수,PointStop); SetStopLoss(PriceScale*손절틱수,PointStop); 즐거운 하루되세요 > 푸른 님이 쓴 글입니다. > 제목 : 수식작성 > input : StartTime(223000),EndTime(0350000); input : 익절틱수(70),손절틱수(20); Input : 당일수익틱수(120); Var : N1(0),dayPl(0),당일수익(0),Xcond(false); var : T(0),Tcond(false); IF Endtime > starttime Then SetStopEndofday(Endtime); Else { if sDate != sDate[1] Then SetStopEndofday(Endtime); } if (sdate != sdate[1] and stime >= EndTime) or (sdate == sdate[1] and stime >= EndTime and stime[1] < EndTime) Then Tcond = False; if (sdate != sdate[1] and stime >= StartTime) or (sdate == sdate[1] and stime >= StartTime and stime[1] < StartTime) Then { Tcond = true; Xcond = false; N1 = NetProfit; IF Endtime <= starttime Then { SetStopEndofday(0); } } 당일수익 = PriceScale*당일수익틱수; daypl = NetProfit-N1; if TotalTrades > TotalTrades[1] then { if daypl >= 당일수익 Then Xcond = true; if IsExitName("dbp",1) == true or IsExitName("dsp",1) == true then Xcond = true; } var1 = ma(C,5); if C > O or (C == O and C >= C[1]) Then T = 1; Else T = -1; if Tcond == true Then { if MarketPosition <= 0 and C > O and CountIf(T == 1,9) >= 5 and C > var1 Then Buy("b"); if MarketPosition >= 0 and C < O and CountIf(T == -1,9) >= 5 and C < var1 Then Sell("s"); if MarketPosition == 1 then { ExitLong("dbp",atlimit,EntryPrice+((당일수익-daypl)/CurrentContracts)); } if MarketPosition == -1 then { ExitShort("dsp",atlimit,EntryPrice-((당일수익-daypl)/CurrentContracts)); } } SetStopProfittarget(PriceScale*익절틱수,PointStop); SetStopLoss(PriceScale*손절틱수,PointStop); ------------------- 매매시간 이외에 진입신호가 있습니다. 수정 부탁드려요~