커뮤니티

수식 검토 요청드립니다.

프로필 이미지
고박사122
2024-02-19 07:30:50
1122
글번호 176728
답변완료
안녕하세요. 운영자님 다음 시스템은 한번 진입시 3계약 진입하여 3번에 걸쳐 나누어 분할 익절하고자 만든 시스템입니다. 뭔가 문제가 있는 것 같은데 검토 부탁드립니다. 또한, 진입조건식에서 매수인 경우 R1 > R2 and R2 > R3 으로 되어 있는데 이것을 기준선 50 이상에서 R1 > R2 and R2 > R3 이 되도록 부탁드립니다. 매도역시 R1 < R2 and R2 < R3 으로 되어 있는데 이것을 기준선 50 이하에서 R1 < R2 and R2 < R3 이 되도록 부탁드립니다. input : TradingTime(1),StartTime(160000),EndTime(045000),ProfitTickCount1(6),ProfitTickCount2(12),ProfitTickCount3(18),LossTickCount (10); input : P1(7),P2(14),P3(21); input : ADXP(14),value(20); input : af(0.02),maxaf(0.2); input : Period(50); input : CumulativeLossTicks(100); var : R1(0),R2(0),R3(0),AA(0),MM(0),MS(0),SS(0),EE(0), HH(0), LL(0); var : Xcond(false),N1(0),daypl(0),CumulativeLoss(0); R1 = RSI(P1); R2 = RSI(P2); R3 = RSI(P3); AA = ADX(ADXP); SS = sar(af,maxaf); EE = Ema(C,Period); if TradingTime == 1 then condition3 = (stime>=StartTime or stime<=EndTime ); Else if TradingTime == 2 then condition3 = (stime>=StartTime and stime<=EndTime ); Else condition3 = true; if TradingTime == 1 or TradingTime == 2 then { if (sdate != sdate[1] and stime >= StartTime) or (sdate == sdate[1] and stime >= StartTime and stime[1] < StartTime) Then { Xcond = false; N1 = NetProfit; } } else { if Bdate != Bdate[1] Then { Xcond = false; N1 = NetProfit; } } CumulativeLoss = PriceScale*CumulativeLossTicks; daypl = NetProfit-N1; if TotalTrades > TotalTrades[1] and (IsExitName("dbl",1) == true or IsExitName("dsl",1) == true) then Xcond = true; If MarketPosition == 0 and TotalTrades == TotalTrades[1] and Condition3 == true and R1 > R2 and R2 > R3 and AA > value and C > SS and C > EE Then Buy(); If MarketPosition == 0 and TotalTrades == TotalTrades[1] and Condition3 == true and R1 < R2 and R2 < R3 and AA < value and C < SS and C < EE Then Sell(); if MarketPosition == 1 Then{ ExitLong("bp1",atlimit,EntryPrice+PriceScale*ProfitTickCount1,"",1,1); ExitLong("bp2",atlimit,EntryPrice+PriceScale*ProfitTickCount2,"",1,1); ExitLong("bp3",atlimit,EntryPrice+PriceScale*ProfitTickCount3); } if MarketPosition == -1 Then{ ExitShort("sp1",atlimit,EntryPrice-PriceScale*ProfitTickCount1,"",1,1); ExitShort("sp2",atlimit,EntryPrice-PriceScale*ProfitTickCount2,"",1,1); ExitShort("sp3",atlimit,EntryPrice-PriceScale*ProfitTickCount3); }
시스템
답변 2
프로필 이미지

예스스탁 예스스탁 답변

2024-02-19 14:21:38

