커뮤니티

시스템식 부탁드립니다.

프로필 이미지
양치기
2024-02-01 09:17:28
685
글번호 176311
답변완료

첨부 이미지

항상 도움 주셔서 감사합니다. 종목 : 해외선물 아래 수식에서 목표수익청산 이후에는 다시 처음부터 진입하는 시스템식으로 수정 부탁드립니다. 첨부 이미지 참고 부탁드립니다. input : Pst(1); // 매수,매도 input : multi(0.5); input : gap(20),gapmulti(0.5), pt(20),sl(200),pt2(20); var : vol(0),v1(0),t(0),s(0); value1 = gap/PointValue; value2 = pt/PointValue; value3 = sl/PointValue; #------------------------------------ # 매수 전략 #------------------------------------ if pst == 1 Then { if MarketPosition == 0 and TotalTrades == TotalTrades[1] Then { vol = 1; Buy("b",OnClose,Def,vol); } if MarketPosition == 1 Then { if CurrentContracts > CurrentContracts[1] Then { s = 1; v1 = CurrentContracts-CurrentContracts[1]; if MaxEntries == 1 Then t = value1 ; Else t = t+Round(t*gapmulti,0); } if CurrentContracts < CurrentContracts[1] Then s = -1; if s == 1 Then vol = Round(v1+v1*multi,0); if s == -1 Then vol = v1; Buy("bb",AtLimit,EntryPrice(0)-PriceScale*(value1*MaxEntries),vol); ExitLong("bp",AtLimit,AvgEntryPrice+PriceScale*Value2); } } #------------------------------------ # 매도 전략 #------------------------------------ if pst == -1 Then { if MarketPosition == 0 and TotalTrades == TotalTrades[1] Then { vol = 1; Sell("s",OnClose,Def,vol); } if MarketPosition == -1 Then { if CurrentContracts > CurrentContracts[1] Then { s = 1; v1 = CurrentContracts-CurrentContracts[1]; if MaxEntries == 1 Then t = value1 ; Else t = t+Round(t*gapmulti,0); } if CurrentContracts < CurrentContracts[1] Then s = -1; if s == 1 Then vol = Round(v1+v1*multi,0); if s == -1 Then vol = v1; Sell("ss",AtLimit,EntryPrice(0)+PriceScale*(value1*MaxEntries),vol); ExitShort("sp",AtLimit,AvgEntryPrice-PriceScale*Value2); } } #-------------------------------------------- SetStopProfittarget(pt2*PriceScale,PointStop);
시스템
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2024-02-01 14:13:26

