커뮤니티

수고하십니다

프로필 이미지
수원
2019-10-15 07:15:37
170
글번호 132781
답변완료
아래식에서 수익이 30틱갓다가 10틱으로 내려오면 강제청산 추가식부탁합니다 input : starttime(100000),endtime(050000); input : P1(5),P2(20); input : 익절틱수(50),손절틱수(50); Input : 당일수익틱수(80),당일손실틱수(80); input : 당일진입횟수(5); var : Tcond(false),entry(0); Var : N1(0),dayPl(0),당일수익(0),당일손실(0),Xcond(false); 당일수익 = PriceScale*당일수익틱수; 당일손실 = PriceScale*당일손실틱수; if (sdate != sdate[1] and stime >= endtime) or (sdate == sdate[1] and stime >= endtime and stime[1] < endtime) then { Tcond = false; if MarketPosition == 1 Then ExitLong("bx"); if MarketPosition == -1 Then ExitShort("sx"); } 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; entry = 0; } var1 = ma(C,P1); var2 = ma(C,P2); if MarketPosition(0) != 0 and MarketPosition(0) != MarketPosition(0)[1] Then entry = entry+1; if Tcond == true then { daypl = NetProfit-N1; if TotalTrades > TotalTrades[1] and (IsExitName("dbp",1) == true or IsExitName("dbl",1) == true or IsExitName("dsp",1) == true or IsExitName("dsl",1) == true) then Xcond = true; if Xcond == false and entry < 당일진입횟수 then { if crossup(var1,var2) Then buy("b"); if CrossDown(var1,var2) Then sell("s"); } if MarketPosition == 1 then{ ExitLong("dbp",atlimit,EntryPrice+((당일수익-daypl)/CurrentContracts)); ExitLong("dbl",AtStop,EntryPrice-((당일손실+daypl)/CurrentContracts)); } if MarketPosition == -1 then{ ExitShort("dsp",atlimit,EntryPrice-((당일수익-daypl)/CurrentContracts)); ExitShort("dsl",AtStop,EntryPrice+((당일손실+daypl)/CurrentContracts)); } } SetStopProfittarget(PriceScale*익절틱수,PointStop); SetStopLoss(PriceScale*손절틱수,PointStop);
시스템
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2019-10-15 15:55:42

안녕하세요 예스스탁입니다. input : starttime(100000),endtime(050000); input : P1(5),P2(20); input : 익절틱수(50),손절틱수(50); Input : 당일수익틱수(80),당일손실틱수(80); input : 당일진입횟수(5); var : Tcond(false),entry(0); Var : N1(0),dayPl(0),당일수익(0),당일손실(0),Xcond(false); 당일수익 = PriceScale*당일수익틱수; 당일손실 = PriceScale*당일손실틱수; if (sdate != sdate[1] and stime >= endtime) or (sdate == sdate[1] and stime >= endtime and stime[1] < endtime) then { Tcond = false; if MarketPosition == 1 Then ExitLong("bx"); if MarketPosition == -1 Then ExitShort("sx"); } 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; entry = 0; } var1 = ma(C,P1); var2 = ma(C,P2); if MarketPosition(0) != 0 and MarketPosition(0) != MarketPosition(0)[1] Then entry = entry+1; if Tcond == true then { daypl = NetProfit-N1; if TotalTrades > TotalTrades[1] and (IsExitName("dbp",1) == true or IsExitName("dbl",1) == true or IsExitName("dsp",1) == true or IsExitName("dsl",1) == true) then Xcond = true; if Xcond == false and entry < 당일진입횟수 then { if crossup(var1,var2) Then buy("b"); if CrossDown(var1,var2) Then sell("s"); } if MarketPosition == 1 then { ExitLong("dbp",atlimit,EntryPrice+((당일수익-daypl)/CurrentContracts)); ExitLong("dbl",AtStop,EntryPrice-((당일손실+daypl)/CurrentContracts)); if highest(h,BarsSinceEntry) >= EntryPrice+PriceScale*30 Then exitlong("btr",AtStop,EntryPrice+PriceScale*10); } if MarketPosition == -1 then { ExitShort("dsp",atlimit,EntryPrice-((당일수익-daypl)/CurrentContracts)); ExitShort("dsl",AtStop,EntryPrice+((당일손실+daypl)/CurrentContracts)); if Lowest(l,BarsSinceEntry) <= EntryPrice-PriceScale*30 Then ExitShort("str",AtStop,EntryPrice-PriceScale*10); } } SetStopProfittarget(PriceScale*익절틱수,PointStop); SetStopLoss(PriceScale*손절틱수,PointStop); 즐거운 하루되세요 > 수원 님이 쓴 글입니다. > 제목 : 수고하십니다 > 아래식에서 수익이 30틱갓다가 10틱으로 내려오면 강제청산 추가식부탁합니다 input : starttime(100000),endtime(050000); input : P1(5),P2(20); input : 익절틱수(50),손절틱수(50); Input : 당일수익틱수(80),당일손실틱수(80); input : 당일진입횟수(5); var : Tcond(false),entry(0); Var : N1(0),dayPl(0),당일수익(0),당일손실(0),Xcond(false); 당일수익 = PriceScale*당일수익틱수; 당일손실 = PriceScale*당일손실틱수; if (sdate != sdate[1] and stime >= endtime) or (sdate == sdate[1] and stime >= endtime and stime[1] < endtime) then { Tcond = false; if MarketPosition == 1 Then ExitLong("bx"); if MarketPosition == -1 Then ExitShort("sx"); } 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; entry = 0; } var1 = ma(C,P1); var2 = ma(C,P2); if MarketPosition(0) != 0 and MarketPosition(0) != MarketPosition(0)[1] Then entry = entry+1; if Tcond == true then { daypl = NetProfit-N1; if TotalTrades > TotalTrades[1] and (IsExitName("dbp",1) == true or IsExitName("dbl",1) == true or IsExitName("dsp",1) == true or IsExitName("dsl",1) == true) then Xcond = true; if Xcond == false and entry < 당일진입횟수 then { if crossup(var1,var2) Then buy("b"); if CrossDown(var1,var2) Then sell("s"); } if MarketPosition == 1 then{ ExitLong("dbp",atlimit,EntryPrice+((당일수익-daypl)/CurrentContracts)); ExitLong("dbl",AtStop,EntryPrice-((당일손실+daypl)/CurrentContracts)); } if MarketPosition == -1 then{ ExitShort("dsp",atlimit,EntryPrice-((당일수익-daypl)/CurrentContracts)); ExitShort("dsl",AtStop,EntryPrice+((당일손실+daypl)/CurrentContracts)); } } SetStopProfittarget(PriceScale*익절틱수,PointStop); SetStopLoss(PriceScale*손절틱수,PointStop);