커뮤니티

수식 추가요청 드립니다.

프로필 이미지
dandy
2018-02-13 14:27:48
153
글번호 116588
답변완료
안녕하세요. -> 아래 진입수식에서 1차진입이 당일손실로 손절하는 경우에만, 손절하는봉 다음봉 시가에 1차진입의 반대방향으로 스위칭 추가진입 하고, 추가진입 손실이 0.7PT 이상 발생시 손절청산 당일 매매종료. -> 당일손실 추가진입이 목표청산하는 경우 -> 2차, 3차..... 동일방향 다음봉 시가에 진입 -> 목표청산, 추가진입 후 진입 손실이 0.7PT 이상 발생하는 경우 손절청산 매매종료, 수식 추가요청 드립니다. 감사합니다. //-------------------------------------------------------------------------------------------------- Input : Period(12), sigPeriod(9),SSPT1(0.5),당일손실(1.0); var : N1(0),daypl(0),Xcond(false),T1(0),entry(0); if Bdate != Bdate[1] Then{ Xcond = false; N1 = NetProfit; T1 = TotalTrades; } if MarketPosition == 0 Then entry = TotalTrades-T1; Else entry = TotalTrades-T1+1; daypl = NetProfit-N1; if TotalTrades > TotalTrades[1] and (IsExitName("dbl",1) == true or IsExitName("dsl",1) == true) then Xcond = true; daypl = NetProfit-N1; value1 = TRIX(Period); value2 = ema(value1, sigPeriod); if MarketPosition == 0 and TotalTrades > TotalTrades[1] and IsExitName("StopProfitTarget",1) == true and Xcond == false then{ if MarketPosition(1) == 1 Then buy("bb",AtMarket); if MarketPosition(1) == -1 Then sell("ss",AtMarket); } If CrossUP(value1, value2) and Xcond == false and entry < 1 Then { Buy(); } If CrossDown(value1, value2) and Xcond == false and entry < 1 Then { Sell(); } if MarketPosition == 1 then{ ExitLong("dbl",AtStop,EntryPrice-((당일손실+daypl)/CurrentContracts)); } if MarketPosition == -1 then{ ExitShort("dsl",AtStop,EntryPrice+((당일손실+daypl)/CurrentContracts)); } SetStopPosition; SetStopProfittarget(SSPT1,PointStop); SetStopEndofday(150000); //--------------------------------------------------------------------------------------------------
시스템
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2018-02-13 16:58:44

안녕하세요 예스스탁입니다. Input : Period(12), sigPeriod(9),SSPT1(0.5),당일손실(1.0); var : N1(0),daypl(0),Xcond(false),T1(0),entry(0); if Bdate != Bdate[1] Then{ Xcond = false; N1 = NetProfit; T1 = TotalTrades; Condition1 = false; } if MarketPosition == 0 Then entry = TotalTrades-T1; Else entry = TotalTrades-T1+1; daypl = NetProfit-N1; if TotalTrades > TotalTrades[1] then { if entry == 1 and IsExitName("dbl1",1) == true Then{ Sell("BS",AtMarket); Condition1 = true; } if entry == 1 and IsExitName("dsl1",1) == true then{ Buy("SB",AtMarket); Condition1 = true; } if entry >= 2 and (IsExitName("dbl",1) == true or IsExitName("dsl",1) == true or IsExitName("bl",1) == true or IsExitName("bl",1) == true ) then Xcond = true; } daypl = NetProfit-N1; value1 = TRIX(Period); value2 = ema(value1, sigPeriod); if MarketPosition == 0 and TotalTrades > TotalTrades[1] and IsExitName("StopProfitTarget",1) == true and Xcond == false then{ if MarketPosition(1) == 1 Then buy("bb",AtMarket); if MarketPosition(1) == -1 Then sell("ss",AtMarket); } If CrossUP(value1, value2) and Xcond == false and entry < 1 Then { Buy(); } If CrossDown(value1, value2) and Xcond == false and entry < 1 Then { Sell(); } if MarketPosition == 1 then{ if entry == 1 Then ExitLong("dbl1",AtStop,EntryPrice-((당일손실+daypl)/CurrentContracts)); if entry >= 2 then{ if Condition1 == true then ExitLong("bl",AtStop,EntryPrice-0.7); if Condition1 == false then ExitLong("dbl",AtStop,EntryPrice-((당일손실+daypl)/CurrentContracts)); } } if MarketPosition == -1 then{ if entry == 1 then ExitShort("dsl1",AtStop,EntryPrice+((당일손실+daypl)/CurrentContracts)); if entry >= 2 then{ if Condition1 == true then ExitShort("sl",AtStop,EntryPrice+0.7); if Condition1 == false then ExitShort("dsl",AtStop,EntryPrice+((당일손실+daypl)/CurrentContracts)); } } SetStopPosition; SetStopProfittarget(SSPT1,PointStop); SetStopEndofday(150000); 즐거운 하루되세요 > dandy 님이 쓴 글입니다. > 제목 : 수식 추가요청 드립니다. > 안녕하세요. -> 아래 진입수식에서 1차진입이 당일손실로 손절하는 경우에만, 손절하는봉 다음봉 시가에 1차진입의 반대방향으로 스위칭 추가진입 하고, 추가진입 손실이 0.7PT 이상 발생시 손절청산 당일 매매종료. -> 당일손실 추가진입이 목표청산하는 경우 -> 2차, 3차..... 동일방향 다음봉 시가에 진입 -> 목표청산, 추가진입 후 진입 손실이 0.7PT 이상 발생하는 경우 손절청산 매매종료, 수식 추가요청 드립니다. 감사합니다. //-------------------------------------------------------------------------------------------------- Input : Period(12), sigPeriod(9),SSPT1(0.5),당일손실(1.0); var : N1(0),daypl(0),Xcond(false),T1(0),entry(0); if Bdate != Bdate[1] Then{ Xcond = false; N1 = NetProfit; T1 = TotalTrades; } if MarketPosition == 0 Then entry = TotalTrades-T1; Else entry = TotalTrades-T1+1; daypl = NetProfit-N1; if TotalTrades > TotalTrades[1] and (IsExitName("dbl",1) == true or IsExitName("dsl",1) == true) then Xcond = true; daypl = NetProfit-N1; value1 = TRIX(Period); value2 = ema(value1, sigPeriod); if MarketPosition == 0 and TotalTrades > TotalTrades[1] and IsExitName("StopProfitTarget",1) == true and Xcond == false then{ if MarketPosition(1) == 1 Then buy("bb",AtMarket); if MarketPosition(1) == -1 Then sell("ss",AtMarket); } If CrossUP(value1, value2) and Xcond == false and entry < 1 Then { Buy(); } If CrossDown(value1, value2) and Xcond == false and entry < 1 Then { Sell(); } if MarketPosition == 1 then{ ExitLong("dbl",AtStop,EntryPrice-((당일손실+daypl)/CurrentContracts)); } if MarketPosition == -1 then{ ExitShort("dsl",AtStop,EntryPrice+((당일손실+daypl)/CurrentContracts)); } SetStopPosition; SetStopProfittarget(SSPT1,PointStop); SetStopEndofday(150000); //--------------------------------------------------------------------------------------------------