Skip to content

Commit fbbb24a

Browse files
committed
DOC: Better explain AssertionError on price value
Fixes #1142
1 parent 5197b44 commit fbbb24a

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
@@ -718,7 +718,7 @@ def tp(self, price: float):
718718

719719
def __set_contingent(self, type, price):
720720
assert type in ('sl', 'tp')
721-
assert price is None or 0 < price < np.inf
721+
assert price is None or 0 < price < np.inf, f'Make sure 0 < price < inf! price: {price}'
722722
attr = f'_{self.__class__.__qualname__}__{type}_order'
723723
order: Order = getattr(self, attr)
724724
if order:

0 commit comments

Comments
 (0)