안녕하세요 예스스탁입니다. 올려주신 수식 분할청산에 문제가 없습니다. 설정창에서 수량을 3으로 지정하고 적용하시면 3회 분할 익절이 됩니다. 시스템의 수량은 수식안 진입함수에 수량을 지정하지 않으면 설정청에서 지정한 수량이 적용됩니다. 수식에 진입수량을 3으로 지정해 드립니다. 진입조건에도 언급하신 내용을 추가했습니다. input : TradingTime(1),StartTime(160000),EndTime(045000); input : ProfitTickCount1(6),ProfitTickCount2(12),ProfitTickCount3(18),LossTickCount (10); input : P1(7),P2(14),P3(21); input : ADXP(14),value(20); input : af(0.02),maxaf(0.2); input : Period(50); input : CumulativeLossTicks(100); var : R1(0),R2(0),R3(0),AA(0),MM(0),MS(0),SS(0),EE(0), HH(0), LL(0); var : Xcond(false),N1(0),daypl(0),CumulativeLoss(0); R1 = RSI(P1); R2 = RSI(P2); R3 = RSI(P3); AA = ADX(ADXP); SS = sar(af,maxaf); EE = Ema(C,Period); if TradingTime == 1 then condition3 = (stime>=StartTime or stime<=EndTime ); Else if TradingTime == 2 then condition3 = (stime>=StartTime and stime<=EndTime ); Else condition3 = true; if TradingTime == 1 or TradingTime == 2 then { if (sdate != sdate[1] and stime >= StartTime) or (sdate == sdate[1] and stime >= StartTime and stime[1] < StartTime) Then { Xcond = false; N1 = NetProfit; } } else { if Bdate != Bdate[1] Then { Xcond = false; N1 = NetProfit; } } CumulativeLoss = PriceScale*CumulativeLossTicks; daypl = NetProfit-N1; if TotalTrades > TotalTrades[1] and (IsExitName("dbl",1) == true or IsExitName("dsl",1) == true) then Xcond = true; If MarketPosition == 0 and TotalTrades == TotalTrades[1] and Condition3 == true and R1 > R2 and R2 > R3 and R3 >= 50 and AA > value and C > SS and C > EE Then Buy("b",OnClose,Def,3); If MarketPosition == 0 and TotalTrades == TotalTrades[1] and Condition3 == true and R1 < R2 and R2 < R3 and R3 <= 50 and AA < value and C < SS and C < EE Then Sell("s",OnClose,Def,3); if MarketPosition == 1 Then { ExitLong("bp1",atlimit,EntryPrice+PriceScale*ProfitTickCount1,"",1,1); ExitLong("bp2",atlimit,EntryPrice+PriceScale*ProfitTickCount2,"",1,1); ExitLong("bp3",atlimit,EntryPrice+PriceScale*ProfitTickCount3); } if MarketPosition == -1 Then { ExitShort("sp1",atlimit,EntryPrice-PriceScale*ProfitTickCount1,"",1,1); ExitShort("sp2",atlimit,EntryPrice-PriceScale*ProfitTickCount2,"",1,1); ExitShort("sp3",atlimit,EntryPrice-PriceScale*ProfitTickCount3); } 즐거운 하루되세요 > 고박사122 님이 쓴 글입니다. > 제목 : 수식 검토 요청드립니다. > 안녕하세요. 운영자님 다음 시스템은 한번 진입시 3계약 진입하여 3번에 걸쳐 나누어 분할 익절하고자 만든 시스템입니다. 뭔가 문제가 있는 것 같은데 검토 부탁드립니다. 또한, 진입조건식에서 매수인 경우 R1 > R2 and R2 > R3 으로 되어 있는데 이것을 기준선 50 이상에서 R1 > R2 and R2 > R3 이 되도록 부탁드립니다. 매도역시 R1 < R2 and R2 < R3 으로 되어 있는데 이것을 기준선 50 이하에서 R1 < R2 and R2 < R3 이 되도록 부탁드립니다. input : TradingTime(1),StartTime(160000),EndTime(045000),ProfitTickCount1(6),ProfitTickCount2(12),ProfitTickCount3(18),LossTickCount (10); input : P1(7),P2(14),P3(21); input : ADXP(14),value(20); input : af(0.02),maxaf(0.2); input : Period(50); input : CumulativeLossTicks(100); var : R1(0),R2(0),R3(0),AA(0),MM(0),MS(0),SS(0),EE(0), HH(0), LL(0); var : Xcond(false),N1(0),daypl(0),CumulativeLoss(0); R1 = RSI(P1); R2 = RSI(P2); R3 = RSI(P3); AA = ADX(ADXP); SS = sar(af,maxaf); EE = Ema(C,Period); if TradingTime == 1 then condition3 = (stime>=StartTime or stime<=EndTime ); Else if TradingTime == 2 then condition3 = (stime>=StartTime and stime<=EndTime ); Else condition3 = true; if TradingTime == 1 or TradingTime == 2 then { if (sdate != sdate[1] and stime >= StartTime) or (sdate == sdate[1] and stime >= StartTime and stime[1] < StartTime) Then { Xcond = false; N1 = NetProfit; } } else { if Bdate != Bdate[1] Then { Xcond = false; N1 = NetProfit; } } CumulativeLoss = PriceScale*CumulativeLossTicks; daypl = NetProfit-N1; if TotalTrades > TotalTrades[1] and (IsExitName("dbl",1) == true or IsExitName("dsl",1) == true) then Xcond = true; If MarketPosition == 0 and TotalTrades == TotalTrades[1] and Condition3 == true and R1 > R2 and R2 > R3 and AA > value and C > SS and C > EE Then Buy(); If MarketPosition == 0 and TotalTrades == TotalTrades[1] and Condition3 == true and R1 < R2 and R2 < R3 and AA < value and C < SS and C < EE Then Sell(); if MarketPosition == 1 Then{ ExitLong("bp1",atlimit,EntryPrice+PriceScale*ProfitTickCount1,"",1,1); ExitLong("bp2",atlimit,EntryPrice+PriceScale*ProfitTickCount2,"",1,1); ExitLong("bp3",atlimit,EntryPrice+PriceScale*ProfitTickCount3); } if MarketPosition == -1 Then{ ExitShort("sp1",atlimit,EntryPrice-PriceScale*ProfitTickCount1,"",1,1); ExitShort("sp2",atlimit,EntryPrice-PriceScale*ProfitTickCount2,"",1,1); ExitShort("sp3",atlimit,EntryPrice-PriceScale*ProfitTickCount3); }
프로필 이미지

