커뮤니티

수식작성 부탁드립니다.

프로필 이미지
고박사122
2024-07-22 19:24:17
636
글번호 181762
답변완료
저번처럼 이번에도 매수조건 만족 시 바로 진입하지 않고 실제 진입을 -20틱 밀릴때까지 기다렸다가 아래에서 보수적으로 진입하고, 매도조건 만족 시 바로 진입하지 않고 실제 진입을 +20틱 밀릴때까지 기다렸다가 위에서 매도진입 되도록 하여 주시면 감사하겠습니다. input : TradingTime(1),StartTime(160000),EndTime(045000); input : ProfitTickCount1(20),ProfitTickCount2(40),ProfitTickCount3(60),LossTickCount(20); 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); var : 전환선(0),기준선(0),선행스팬1(0),선행스팬2(0); R1 = RSI(P1); R2 = RSI(P2); R3 = RSI(P3); AA = ADX(ADXP); SS = sar(af,maxaf); EE = Ema(C,Period); 전환선 = (highest(H,9)+lowest(L,9))/2; 기준선 = (highest(H,26)+lowest(L,26))/2; 선행스팬1 = (전환선[25]+기준선[25])/2; 선행스팬2 = (highest(H,52)[25]+lowest(L,52)[25])/2; 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 AA > AA[1] and #ADX 값이20 이상이면서 ADX 상승추세 선행스팬1 > 선행스팬2 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 AA > AA[1] and #ADX 값이20 이상이면서 ADX 상승추세 선행스팬1 < 선행스팬2 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); ExitLong("bl",AtStop,avgEntryPrice-PriceScale*LossTickCount); } 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); ExitShort("sl",AtStop,avgEntryPrice+PriceScale*LossTickCount); }
시스템
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2024-07-23 09:42:54

안녕하세요 예스스탁입니다. input : TradingTime(1),StartTime(160000),EndTime(045000); input : ProfitTickCount1(20),ProfitTickCount2(40),ProfitTickCount3(60),LossTickCount(20); 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); var : 전환선(0),기준선(0),선행스팬1(0),선행스팬2(0); var : T(0),B(0),S(0); R1 = RSI(P1); R2 = RSI(P2); R3 = RSI(P3); AA = ADX(ADXP); SS = sar(af,maxaf); EE = Ema(C,Period); 전환선 = (highest(H,9)+lowest(L,9))/2; 기준선 = (highest(H,26)+lowest(L,26))/2; 선행스팬1 = (전환선[25]+기준선[25])/2; 선행스팬2 = (highest(H,52)[25]+lowest(L,52)[25])/2; 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] Then { if T <= 0 and Condition3 == true and R1 > R2 and R2 > R3 and R3 >= 50 and AA > value and AA > AA[1] and #ADX 값이20 이상이면서 ADX 상승추세 선행스팬1 > 선행스팬2 and #양운 C > SS and C > EE Then { T = 1; B = C-PriceScale*20; } if T == 1 and B > 0 Then Buy("b",AtLimit,B,3); } If MarketPosition >= 0 and TotalTrades == TotalTrades[1] Then { if T >= 0 and Condition3 == true and R1 < R2 and R2 < R3 and R3 <= 50 and AA > value and AA > AA[1] and #ADX 값이20 이상이면서 ADX 상승추세 선행스팬1 < 선행스팬2 and #음운 C < SS and C < EE Then { T = -1; S = C+PriceScale*20; } if T == -1 and S > 0 Then Sell("s",AtLimit,S,3); } if MarketPosition == 1 Then { T = 0; B = 0; ExitLong("bp1",atlimit,EntryPrice+PriceScale*ProfitTickCount1,"",1,1); ExitLong("bp2",atlimit,EntryPrice+PriceScale*ProfitTickCount2,"",1,1); ExitLong("bp3",atlimit,EntryPrice+PriceScale*ProfitTickCount3); ExitLong("bl",AtStop,avgEntryPrice-PriceScale*LossTickCount); } if MarketPosition == -1 Then { T = 0; S = 0; ExitShort("sp1",atlimit,EntryPrice-PriceScale*ProfitTickCount1,"",1,1); ExitShort("sp2",atlimit,EntryPrice-PriceScale*ProfitTickCount2,"",1,1); ExitShort("sp3",atlimit,EntryPrice-PriceScale*ProfitTickCount3); ExitShort("sl",AtStop,avgEntryPrice+PriceScale*LossTickCount); } 즐거운 하루되세요 > 고박사122 님이 쓴 글입니다. > 제목 : 수식작성 부탁드립니다. > 저번처럼 이번에도 매수조건 만족 시 바로 진입하지 않고 실제 진입을 -20틱 밀릴때까지 기다렸다가 아래에서 보수적으로 진입하고, 매도조건 만족 시 바로 진입하지 않고 실제 진입을 +20틱 밀릴때까지 기다렸다가 위에서 매도진입 되도록 하여 주시면 감사하겠습니다. input : TradingTime(1),StartTime(160000),EndTime(045000); input : ProfitTickCount1(20),ProfitTickCount2(40),ProfitTickCount3(60),LossTickCount(20); 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); var : 전환선(0),기준선(0),선행스팬1(0),선행스팬2(0); R1 = RSI(P1); R2 = RSI(P2); R3 = RSI(P3); AA = ADX(ADXP); SS = sar(af,maxaf); EE = Ema(C,Period); 전환선 = (highest(H,9)+lowest(L,9))/2; 기준선 = (highest(H,26)+lowest(L,26))/2; 선행스팬1 = (전환선[25]+기준선[25])/2; 선행스팬2 = (highest(H,52)[25]+lowest(L,52)[25])/2; 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 AA > AA[1] and #ADX 값이20 이상이면서 ADX 상승추세 선행스팬1 > 선행스팬2 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 AA > AA[1] and #ADX 값이20 이상이면서 ADX 상승추세 선행스팬1 < 선행스팬2 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); ExitLong("bl",AtStop,avgEntryPrice-PriceScale*LossTickCount); } 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); ExitShort("sl",AtStop,avgEntryPrice+PriceScale*LossTickCount); }