Skip to content

Commit 8dd1e36

Browse files
committed
BUG: Fix Order.__repr__ issue with non-numeric order.tag from 592ea41
Described in #200 (comment) Thanks @maneum1!
1 parent ec87aae commit 8dd1e36

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

backtesting/backtesting.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -406,7 +406,7 @@ def _replace(self, **kwargs):
406406
return self
407407

408408
def __repr__(self):
409-
return '<Order {}>'.format(', '.join(f'{param}={round(value, 5)}'
409+
return '<Order {}>'.format(', '.join(f'{param}={try_(lambda: round(value, 5), value)!r}'
410410
for param, value in (
411411
('size', self.__size),
412412
('limit', self.__limit_price),

0 commit comments

Comments
 (0)