고박사122

2024-02-20 08:05:29

안녕하세요. 수식 검토해 주셔서 감사합니다. 나스닥 시뮬레이션 챠트에서 구현해 보면 손실거래가 잡히지 않습니다. 점검 부탁드립니다. > 예스스탁 님이 쓴 글입니다. > 제목 : Re : 수식 검토 요청드립니다. > 안녕하세요 예스스탁입니다. 올려주신 수식 분할청산에 문제가 없습니다. 설정창에서 수량을 3으로 지정하고 적용하시면 3회 분할 익절이 됩니다. 시스템의 수량은 수식안 진입함수에 수량을 지정하지 않으면 설정청에서 지정한 수량이 적용됩니다. 수식에 진입수량을 3으로 지정해 드립니다. 진입조건에도 언급하신 내용을 추가했습니다. input : TradingTime(1),StartTime(160000),EndTime(045000); input : ProfitTickCount1(20),ProfitTickCount2(40),ProfitTickCount3(60),LossTickCount (10); input : P1(7),P2(14),P3(21); input : ADXP(14),value(20); input : af(0.02),maxaf(0.2); input : Period(50); input : CumulativeLossTicks(100); var : R1(0),R2(0),R3(0),AA(0),MM(0),MS(0),SS(0),EE(0), HH(0), LL(0); var : Xcond(false),N1(0),daypl(0),CumulativeLoss(0); R1 = RSI(P1); R2 = RSI(P2); R3 = RSI(P3); AA = ADX(ADXP); SS = sar(af,maxaf); EE = Ema(C,Period); if TradingTime == 1 then condition3 = (stime>=StartTime or stime<=EndTime ); Else if TradingTime == 2 then condition3 = (stime>=StartTime and stime<=EndTime ); Else condition3 = true; if TradingTime == 1 or TradingTime == 2 then { if (sdate != sdate[1] and stime >= StartTime) or (sdate == sdate[1] and stime >= StartTime and stime[1] < StartTime) Then { Xcond = false; N1 = NetProfit; } } else { if Bdate != Bdate[1] Then { Xcond = false; N1 = NetProfit; } } CumulativeLoss = PriceScale*CumulativeLossTicks; daypl = NetProfit-N1; if TotalTrades > TotalTrades[1] and (IsExitName("dbl",1) == true or IsExitName("dsl",1) == true) then Xcond = true; If MarketPosition == 0 and TotalTrades == TotalTrades[1] and Condition3 == true and R1 > R2 and R2 > R3 and R3 >= 50 and AA > value and C > SS and C > EE Then Buy("b",OnClose,Def,3); If MarketPosition == 0 and TotalTrades == TotalTrades[1] and Condition3 == true and R1 < R2 and R2 < R3 and R3 <= 50 and AA < value and C < SS and C < EE Then Sell("s",OnClose,Def,3); if MarketPosition == 1 Then { ExitLong("bp1",atlimit,EntryPrice+PriceScale*ProfitTickCount1,"",1,1); ExitLong("bp2",atlimit,EntryPrice+PriceScale*ProfitTickCount2,"",1,1); ExitLong("bp3",atlimit,EntryPrice+PriceScale*ProfitTickCount3); } if MarketPosition == -1 Then { ExitShort("sp1",atlimit,EntryPrice-PriceScale*ProfitTickCount1,"",1,1); ExitShort("sp2",atlimit,EntryPrice-PriceScale*ProfitTickCount2,"",1,1); ExitShort("sp3",atlimit,EntryPrice-PriceScale*ProfitTickCount3); } 즐거운 하루되세요 > 고박사122 님이 쓴 글입니다. > 제목 : 수식 검토 요청드립니다. > 안녕하세요. 운영자님 다음 시스템은 한번 진입시 3계약 진입하여 3번에 걸쳐 나누어 분할 익절하고자 만든 시스템입니다. 뭔가 문제가 있는 것 같은데 검토 부탁드립니다. 또한, 진입조건식에서 매수인 경우 R1 > R2 and R2 > R3 으로 되어 있는데 이것을 기준선 50 이상에서 R1 > R2 and R2 > R3 이 되도록 부탁드립니다. 매도역시 R1 < R2 and R2 < R3 으로 되어 있는데 이것을 기준선 50 이하에서 R1 < R2 and R2 < R3 이 되도록 부탁드립니다. input : TradingTime(1),StartTime(160000),EndTime(045000),ProfitTickCount1(6),ProfitTickCount2(12),ProfitTickCount3(18),LossTickCount (10); input : P1(7),P2(14),P3(21); input : ADXP(14),value(20); input : af(0.02),maxaf(0.2); input : Period(50); input : CumulativeLossTicks(100); var : R1(0),R2(0),R3(0),AA(0),MM(0),MS(0),SS(0),EE(0), HH(0), LL(0); var : Xcond(false),N1(0),daypl(0),CumulativeLoss(0); R1 = RSI(P1); R2 = RSI(P2); R3 = RSI(P3); AA = ADX(ADXP); SS = sar(af,maxaf); EE = Ema(C,Period); if TradingTime == 1 then condition3 = (stime>=StartTime or stime<=EndTime ); Else if TradingTime == 2 then condition3 = (stime>=StartTime and stime<=EndTime ); Else condition3 = true; if TradingTime == 1 or TradingTime == 2 then { if (sdate != sdate[1] and stime >= StartTime) or (sdate == sdate[1] and stime >= StartTime and stime[1] < StartTime) Then { Xcond = false; N1 = NetProfit; } } else { if Bdate != Bdate[1] Then { Xcond = false; N1 = NetProfit; } } CumulativeLoss = PriceScale*CumulativeLossTicks; daypl = NetProfit-N1; if TotalTrades > TotalTrades[1] and (IsExitName("dbl",1) == true or IsExitName("dsl",1) == true) then Xcond = true; If MarketPosition == 0 and TotalTrades == TotalTrades[1] and Condition3 == true and R1 > R2 and R2 > R3 and AA > value and C > SS and C > EE Then Buy(); If MarketPosition == 0 and TotalTrades == TotalTrades[1] and Condition3 == true and R1 < R2 and R2 < R3 and AA < value and C < SS and C < EE Then Sell(); if MarketPosition == 1 Then{ ExitLong("bp1",atlimit,EntryPrice+PriceScale*ProfitTickCount1,"",1,1); ExitLong("bp2",atlimit,EntryPrice+PriceScale*ProfitTickCount2,"",1,1); ExitLong("bp3",atlimit,EntryPrice+PriceScale*ProfitTickCount3); } if MarketPosition == -1 Then{ ExitShort("sp1",atlimit,EntryPrice-PriceScale*ProfitTickCount1,"",1,1); ExitShort("sp2",atlimit,EntryPrice-PriceScale*ProfitTickCount2,"",1,1); ExitShort("sp3",atlimit,EntryPrice-PriceScale*ProfitTickCount3); }