커뮤니티

일부청산 후 대기 후 나머지 청산하 수식 문의

프로필 이미지
예스쟁이
2023-09-26 15:41:04
1000
글번호 172774
답변완료
항상 도움에 감사드립니다. 아래의 수식에 수정하고 싶은 내용이 있어 도움 부탁드립니다. -------------------------------------------- if MarketPosition == 1 Then { ExitLong("bp1",AtLimit,상단+(상단-하단)*1,"",Floor(CurrentContracts*0.5),1); ExitLong("bp2",AtLimit,상단+(상단-하단)*3); } if MarketPosition == -1 Then { ExitShort("sp1",AtLimit,하단-(상단-하단)*1,"",Floor(CurrentContracts*0.5),1); ExitShort("sp2",AtLimit,하단-(상단-하단)*3); } if TotalTrades > TotalTrades[1] and (IsExitName("bp1",1) or IsExitName("sp2",1)) Then xcond = true; ----------------------------------- 1. 첫 번째 청산 조건에 도달하면 현재 수량에서 1계약만 남기고 모두 청산하기. (bp1 또는 sp1 부분) 2. 첫 번째 청산 조건이 실행되면 if TotalTrades > TotalTrades[1] and (IsExitName("bp1",1) or IsExitName("sp2",1)) Then xcond = true; 조건문 실행하기 3. 1계약만 남은 경우, 80틱 이익이거나, 본절로 가격이 내려오면 남은 1계약 청산하기. 위와 같이 수식 수정하는 도움 부탁드립니다.
시스템
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2023-09-26 16:54:02

안녕하세요 예스스탁입니다. "bp2","sp2"는 불필요하시면 삭제하시면 됩니다. if MarketPosition == 1 Then { if CurrentContracts == MaxContracts Then ExitLong("bp1",AtLimit,상단+(상단-하단)*1,"",max(CurrentContracts-1,1),1); Else { ExitLong("bp2",AtLimit,상단+(상단-하단)*3); ExitLong("Bx1",AtLimit,EntryPrice+PriceScale*80); ExitLong("Bx2",AtStop,EntryPrice); } } if MarketPosition == -1 Then { if CurrentContracts == MaxContracts Then ExitShort("sp1",AtLimit,하단-(상단-하단)*1,"",max(CurrentContracts-1,1),1); Else { ExitShort("sp2",AtLimit,하단-(상단-하단)*3); ExitShort("sx1",AtLimit,EntryPrice-PriceScale*80); ExitShort("sx2",AtStop,EntryPrice); } } if CurrentContracts < CurrentContracts[1] and (LatestExitName(0) == "bp1" or LatestExitName(0) == "sp2") Then cond = true; 즐거운 명절되세요 > 예스쟁이 님이 쓴 글입니다. > 제목 : 일부청산 후 대기 후 나머지 청산하 수식 문의 > 항상 도움에 감사드립니다. 아래의 수식에 수정하고 싶은 내용이 있어 도움 부탁드립니다. -------------------------------------------- if MarketPosition == 1 Then { ExitLong("bp1",AtLimit,상단+(상단-하단)*1,"",Floor(CurrentContracts*0.5),1); ExitLong("bp2",AtLimit,상단+(상단-하단)*3); } if MarketPosition == -1 Then { ExitShort("sp1",AtLimit,하단-(상단-하단)*1,"",Floor(CurrentContracts*0.5),1); ExitShort("sp2",AtLimit,하단-(상단-하단)*3); } if TotalTrades > TotalTrades[1] and (IsExitName("bp1",1) or IsExitName("sp2",1)) Then xcond = true; ----------------------------------- 1. 첫 번째 청산 조건에 도달하면 현재 수량에서 1계약만 남기고 모두 청산하기. (bp1 또는 sp1 부분) 2. 첫 번째 청산 조건이 실행되면 if TotalTrades > TotalTrades[1] and (IsExitName("bp1",1) or IsExitName("sp2",1)) Then xcond = true; 조건문 실행하기 3. 1계약만 남은 경우, 80틱 이익이거나, 본절로 가격이 내려오면 남은 1계약 청산하기. 위와 같이 수식 수정하는 도움 부탁드립니다.