From 86c7ef0f645b04dab7be9f837b533fbc0ef9197d Mon Sep 17 00:00:00 2001 From: Juice Man <92176188+ElPettego@users.noreply.github.com> Date: Fri, 14 Apr 2023 17:45:05 +0200 Subject: [PATCH] cash > 0 more readable --- backtesting/backtesting.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backtesting/backtesting.py b/backtesting/backtesting.py index 9c168703..d37f5857 100644 --- a/backtesting/backtesting.py +++ b/backtesting/backtesting.py @@ -700,7 +700,7 @@ def __set_contingent(self, type, price): class _Broker: def __init__(self, *, data, cash, commission, margin, trade_on_close, hedging, exclusive_orders, index): - assert 0 < cash, f"cash should be >0, is {cash}" + assert cash > 0, f"cash should be > 0, is {cash}" assert -.1 <= commission < .1, \ ("commission should be between -10% " f"(e.g. market-maker's rebates) and 10% (fees), is {commission}")