커뮤니티

수식요청 드립이다.

프로필 이미지
dandy
2018-12-24 09:04:52
276
글번호 124703
답변완료
안녕하세요. 항생 분봉 틱봉 당일청산 아래 시스템에서 매수 "dbp" 당일목표수익 청산 완료된 경우 -> 매도 당일 1회 추가진입, 매도 "dsp" 당일목표수익 청산 완료된 경우 -> 매수 당일 1회 추가진입, 추가진입은 추가진입수식(예제)적용 당일 1회 추가진입, 추가익절, 추가손절 청산수식 추가요청 드립니다. 1. 당일 매매 시간 - 기존 매매 시간과 동일함. 2. 1회 추가진입 추가손절청산 - 진입가에서 20틱이상 손실발생시 추가손절청산 당일 매매종료. 3. 1회 추가진입 추가익절청산 - 진입가에서 25틱이상 수익발생하고, 매수기준 현제봉이 5일평을 하향돌파시 추가익절청산 당일 매매종료. 수식 추가요청 드립이다. 감사합니다 //---------------------------------------------------------------------------------- # 추가진입수식(예제) Input : Period(9),추가익절(25),추가손절(20); If CrossUp(CCI(Period), 0) Then{ Buy("추가매수"); } If CrossDown(CCI(Period), 0) Then{ Sell(추가매도"); } //---------------------------------------------------------------------------------- # 시스템수식 Input : 익절(15),손절(10),당일목표수익(90),당일목표손실(50); input : 시작시간1(101500),종료시간1(125500),시작시간2(140000),종료시간2(151500); Input : Period(12), sigPeriod(9); var : Tcond(false); Var : N1(0),dayPl(0),당일수익(0),당일손실(0),Xcond(false); 당일수익 = PriceScale*당일목표수익; 당일손실 = PriceScale*당일목표손실; daypl = NetProfit-N1; if (sdate != sdate[1] and stime >= 시작시간1) or (sdate == sdate[1] and stime >= 시작시간1 and stime[1] < 시작시간1) Then { Tcond = true; Xcond = false; N1 = NetProfit; } if (sdate != sdate[1] and stime >= 종료시간1) or (sdate == sdate[1] and stime >= 종료시간1 and stime[1] < 종료시간1) Then { Tcond = false; if MarketPosition == 1 Then ExitLong("bx1"); if MarketPosition == -1 Then ExitShort("sx1"); } if (sdate != sdate[1] and stime >= 시작시간2) or (sdate == sdate[1] and stime >= 시작시간2 and stime[1] < 시작시간2) Then { Tcond = true; } if (sdate != sdate[1] and stime >= 종료시간2) or (sdate == sdate[1] and stime >= 종료시간2 and stime[1] < 종료시간2) Then { Tcond = false; if MarketPosition == 1 Then ExitLong("bx2"); if MarketPosition == -1 Then ExitShort("sx2"); } if TotalTrades > TotalTrades[1] then { if (IsExitName("dbp",1) == true or IsExitName("dbl",1) == true or IsExitName("dsp",1) == true or IsExitName("dsl",1) == true) then Xcond = true; if daypl >= 당일수익 or daypl <= -당일손실 Then Xcond = true; } value1 = TRIX(Period); value2 = ema(value1, sigPeriod); if Tcond == true and Xcond == false then { If CrossUP(value1, value2) Then Buy("b"); If CrossDown(value1, value2) Then Sell("s"); } if MarketPosition == 1 then { ExitLong("dbp",atlimit,EntryPrice+((당일수익-daypl)/CurrentContracts)); ExitLong("dbl",AtStop,EntryPrice-((당일손실+daypl)/CurrentContracts)); ExitLong("bp",Atlimit,EntryPrice+PriceScale*익절); ExitLong("bl",AtStop,EntryPrice-PriceScale*손절); } if MarketPosition == -1 then { ExitShort("dsp",atlimit,EntryPrice-((당일수익-daypl)/CurrentContracts)); ExitShort("dsl",AtStop,EntryPrice+((당일손실+daypl)/CurrentContracts)); ExitShort("sp",Atlimit,EntryPrice-PriceScale*익절); ExitShort("sl",AtStop,EntryPrice+PriceScale*손절); }
시스템
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2018-12-24 13:09:47

