From 1f8cfa7548594860a25fb2ed4049a97d7f448e6e Mon Sep 17 00:00:00 2001 From: 1122455801 Date: Thu, 13 Jun 2019 10:57:01 +0800 Subject: [PATCH] Update converter.py --- vnpy/app/cta_strategy/converter.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/vnpy/app/cta_strategy/converter.py b/vnpy/app/cta_strategy/converter.py index 0ba57bba..2fe11b05 100644 --- a/vnpy/app/cta_strategy/converter.py +++ b/vnpy/app/cta_strategy/converter.py @@ -240,7 +240,7 @@ class PositionHolding: td_available = self.long_td - self.long_td_frozen if req.volume > pos_available: - return [req] + return [] elif req.volume <= td_available: req_td = copy(req) req_td.offset = Offset.CLOSETODAY @@ -278,7 +278,7 @@ class PositionHolding: # If no td_volume, we close opposite yd position first # then open new position else: - open_volume = max(0, yd_available - req.volume) + open_volume = max(0, req.volume - yd_available) req_list = [] if yd_available: