커뮤니티

수식작성

프로필 이미지
푸른
2021-05-07 08:49:52
1180
글번호 148783
답변완료
input : StartTime(220000),EndTime(035000),진입횟수(5),익절틱수(40),손절틱수(25); var : Tcond(false),entry(0); if StartTime < EndTime 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 { if StartTime > EndTime Then SetStopEndofday(0); Tcond = true; entry = 0; } if (MarketPosition != 0 and MarketPosition != MarketPosition[1]) or (MarketPosition == MarketPosition[1] and TotalTrades > TotalTrades[1]) Then entry = entry+1; if Tcond == true Then { if MarketPosition == 0 and C > O and entry < 진입횟수 Then { Buy("b"); } if MarketPosition == 0 and C < O and entry < 진입횟수 Then { Sell("s"); } } SetStopProfittarget(PriceScale*익절틱수,PointStop); SetStopLoss(PriceScale*손절틱수,PointStop); ---------------------------- 당일목표수익 120틱을 수식어에 추가로 부탁드립니다.
시스템
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2021-05-07 13:19:15

안녕하세요 예스스탁입니다. input : StartTime(220000),EndTime(035000),진입횟수(5),익절틱수(40),손절틱수(25); Input : 당일수익틱수(120); var : Tcond(false),entry(0); Var : N1(0),dayPl(0),당일수익(0),Xcond(false); 당일수익 = PriceScale*당일수익틱수; if StartTime < EndTime 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 { if StartTime > EndTime Then SetStopEndofday(0); Tcond = true; entry = 0; Xcond = false; N1 = NetProfit; } daypl = NetProfit-N1; if TotalTrades > TotalTrades[1] then { if daypl >= 당일수익 Then Xcond = true; if (IsExitName("dbp",1) == true or IsExitName("dbl",1) == true or IsExitName("dsp",1) == true or IsExitName("dsl",1) == true) then Xcond = true; } if (MarketPosition != 0 and MarketPosition != MarketPosition[1]) or (MarketPosition == MarketPosition[1] and TotalTrades > TotalTrades[1]) Then entry = entry+1; if Tcond == true and Xcond == False Then { if MarketPosition == 0 and C > O and entry < 진입횟수 Then { Buy("b"); } if MarketPosition == 0 and C < O and entry < 진입횟수 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(220000),EndTime(035000),진입횟수(5),익절틱수(40),손절틱수(25); var : Tcond(false),entry(0); if StartTime < EndTime 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 { if StartTime > EndTime Then SetStopEndofday(0); Tcond = true; entry = 0; } if (MarketPosition != 0 and MarketPosition != MarketPosition[1]) or (MarketPosition == MarketPosition[1] and TotalTrades > TotalTrades[1]) Then entry = entry+1; if Tcond == true Then { if MarketPosition == 0 and C > O and entry < 진입횟수 Then { Buy("b"); } if MarketPosition == 0 and C < O and entry < 진입횟수 Then { Sell("s"); } } SetStopProfittarget(PriceScale*익절틱수,PointStop); SetStopLoss(PriceScale*손절틱수,PointStop); ---------------------------- 당일목표수익 120틱을 수식어에 추가로 부탁드립니다.