안녕하세요 예스스탁입니다. Input : 익절(15),손절(10),당일목표수익(90),당일목표손실(50); input : 시작시간1(101500),종료시간1(125500),시작시간2(140000),종료시간2(151500); Input : Period(12), sigPeriod(9); var : Tcond(false); Var : N1(0),dayPl(0),당일수익(0),당일손실(0),Xcond(false); 당일수익 = PriceScale*당일목표수익; 당일손실 = PriceScale*당일목표손실; daypl = NetProfit-N1; if (sdate != sdate[1] and stime >= 시작시간1) or (sdate == sdate[1] and stime >= 시작시간1 and stime[1] < 시작시간1) Then { Tcond = true; Xcond = false; N1 = NetProfit; } if (sdate != sdate[1] and stime >= 종료시간1) or (sdate == sdate[1] and stime >= 종료시간1 and stime[1] < 종료시간1) Then { Tcond = false; if MarketPosition == 1 Then ExitLong("bx1"); if MarketPosition == -1 Then ExitShort("sx1"); } if (sdate != sdate[1] and stime >= 시작시간2) or (sdate == sdate[1] and stime >= 시작시간2 and stime[1] < 시작시간2) Then { Tcond = true; } if (sdate != sdate[1] and stime >= 종료시간2) or (sdate == sdate[1] and stime >= 종료시간2 and stime[1] < 종료시간2) Then { Tcond = false; if MarketPosition == 1 Then ExitLong("bx2"); if MarketPosition == -1 Then ExitShort("sx2"); } if TotalTrades > TotalTrades[1] then { if (IsExitName("dbp",1) == true or IsExitName("dbl",1) == true or IsExitName("dsp",1) == true or IsExitName("dsl",1) == true) then Xcond = true; if daypl >= 당일수익 or daypl <= -당일손실 Then Xcond = true; } value1 = TRIX(Period); value2 = ema(value1, sigPeriod); if Tcond == true and Xcond == false then { If CrossUP(value1, value2) Then Buy("b"); If CrossDown(value1, value2) Then Sell("s"); } if MarketPosition == 1 and Xcond == false then { ExitLong("dbp",atlimit,EntryPrice+((당일수익-daypl)/CurrentContracts)); ExitLong("dbl",AtStop,EntryPrice-((당일손실+daypl)/CurrentContracts)); ExitLong("bp",Atlimit,EntryPrice+PriceScale*익절); ExitLong("bl",AtStop,EntryPrice-PriceScale*손절); } if MarketPosition == -1 and Xcond == false then { ExitShort("dsp",atlimit,EntryPrice-((당일수익-daypl)/CurrentContracts)); ExitShort("dsl",AtStop,EntryPrice+((당일손실+daypl)/CurrentContracts)); ExitShort("sp",Atlimit,EntryPrice-PriceScale*익절); ExitShort("sl",AtStop,EntryPrice+PriceScale*손절); } Input : CCIP(9),추가익절(25),추가손절(20),P(5); var : CCIV(0),mav(0); CCIv = CCI(CCIP); mav = ma(C,P); if Tcond == true and Xcond == true then { If MarketPosition == 0 and MarketPosition(1) == 1 and IsExitName("dsp",1) == true and CrossUp(CCIv, 0) Then{ Buy("추가매수"); } If MarketPosition == 0 and MarketPosition(1) == 1 and IsExitName("dbp",1) == true and CrossDown(CCIv, 0) Then { Sell("추가매도"); } if MarketPosition == 1 then { ExitLong("bx",AtStop,EntryPrice-PriceScale*추가손절); if highest(H,BarsSinceEntry) >= EntryPrice+PriceScale*추가익절 and CrossDown(c,mav) Then exitlong(); } if MarketPosition == -1 then { ExitShort("sx",AtStop,EntryPrice-PriceScale*추가손절); if Lowest(L,BarsSinceEntry) <= EntryPrice-PriceScale*추가익절 and CrossUp(c,mav) Then ExitShort(); } } 즐거운 하루되세요 > dandy 님이 쓴 글입니다. > 제목 : 수식요청 드립이다. > 안녕하세요. 항생 분봉 틱봉 당일청산 아래 시스템에서 매수 "dbp" 당일목표수익 청산 완료된 경우 -> 매도 당일 1회 추가진입, 매도 "dsp" 당일목표수익 청산 완료된 경우 -> 매수 당일 1회 추가진입, 추가진입은 추가진입수식(예제)적용 당일 1회 추가진입, 추가익절, 추가손절 청산수식 추가요청 드립니다. 1. 당일 매매 시간 - 기존 매매 시간과 동일함. 2. 1회 추가진입 추가손절청산 - 진입가에서 20틱이상 손실발생시 추가손절청산 당일 매매종료. 3. 1회 추가진입 추가익절청산 - 진입가에서 25틱이상 수익발생하고, 매수기준 현제봉이 5일평을 하향돌파시 추가익절청산 당일 매매종료. 수식 추가요청 드립이다. 감사합니다 //---------------------------------------------------------------------------------- # 추가진입수식(예제) Input : Period(9),추가익절(25),추가손절(20); If CrossUp(CCI(Period), 0) Then{ Buy("추가매수"); } If CrossDown(CCI(Period), 0) Then{ Sell(추가매도"); } //---------------------------------------------------------------------------------- # 시스템수식 Input : 익절(15),손절(10),당일목표수익(90),당일목표손실(50); input : 시작시간1(101500),종료시간1(125500),시작시간2(140000),종료시간2(151500); Input : Period(12), sigPeriod(9); var : Tcond(false); Var : N1(0),dayPl(0),당일수익(0),당일손실(0),Xcond(false); 당일수익 = PriceScale*당일목표수익; 당일손실 = PriceScale*당일목표손실; daypl = NetProfit-N1; if (sdate != sdate[1] and stime >= 시작시간1) or (sdate == sdate[1] and stime >= 시작시간1 and stime[1] < 시작시간1) Then { Tcond = true; Xcond = false; N1 = NetProfit; } if (sdate != sdate[1] and stime >= 종료시간1) or (sdate == sdate[1] and stime >= 종료시간1 and stime[1] < 종료시간1) Then { Tcond = false; if MarketPosition == 1 Then ExitLong("bx1"); if MarketPosition == -1 Then ExitShort("sx1"); } if (sdate != sdate[1] and stime >= 시작시간2) or (sdate == sdate[1] and stime >= 시작시간2 and stime[1] < 시작시간2) Then { Tcond = true; } if (sdate != sdate[1] and stime >= 종료시간2) or (sdate == sdate[1] and stime >= 종료시간2 and stime[1] < 종료시간2) Then { Tcond = false; if MarketPosition == 1 Then ExitLong("bx2"); if MarketPosition == -1 Then ExitShort("sx2"); } if TotalTrades > TotalTrades[1] then { if (IsExitName("dbp",1) == true or IsExitName("dbl",1) == true or IsExitName("dsp",1) == true or IsExitName("dsl",1) == true) then Xcond = true; if daypl >= 당일수익 or daypl <= -당일손실 Then Xcond = true; } value1 = TRIX(Period); value2 = ema(value1, sigPeriod); if Tcond == true and Xcond == false then { If CrossUP(value1, value2) Then Buy("b"); If CrossDown(value1, value2) Then Sell("s"); } if MarketPosition == 1 then { ExitLong("dbp",atlimit,EntryPrice+((당일수익-daypl)/CurrentContracts)); ExitLong("dbl",AtStop,EntryPrice-((당일손실+daypl)/CurrentContracts)); ExitLong("bp",Atlimit,EntryPrice+PriceScale*익절); ExitLong("bl",AtStop,EntryPrice-PriceScale*손절); } if MarketPosition == -1 then { ExitShort("dsp",atlimit,EntryPrice-((당일수익-daypl)/CurrentContracts)); ExitShort("dsl",AtStop,EntryPrice+((당일손실+daypl)/CurrentContracts)); ExitShort("sp",Atlimit,EntryPrice-PriceScale*익절); ExitShort("sl",AtStop,EntryPrice+PriceScale*손절); }