Skip to content

Commit

Permalink
updated
Browse files Browse the repository at this point in the history
  • Loading branch information
abbass2 committed Nov 5, 2023
1 parent 2d3ac61 commit b9b3055
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
4 changes: 2 additions & 2 deletions pyqstrat/account.py
Original file line number Diff line number Diff line change
Expand Up @@ -288,14 +288,14 @@ def roundtrip_trades(trades: list[Trade]) -> list[RoundTripTrade]:
'''
rtt: list[RoundTripTrade] = []
stacks: dict[str, deque] = defaultdict(deque)
_trades = copy.deepcopy(trades)
_trades = copy.copy(trades)

# Keep track of index
for i, trade in enumerate(_trades):
trade.properties.index = i

for _trade in _trades:
trade = copy.deepcopy(_trade)
trade = copy.copy(_trade) # note this is a shallow copy so don't modify any objects
while True:
rt = _net_trade(stacks[trade.contract.symbol], trade)
if rt is None: break
Expand Down
1 change: 0 additions & 1 deletion pyqstrat/pq_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,6 @@ class OrderStatus(Enum):
CANCELLED = 5


# class syntax
class TimeInForce(Enum):
FOK = 1 # Fill or Kill
GTC = 2 # Good till Cancelled
Expand Down

0 comments on commit b9b3055

Please sign in to comment.