커뮤니티

수식작성

프로필 이미지
푸른
2021-05-06 08:40:54
1327
글번호 148702
답변완료

첨부 이미지

input : StartTime(223000),EndTime(0350000); input : 익절틱수(70),손절틱수(20); Input : 당일수익틱수(120); Var : N1(0),dayPl(0),당일수익(0),Xcond(false); var : T(0),Tcond(false); IF Endtime > starttime Then SetStopEndofday(Endtime); Else { if sDate != sDate[1] Then SetStopEndofday(Endtime); } if (sdate != sdate[1] and stime >= EndTime) or (sdate == sdate[1] and stime >= EndTime and stime[1] < EndTime) Then Tcond = False; if (sdate != sdate[1] and stime >= StartTime) or (sdate == sdate[1] and stime >= StartTime and stime[1] < StartTime) Then { Tcond = true; Xcond = false; N1 = NetProfit; IF Endtime <= starttime Then { SetStopEndofday(0); } } 당일수익 = PriceScale*당일수익틱수; daypl = NetProfit-N1; if TotalTrades > TotalTrades[1] then { if daypl >= 당일수익 Then Xcond = true; if IsExitName("dbp",1) == true or IsExitName("dsp",1) == true then Xcond = true; } var1 = ma(C,5); if C > O or (C == O and C >= C[1]) Then T = 1; Else T = -1; if Tcond == true Then { if MarketPosition <= 0 and C > O and CountIf(T == 1,9) >= 4 and C > var1 Then Buy("b"); if MarketPosition >= 0 and C < O and CountIf(T == -1,9) >= 4 and C < var1 Then Sell("s"); if MarketPosition == 1 then { ExitLong("dbp",atlimit,EntryPrice+((당일수익-daypl)/CurrentContracts)); } if MarketPosition == -1 then { ExitShort("dsp",atlimit,EntryPrice-((당일수익-daypl)/CurrentContracts)); } } SetStopProfittarget(PriceScale*익절틱수,PointStop); SetStopLoss(PriceScale*손절틱수,PointStop); -------------------- 우선 매매시간 이외 진입신호가 있습니다. 수정 부탁 드립니다. True Strength Index 지표로 상기 수식어의 제한된 진입신호의 수식어를 구하고자 합니다. - 아래 - 1. TSI +35 ~ -35 사이 진입신호금지 2. TSI +35 ~ -35 이외 TSI - Signal - Cross up , Cross down 후 상기 수식어 진입신호 허용
시스템
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2021-05-06 12:51:04

안녕하세요 예스스탁입니다. input : StartTime(223000),EndTime(035000); input : 익절틱수(70),손절틱수(20); Input : 당일수익틱수(120); INPUTS: R(4), S(8), U(6),SMTHLEN(10); var : Truestrength(0),Truestrengthsig(0); Var : N1(0),dayPl(0),당일수익(0),Xcond(false); var : T(0),Tcond(false); IF Endtime > starttime Then SetStopEndofday(Endtime); Else { if sDate != sDate[1] Then SetStopEndofday(Endtime); } if (sdate != sdate[1] and stime >= EndTime) or (sdate == sdate[1] and stime >= EndTime and stime[1] < EndTime) Then Tcond = False; if (sdate != sdate[1] and stime >= StartTime) or (sdate == sdate[1] and stime >= StartTime and stime[1] < StartTime) Then { Tcond = true; Xcond = false; N1 = NetProfit; IF Endtime <= starttime Then { SetStopEndofday(0); } } 당일수익 = PriceScale*당일수익틱수; daypl = NetProfit-N1; if TotalTrades > TotalTrades[1] then { if daypl >= 당일수익 Then Xcond = true; if IsExitName("dbp",1) == true or IsExitName("dsp",1) == true then Xcond = true; } Truestrength = TSI(C, R, S, U); Truestrengthsig = Ema(TSI(C, R, S, U), SMTHLEN); var1 = ma(C,5); if C > O or (C == O and C >= C[1]) Then T = 1; Else T = -1; if Tcond == true Then { if MarketPosition <= 0 and C > O and CountIf(T == 1,9) >= 4 and C > var1 and (Truestrength >= 30 or Truestrength <= -35) AND Truestrength > Truestrengthsig Then Buy("b"); if MarketPosition >= 0 and C < O and CountIf(T == -1,9) >= 4 and C < var1 and (Truestrength >= 30 or Truestrength <= -35) AND Truestrength < Truestrengthsig Then Sell("s"); if MarketPosition == 1 then { ExitLong("dbp",atlimit,EntryPrice+((당일수익-daypl)/CurrentContracts)); } if MarketPosition == -1 then { ExitShort("dsp",atlimit,EntryPrice-((당일수익-daypl)/CurrentContracts)); } } SetStopProfittarget(PriceScale*익절틱수,PointStop); SetStopLoss(PriceScale*손절틱수,PointStop); 즐거운 하루되세요 > 푸른 님이 쓴 글입니다. > 제목 : 수식작성 > input : StartTime(223000),EndTime(0350000); input : 익절틱수(70),손절틱수(20); Input : 당일수익틱수(120); Var : N1(0),dayPl(0),당일수익(0),Xcond(false); var : T(0),Tcond(false); IF Endtime > starttime Then SetStopEndofday(Endtime); Else { if sDate != sDate[1] Then SetStopEndofday(Endtime); } if (sdate != sdate[1] and stime >= EndTime) or (sdate == sdate[1] and stime >= EndTime and stime[1] < EndTime) Then Tcond = False; if (sdate != sdate[1] and stime >= StartTime) or (sdate == sdate[1] and stime >= StartTime and stime[1] < StartTime) Then { Tcond = true; Xcond = false; N1 = NetProfit; IF Endtime <= starttime Then { SetStopEndofday(0); } } 당일수익 = PriceScale*당일수익틱수; daypl = NetProfit-N1; if TotalTrades > TotalTrades[1] then { if daypl >= 당일수익 Then Xcond = true; if IsExitName("dbp",1) == true or IsExitName("dsp",1) == true then Xcond = true; } var1 = ma(C,5); if C > O or (C == O and C >= C[1]) Then T = 1; Else T = -1; if Tcond == true Then { if MarketPosition <= 0 and C > O and CountIf(T == 1,9) >= 4 and C > var1 Then Buy("b"); if MarketPosition >= 0 and C < O and CountIf(T == -1,9) >= 4 and C < var1 Then Sell("s"); if MarketPosition == 1 then { ExitLong("dbp",atlimit,EntryPrice+((당일수익-daypl)/CurrentContracts)); } if MarketPosition == -1 then { ExitShort("dsp",atlimit,EntryPrice-((당일수익-daypl)/CurrentContracts)); } } SetStopProfittarget(PriceScale*익절틱수,PointStop); SetStopLoss(PriceScale*손절틱수,PointStop); -------------------- 우선 매매시간 이외 진입신호가 있습니다. 수정 부탁 드립니다. True Strength Index 지표로 상기 수식어의 제한된 진입신호의 수식어를 구하고자 합니다. - 아래 - 1. TSI +35 ~ -35 사이 진입신호금지 2. TSI +35 ~ -35 이외 TSI - Signal - Cross up , Cross down 후 상기 수식어 진입신호 허용