커뮤니티

수식 추가요청 드립니다.

프로필 이미지
dandy
2018-02-14 10:53:53
122
글번호 116626
답변완료
> 안녕하세요. 아래 수식에서 선물 1계약 진입수량 매매하고, 1차 진입이 당일손실로 손절하는 경우우에 한하여 손절한봉 다음봉 시가에 1차진입 반대방향으로 스위칭, 2계약으로 추가진입 하고 2계약 합산수익 0.7PT이거나, 2계약 합산 추가손실 0.6PT 일경우 당일매매 종료. 수식 추가요청 드립니다. 감사합니다. //-------------------------------------------------------------------------------------------------- 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); //--------------------------------------------------------------------------------------------------
시스템
답변 2
프로필 이미지

예스스탁 예스스탁 답변

2018-02-14 14:43:22

안녕하세요 예스스탁입니다. 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,def,2); Condition1 = true; } if entry == 1 and IsExitName("dsl1",1) == true then{ Buy("SB",AtMarket,def,2); 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("sp1",1) == true or IsExitName("bp1",1) == true) and Xcond == false then { if MarketPosition(1) == 1 and Condition1 == false Then buy("bb",AtMarket); if MarketPosition(1) == -1 and Condition1 == false 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.6/CurrentContracts)); ExitLong("bp",AtLimit,EntryPrice+(0.7/CurrentContracts)); } if Condition1 == false then ExitLong("dbl",AtStop,EntryPrice-((당일손실+daypl)/CurrentContracts)); } if Condition1 == false then ExitLong("bp1",Atlimit,EntryPrice+(SSPT1/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.6/CurrentContracts)); ExitShort("sp",Atlimit,EntryPrice-(0.7/CurrentContracts)); } if Condition1 == false then ExitShort("dsl",AtStop,EntryPrice+((당일손실+daypl)/CurrentContracts)); } if Condition1 == false then ExitShort("sp1",Atlimit,EntryPrice-(SSPT1/CurrentContracts)); } SetStopEndofday(150000); 즐거운 하루되세요 > dandy 님이 쓴 글입니다. > 제목 : 수식 추가요청 드립니다. > > 안녕하세요. 아래 수식에서 선물 1계약 진입수량 매매하고, 1차 진입이 당일손실로 손절하는 경우우에 한하여 손절한봉 다음봉 시가에 1차진입 반대방향으로 스위칭, 2계약으로 추가진입 하고 2계약 합산수익 0.7PT이거나, 2계약 합산 추가손실 0.6PT 일경우 당일매매 종료. 수식 추가요청 드립니다. 감사합니다. //-------------------------------------------------------------------------------------------------- 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); //--------------------------------------------------------------------------------------------------
프로필 이미지

dandy

2018-02-14 15:50:25

안녕하세요 수정해주신 아래수식을 차트에 적용하니 진입과 청산이 계속나오네요. ( 추가 요청전 수식은 선물 1계약 진입으로 -> 당일 진입식이 매수로 1차 진입할 경우, 매수로만 2차, 3차.....진입 -> 매수 목표청산, 당일 매도진입 금지. -> 당일 진입식이 매도로 1차 진입할 경우, 매도로만 2차, 3차.....진입 -> 매도 목표청산, 당일 매수진입 금지. 그리고 목표청산후 진입은 목표 청산한봉의 다음봉 시가에 지입하는 수식입니다.) 이수식에 추가하여 1차 진입이 당일손실로 손절하는 경우우에 한하여 손절한봉 다음봉 시가에 1차진입 반대방향으로 스위칭, 2계약으로 추가진입 하고 2계약 합산수익 0.7PT이거나, 2계약 합산 추가손실 0.6PT 일경우 당일매매 종료. 감사합니다. //--------------------------------------------------------------------------------- > 예스스탁 님이 쓴 글입니다. > 제목 : Re : 수식 추가요청 드립니다. > 안녕하세요 예스스탁입니다. 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,def,2); Condition1 = true; } if entry == 1 and IsExitName("dsl1",1) == true then{ Buy("SB",AtMarket,def,2); 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("sp1",1) == true or IsExitName("bp1",1) == true) and Xcond == false then { if MarketPosition(1) == 1 and Condition1 == false Then buy("bb",AtMarket); if MarketPosition(1) == -1 and Condition1 == false 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.6/CurrentContracts)); ExitLong("bp",AtLimit,EntryPrice+(0.7/CurrentContracts)); } if Condition1 == false then ExitLong("dbl",AtStop,EntryPrice-((당일손실+daypl)/CurrentContracts)); } if Condition1 == false then ExitLong("bp1",Atlimit,EntryPrice+(SSPT1/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.6/CurrentContracts)); ExitShort("sp",Atlimit,EntryPrice-(0.7/CurrentContracts)); } if Condition1 == false then ExitShort("dsl",AtStop,EntryPrice+((당일손실+daypl)/CurrentContracts)); } if Condition1 == false then ExitShort("sp1",Atlimit,EntryPrice-(SSPT1/CurrentContracts)); } SetStopEndofday(150000); 즐거운 하루되세요 > dandy 님이 쓴 글입니다. > 제목 : 수식 추가요청 드립니다. > > 안녕하세요. 아래 수식에서 선물 1계약 진입수량 매매하고, 1차 진입이 당일손실로 손절하는 경우우에 한하여 손절한봉 다음봉 시가에 1차진입 반대방향으로 스위칭, 2계약으로 추가진입 하고 2계약 합산수익 0.7PT이거나, 2계약 합산 추가손실 0.6PT 일경우 당일매매 종료 수식만 추가요청 드립니다. 감사합니다. //-------------------------------------------------------------------------------------------------- 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); //--------------------------------------------------------------------------------------------------