커뮤니티

수식수정부탁드립니다

프로필 이미지
산이보리
2020-08-28 10:14:31
737
글번호 141873
답변완료
나스닥 100포인트 이상 수익 발생 시 10분 매매정지 후 매매재개하는 수식을 만들었으나 잘 되지 않습니다 수정 부탁드립니다 감사합니다 ------ input: 진입(2),청산(13),이동평균선(10),포인트(100); var : hh(0),ll(0),mav(0),profit(0); profit = MaxContractsHeld * 포인트; #청산 ExitLong("EL", atstop, Lowest( Low , 청산 )); ExitShort("ES", atstop,Highest( High , 청산 )); hh = Highest(h,진입); ll = Lowest(l,진입); mav = ma(C,이동평균선); if stime > 220000 or stime < 033000 Then { if PositionProfit(1) > profit Then { If TimeToMinutes(stime) > TimeToMinutes(ExitTime(1))+10 Then if c > mav and c > hh[1] Then Buy(); if c < mav and c < ll[1] Then Sell(); } Else { if c > mav and c > hh[1] Then Buy(); if c < mav and c < ll[1] Then Sell(); } }
시스템
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2020-08-28 16:42:53

안녕하세요 예스스탁입니다. input: 진입(2),청산(13),이동평균선(10),포인트(100); var : hh(0),ll(0),mav(0),profit(0); var : S1(0),D1(0),TM(0),entry(0); if Bdate != Bdate[1] Then { S1 = TimeToMinutes(stime); D1 = sdate; entry = 0; } if D1 > 0 then { if sdate == D1 Then TM = TimeToMinutes(stime)-S1; Else TM = TimeToMinutes(stime)+1440-S1; } if (MarketPosition != 0 and MarketPosition != MarketPosition[1]) or (MarketPosition != MarketPosition[1] and TotalTrades > TotalTrades[1]) Then entry = entry+1; #청산 ExitLong("EL", atstop, Lowest( Low , 청산 )); ExitShort("ES", atstop,Highest( High , 청산 )); hh = Highest(h,진입); ll = Lowest(l,진입); mav = ma(C,이동평균선); if stime > 220000 or stime < 033000 Then { if c > mav and c > hh[1] Then { Condition1 = (entry >= 1 and MarketPosition == -1 and PositionProfit >= Profit) or (entry >= 1 and MarketPosition == 0 and PositionProfit(1) >= Profit and TM <= TM[BarsSinceExit(1)]+10); if Condition1 == False Then Buy(); Else ExitShort(); } if c < mav and c < ll[1] Then { Condition1 = (entry >= 1 and MarketPosition == 1 and PositionProfit >= Profit) or (entry >= 1 and MarketPosition == 0 and PositionProfit(1) >= Profit and TM <= TM[BarsSinceExit(1)]+10); if Condition1 == False Then Sell(); Else ExitLong(); } } 즐거운 하루되세요 > 산이보리 님이 쓴 글입니다. > 제목 : 수식수정부탁드립니다 > 나스닥 100포인트 이상 수익 발생 시 10분 매매정지 후 매매재개하는 수식을 만들었으나 잘 되지 않습니다 수정 부탁드립니다 감사합니다 ------ input: 진입(2),청산(13),이동평균선(10),포인트(100); var : hh(0),ll(0),mav(0),profit(0); profit = MaxContractsHeld * 포인트; #청산 ExitLong("EL", atstop, Lowest( Low , 청산 )); ExitShort("ES", atstop,Highest( High , 청산 )); hh = Highest(h,진입); ll = Lowest(l,진입); mav = ma(C,이동평균선); if stime > 220000 or stime < 033000 Then { if PositionProfit(1) > profit Then { If TimeToMinutes(stime) > TimeToMinutes(ExitTime(1))+10 Then if c > mav and c > hh[1] Then Buy(); if c < mav and c < ll[1] Then Sell(); } Else { if c > mav and c > hh[1] Then Buy(); if c < mav and c < ll[1] Then Sell(); } }