커뮤니티

시스템식 부탁드립니다.

프로필 이미지
양치기
2024-01-23 11:15:30
806
글번호 175979
답변완료
항상 도움 주셔서 감사합니다. 아래 시스템식에서 불타기의 청산조건을 마지막 진입가격 대비 outgap(20) 만큼 하락시 청산하는 조건으로 시스템식 변경 부탁드립니다. 감사합니다. input : Pst(1); input : gap(20), outgap(20), gapmulti(0.7), multi(0.7), pt(20), sl(200); var : vol(0),v1(0),t(0),b(0),s(0); var : line1(0), line2(0); value1 = gap/PointValue; value2 = pt/PointValue; value3 = sl/PointValue; value4 = outgap/PointValue; line1 = ma(c,10) ; line2 = ma(c,20) ; 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 { v1 = CurrentContracts-CurrentContracts[1]; if MaxEntries == 1 Then t = value1 ; Else t = t+Round(t*gapmulti,0); if LatestEntryName(0) == "upb" Then b = 1; if LatestEntryName(0) == "dnb" Then b = -1; } vol = Round(v1+v1*multi,0); Buy("dnb",AtLimit,EntryPrice(0)-PriceScale*(value1*MaxEntries),vol); Buy("upb",AtStop,EntryPrice(0)+PriceScale*(value1*MaxEntries),vol); if b == -1 Then { ExitLong("bx11",AtLimit,AvgEntryPrice+PriceScale*Value2); ExitLong("bx12",AtLimit,EntryPrice); } if b == 1 Then { ExitLong("bx21",AtStop,AvgEntryPrice-PriceScale*Value2); ExitLong("bx22",AtStop,EntryPrice); } } Else b = 0; } 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 { v1 = CurrentContracts-CurrentContracts[1]; if MaxEntries == 1 Then t = value1 ; Else t = t+Round(t*gapmulti,0); if LatestEntryName(0) == "ups" Then s = 1; if LatestEntryName(0) == "dns" Then s = -1; } vol = Round(v1+v1*multi,0); Sell("ups",AtLimit,EntryPrice(0)+PriceScale*(value1*MaxEntries),vol); Sell("dns",AtStop,EntryPrice(0)-PriceScale*(value1*MaxEntries),vol); if s == 1 Then { ExitShort("sx11",AtLimit,AvgEntryPrice-PriceScale*Value2); ExitShort("sx12",AtLimit,EntryPrice); } if s == -1 Then { ExitShort("sx21",AtStop,AvgEntryPrice+PriceScale*Value2); ExitShort("sx22",AtStop,EntryPrice); } } Else s = 0; }
시스템
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2024-01-23 15:15:42

안녕하세요 예스스탁입니다. input : Pst(1); input : gap(20), outgap(20), gapmulti(0.7), multi(0.7), pt(20), sl(200); var : vol(0),v1(0),t(0),b(0),s(0); var : line1(0), line2(0); value1 = gap/PointValue; value2 = pt/PointValue; value3 = sl/PointValue; value4 = outgap/PointValue; line1 = ma(c,10) ; line2 = ma(c,20) ; 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 { v1 = CurrentContracts-CurrentContracts[1]; if MaxEntries == 1 Then t = value1 ; Else t = t+Round(t*gapmulti,0); if LatestEntryName(0) == "upb" Then b = 1; if LatestEntryName(0) == "dnb" Then b = -1; } vol = Round(v1+v1*multi,0); Buy("dnb",AtLimit,EntryPrice(0)-PriceScale*(value1*MaxEntries),vol); Buy("upb",AtStop,EntryPrice(0)+PriceScale*(value1*MaxEntries),vol); if b == -1 Then { ExitLong("bx11",AtLimit,AvgEntryPrice+PriceScale*Value2); ExitLong("bx12",AtLimit,EntryPrice); } if b == 1 Then { ExitLong("bx21",AtStop,LatestEntryPrice(0)-PriceScale*Value2); ExitLong("bx22",AtStop,EntryPrice); } } Else b = 0; } 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 { v1 = CurrentContracts-CurrentContracts[1]; if MaxEntries == 1 Then t = value1 ; Else t = t+Round(t*gapmulti,0); if LatestEntryName(0) == "ups" Then s = 1; if LatestEntryName(0) == "dns" Then s = -1; } vol = Round(v1+v1*multi,0); Sell("ups",AtLimit,EntryPrice(0)+PriceScale*(value1*MaxEntries),vol); Sell("dns",AtStop,EntryPrice(0)-PriceScale*(value1*MaxEntries),vol); if s == 1 Then { ExitShort("sx11",AtLimit,AvgEntryPrice-PriceScale*Value2); ExitShort("sx12",AtLimit,EntryPrice); } if s == -1 Then { ExitShort("sx21",AtStop,LatestEntryPrice(0)+PriceScale*Value2); ExitShort("sx22",AtStop,EntryPrice); } } Else s = 0; } 즐거운 하루되세요 > 양치기 님이 쓴 글입니다. > 제목 : 시스템식 부탁드립니다. > 항상 도움 주셔서 감사합니다. 아래 시스템식에서 불타기의 청산조건을 마지막 진입가격 대비 outgap(20) 만큼 하락시 청산하는 조건으로 시스템식 변경 부탁드립니다. 감사합니다. input : Pst(1); input : gap(20), outgap(20), gapmulti(0.7), multi(0.7), pt(20), sl(200); var : vol(0),v1(0),t(0),b(0),s(0); var : line1(0), line2(0); value1 = gap/PointValue; value2 = pt/PointValue; value3 = sl/PointValue; value4 = outgap/PointValue; line1 = ma(c,10) ; line2 = ma(c,20) ; 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 { v1 = CurrentContracts-CurrentContracts[1]; if MaxEntries == 1 Then t = value1 ; Else t = t+Round(t*gapmulti,0); if LatestEntryName(0) == "upb" Then b = 1; if LatestEntryName(0) == "dnb" Then b = -1; } vol = Round(v1+v1*multi,0); Buy("dnb",AtLimit,EntryPrice(0)-PriceScale*(value1*MaxEntries),vol); Buy("upb",AtStop,EntryPrice(0)+PriceScale*(value1*MaxEntries),vol); if b == -1 Then { ExitLong("bx11",AtLimit,AvgEntryPrice+PriceScale*Value2); ExitLong("bx12",AtLimit,EntryPrice); } if b == 1 Then { ExitLong("bx21",AtStop,AvgEntryPrice-PriceScale*Value2); ExitLong("bx22",AtStop,EntryPrice); } } Else b = 0; } 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 { v1 = CurrentContracts-CurrentContracts[1]; if MaxEntries == 1 Then t = value1 ; Else t = t+Round(t*gapmulti,0); if LatestEntryName(0) == "ups" Then s = 1; if LatestEntryName(0) == "dns" Then s = -1; } vol = Round(v1+v1*multi,0); Sell("ups",AtLimit,EntryPrice(0)+PriceScale*(value1*MaxEntries),vol); Sell("dns",AtStop,EntryPrice(0)-PriceScale*(value1*MaxEntries),vol); if s == 1 Then { ExitShort("sx11",AtLimit,AvgEntryPrice-PriceScale*Value2); ExitShort("sx12",AtLimit,EntryPrice); } if s == -1 Then { ExitShort("sx21",AtStop,AvgEntryPrice+PriceScale*Value2); ExitShort("sx22",AtStop,EntryPrice); } } Else s = 0; }