커뮤니티

시스템 수식 부탁드립니다

프로필 이미지
빅플랜
2023-01-03 09:03:49
549
글번호 165032
답변완료
안녕하세요. 새해 복많이 받으세요. 다음의 조건으로 자동매매 코딩 부탁드립니다. 해외선물매매 인데요. 당일시가를 기준선으로 하고 상하 10틱씩 계속 증감시킨 가격을 매매포인트로 합니다. 종가가 당일시가 위족이면 매수진입 아래족이면 매도진입합니다. 진입기준은 1) 매수(매도)는 상승(하락)하다 조정이 15틱주고 매매포인트를 상승(하락)돌파할때 매수(매도) 2) 역추세로 25틱일때 매매포인트에서 매수(매도) 청산은 15틱 손절은 10틱 손절후 그 진입가에서 재진입은 1회만하고 그 이상은 진입하지 않는다 매매종료시간은 선택할 수 있도록 한다.
시스템
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2023-01-03 19:52:01

안녕하세요 예스스탁입니다. input : Endtime(060000),기준틱(10),조정틱(15),역추세틱(25),익절틱수(15),손절틱수(10); var : starttime(0),hh(0),ll(0),tt(0),dt(0),rt(0); var : upphase(0),dnphase(0),hl(0),lh(0),entry(0); var : Tcond(false),B1(0),B2(0),BE(0),S1(0),S2(0),SE(0); tt = PriceScale*기준틱; dt = PriceScale*조정틱; rt = PriceScale*역추세틱; 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 Bdate != bdate[1] Then { starttime = sTime; IF Endtime <= starttime Then { SetStopEndofday(0); } Tcond = true; entry = 0; hh = h; hl = 0; ll = l; lh = 0; } Else { if (MarketPosition != 0 and MarketPosition != MarketPosition[1]) or (MarketPosition == MarketPosition[1] and TotalTrades > TotalTrades[1]) Then entry = entry+1; if MarketPosition != MarketPosition[1] Then { if MarketPosition != 1 Then { hh = h; hl = 0; } if MarketPosition != -1 Then { ll = l; lh = 0; } } if h > hh Then { hh = h; hl = 0; } if l < ll Then { ll = l; lh = 0; } upphase = Floor(abs(hh-DayOpen)/tt); dnphase = Floor(abs(ll-DayOpen)/tt); if Tcond == true Then { if MarketPosition <= 0 and H != hh Then { if upphase >= 1 and L <= hh-dt and (hl == 0 or (hl > 0 and l < hl)) Then { hl = l; B1 = DayOpen+upphase*tt; B2 = Floor((B1-hl)/tt)*tt; BE = B1-B2; if BE < DayOpen+tt Then BE = DayOpen+tt; } if hl > 0 Then Buy("b1",AtStop,BE); if L > hh-rt and hh-rt > dayopen Then Buy("b2",AtLimit,hh-rt); } if MarketPosition >= 0 and L != ll Then { if dnphase >= 1 and h >= ll+dt and (lh == 0 or (lh > 0 and h > lh)) Then { lh = H; S1 = DayOpen-dnphase*tt; S2 = Floor((lh-S1)/tt)*tt; SE = S1+S2; if SE > DayOpen-TT Then SE = DayOpen-TT; } if lh > 0 Then Sell("s1",AtStop,SE); if h < ll+rt and ll+rt < dayopen Then Sell("s2",AtLimit,ll+rt); } if MarketPosition == 0 and IsExitName("StopLoss",1) == true and entry > 0 Then { if MarketPosition(1) == 1 and IsEntryName("rb",1) == False Then Buy("rb",AtStop,EntryPrice(1)); if MarketPosition(1) == -1 and IsEntryName("rs",1) == False Then Sell("rs",AtStop,EntryPrice(1)); } } } SetStopProfittarget(PriceScale*익절틱수,PointStop); SetStopLoss(PriceScale*손절틱수,PointStop); 새해 복 많이 받으시고 즐거운 하루되세요 > 빅플랜 님이 쓴 글입니다. > 제목 : 시스템 수식 부탁드립니다 > 안녕하세요. 새해 복많이 받으세요. 다음의 조건으로 자동매매 코딩 부탁드립니다. 해외선물매매 인데요. 당일시가를 기준선으로 하고 상하 10틱씩 계속 증감시킨 가격을 매매포인트로 합니다. 종가가 당일시가 위족이면 매수진입 아래족이면 매도진입합니다. 진입기준은 1) 매수(매도)는 상승(하락)하다 조정이 15틱주고 매매포인트를 상승(하락)돌파할때 매수(매도) 2) 역추세로 25틱일때 매매포인트에서 매수(매도) 청산은 15틱 손절은 10틱 손절후 그 진입가에서 재진입은 1회만하고 그 이상은 진입하지 않는다 매매종료시간은 선택할 수 있도록 한다.