커뮤니티

문의드립니다

프로필 이미지
lacl
2024-02-27 05:41:24
743
글번호 176948
답변완료
해외선물매매시 전일수익(전전일수익)을 당일누적손실액이 초과시 청산 진입금지 수식 부탁드립니다
시스템
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2024-02-27 10:25:35

안녕하세요 예스스탁입니다. var : t1(0),daypl(0),daypl1(0),daypl2(0);; var : Xcond(false); if Bdate != Bdate[1] Then { t1 = NetProfit; daypl1 = daypl[1]; daypl2 = daypl1[1]; Xcond = False; } daypl = NetProfit-t1; if TotalTrades > TotalTrades[1] then { if daypl1 > 0 and daypl <= -daypl1 Then Xcond = true; if daypl2 > 0 and daypl <= -daypl1 Then Xcond = true; if (IsExitName("dbl1",1) == true or IsExitName("dbl2",1) == true or IsExitName("dsl1",1) == true or IsExitName("dsl2",1) == true) then Xcond = true; } if Xcond == false then { //진입청산수식 } if MarketPosition == 1 then { #전일 수익 if daypl1 > 0 Then ExitLong("dbl1",AtStop,EntryPrice-((daypl1+daypl)/CurrentContracts)); #전전일 수익 if daypl2 > 0 Then ExitLong("dbl2",AtStop,EntryPrice-((daypl2+daypl)/CurrentContracts)); } if MarketPosition == -1 then { #전일 수익 if daypl1 > 0 Then ExitShort("dsl1",AtStop,EntryPrice+((daypl1+daypl)/CurrentContracts)); #전전일 수익 if daypl2 > 0 Then ExitShort("dsl2",AtStop,EntryPrice+((daypl2+daypl)/CurrentContracts)); } 즐거운 하루되세요 > lacl 님이 쓴 글입니다. > 제목 : 문의드립니다 > 해외선물매매시 전일수익(전전일수익)을 당일누적손실액이 초과시 청산 진입금지 수식 부탁드립니다