안녕하세요 예스스탁입니다. SetStopProfittarget이후 수량은 다시 1부터 시작하게 수정해 드립니다. 하지만 이전 문의에도 답변드린것과 같이 그림에 첨부하신 내용으로 해당 진입들이 1로 수량이 지정이 될수는 없습니다. 2023/07/18 22:30 매수 bb 2023/07/18 23:01 매수청산 SetStopProfittarget 2023/07/18 22:31 매수 bb 리포트는 특정 진입의 청산이 발생하면 해당 진입신호 아래에 청산내용이 적혀지게 됩니다. 그로므로 그다음진입이 청산보다 이전시간일수 있습니다. 이미 발생한 신호의 내용은 변경이 불가합니다. 목표수익청산이 발생하면 그 이후의 진입부터 수량이 초기화 됩니다. input : Pst(1); // 매수,매도 input : multi(0.5); input : gap(20),gapmulti(0.5), pt(20),sl(200),pt2(20); var : vol(0),v1(0),t(0),s(0); value1 = gap/PointValue; value2 = pt/PointValue; value3 = sl/PointValue; #------------------------------------ # 매수 전략 #------------------------------------ if pst == 1 Then { if MarketPosition == 0 and TotalTrades == TotalTrades[1] Then { vol = 1; Buy("b",OnClose,Def,vol); } if MarketPosition == 1 Then { if CurrentContracts > CurrentContracts[1] Then { s = 1; v1 = CurrentContracts-CurrentContracts[1]; if MaxEntries == 1 Then t = value1 ; Else t = t+Round(t*gapmulti,0); } if CurrentContracts < CurrentContracts[1] Then s = -1; if s == 1 Then vol = Round(v1+v1*multi,0); if s == -1 Then vol = 1; Buy("bb",AtLimit,EntryPrice(0)-PriceScale*(value1*MaxEntries),vol); ExitLong("bp",AtLimit,AvgEntryPrice+PriceScale*Value2); } } #------------------------------------ # 매도 전략 #------------------------------------ if pst == -1 Then { if MarketPosition == 0 and TotalTrades == TotalTrades[1] Then { vol = 1; Sell("s",OnClose,Def,vol); } if MarketPosition == -1 Then { if CurrentContracts > CurrentContracts[1] Then { s = 1; v1 = CurrentContracts-CurrentContracts[1]; if MaxEntries == 1 Then t = value1 ; Else t = t+Round(t*gapmulti,0); } if CurrentContracts < CurrentContracts[1] Then s = -1; if s == 1 Then vol = Round(v1+v1*multi,0); if s == -1 Then vol = 1; Sell("ss",AtLimit,EntryPrice(0)+PriceScale*(value1*MaxEntries),vol); ExitShort("sp",AtLimit,AvgEntryPrice-PriceScale*Value2); } } #-------------------------------------------- SetStopProfittarget(pt2*PriceScale,PointStop); 즐거운 하루되세요 > 양치기 님이 쓴 글입니다. > 제목 : 시스템식 부탁드립니다. > 항상 도움 주셔서 감사합니다. 종목 : 해외선물 아래 수식에서 목표수익청산 이후에는 다시 처음부터 진입하는 시스템식으로 수정 부탁드립니다. 첨부 이미지 참고 부탁드립니다. input : Pst(1); // 매수,매도 input : multi(0.5); input : gap(20),gapmulti(0.5), pt(20),sl(200),pt2(20); var : vol(0),v1(0),t(0),s(0); value1 = gap/PointValue; value2 = pt/PointValue; value3 = sl/PointValue; #------------------------------------ # 매수 전략 #------------------------------------ if pst == 1 Then { if MarketPosition == 0 and TotalTrades == TotalTrades[1] Then { vol = 1; Buy("b",OnClose,Def,vol); } if MarketPosition == 1 Then { if CurrentContracts > CurrentContracts[1] Then { s = 1; v1 = CurrentContracts-CurrentContracts[1]; if MaxEntries == 1 Then t = value1 ; Else t = t+Round(t*gapmulti,0); } if CurrentContracts < CurrentContracts[1] Then s = -1; if s == 1 Then vol = Round(v1+v1*multi,0); if s == -1 Then vol = v1; Buy("bb",AtLimit,EntryPrice(0)-PriceScale*(value1*MaxEntries),vol); ExitLong("bp",AtLimit,AvgEntryPrice+PriceScale*Value2); } } #------------------------------------ # 매도 전략 #------------------------------------ if pst == -1 Then { if MarketPosition == 0 and TotalTrades == TotalTrades[1] Then { vol = 1; Sell("s",OnClose,Def,vol); } if MarketPosition == -1 Then { if CurrentContracts > CurrentContracts[1] Then { s = 1; v1 = CurrentContracts-CurrentContracts[1]; if MaxEntries == 1 Then t = value1 ; Else t = t+Round(t*gapmulti,0); } if CurrentContracts < CurrentContracts[1] Then s = -1; if s == 1 Then vol = Round(v1+v1*multi,0); if s == -1 Then vol = v1; Sell("ss",AtLimit,EntryPrice(0)+PriceScale*(value1*MaxEntries),vol); ExitShort("sp",AtLimit,AvgEntryPrice-PriceScale*Value2); } } #-------------------------------------------- SetStopProfittarget(pt2*PriceScale,PointStop);