We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 6cbdd99 commit 5e72e7bCopy full SHA for 5e72e7b
backtesting/backtesting.py
@@ -959,6 +959,9 @@ def _process_orders(self):
959
// adjusted_price_plus_commission), size)
960
# Not enough cash/margin even for a single unit
961
if not size:
962
+ warnings.warn(
963
+ f'time={self._i}: Broker canceled the relative-sized '
964
+ f'order due to insufficient margin.', category=UserWarning)
965
# XXX: The order is canceled by the broker?
966
self.orders.remove(order)
967
continue
0 commit comments