From 7585d54eb0a5f094cd95db553c8cf37dac368e4e Mon Sep 17 00:00:00 2001 From: Dmitry Maylarov Date: Mon, 31 Jan 2022 16:45:42 +0300 Subject: [PATCH] fix negative comms --- strategies.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/strategies.py b/strategies.py index d59fc7e..b811f82 100644 --- a/strategies.py +++ b/strategies.py @@ -43,7 +43,7 @@ class PercentageCommisionScheme(bt.CommInfoBase): ) def _getcommission(self, size, price, pseudoexec): - return size * price * self.p.commission + 4 # 290rub/month + return abs(size * price * self.p.commission) + 4 # 290rub/month class Investing(bt.Strategy):