From b045c7cf0901475c7ec2b3c604db6a20db7c8aa1 Mon Sep 17 00:00:00 2001 From: Zeel Patel Date: Sat, 12 Jun 2021 23:05:12 -0700 Subject: [PATCH 1/4] Added blank line to fix lint issue kernc#223 --- backtesting/test/_test.py | 1 + 1 file changed, 1 insertion(+) diff --git a/backtesting/test/_test.py b/backtesting/test/_test.py index 3cbcc372..e4cc8d05 100644 --- a/backtesting/test/_test.py +++ b/backtesting/test/_test.py @@ -878,6 +878,7 @@ def next(self): stats = Backtest(GOOG, S).run() self.assertEqual(stats['# Trades'], 91) + class TestUtil(TestCase): def test_as_str(self): def func(): From 3ef557a655fe72d829852c6969abd5ce2f7fc33b Mon Sep 17 00:00:00 2001 From: Zeel Patel Date: Sat, 12 Jun 2021 23:08:27 -0700 Subject: [PATCH 2/4] added blank space to fix lint issue kernc#223 --- backtesting/lib.py | 1 + 1 file changed, 1 insertion(+) diff --git a/backtesting/lib.py b/backtesting/lib.py index e1c5b3a4..9df03ca8 100644 --- a/backtesting/lib.py +++ b/backtesting/lib.py @@ -486,6 +486,7 @@ def next(self): trade.sl = min(trade.sl or np.inf, self.data.Close[index]*(1+(self._sl_percent/100))) + # Prevent pdoc3 documenting __init__ signature of Strategy subclasses for cls in list(globals().values()): if isinstance(cls, type) and issubclass(cls, Strategy): From 898969c69756123636af9aec0e43692f6f9f9406 Mon Sep 17 00:00:00 2001 From: Zeel Patel Date: Sat, 12 Jun 2021 23:21:25 -0700 Subject: [PATCH 3/4] added blank line to fix lint issue kernc#223 --- backtesting/lib.py | 1 + 1 file changed, 1 insertion(+) diff --git a/backtesting/lib.py b/backtesting/lib.py index 9df03ca8..fe009f51 100644 --- a/backtesting/lib.py +++ b/backtesting/lib.py @@ -451,6 +451,7 @@ def next(self): trade.sl = min(trade.sl or np.inf, self.data.Close[index] + self.__atr[index] * self.__n_atr) + class PercentageTrailingStrategy(Strategy): """ A strategy with automatic trailing stop-loss, trailing the current From a7732f27f37755334304b2794139a1c459f7b124 Mon Sep 17 00:00:00 2001 From: Zeel Patel Date: Sat, 12 Jun 2021 23:31:15 -0700 Subject: [PATCH 4/4] Added blank line to fix lin issue kernc#223 --- backtesting/lib.py | 1 + 1 file changed, 1 insertion(+) diff --git a/backtesting/lib.py b/backtesting/lib.py index fe009f51..f7715e20 100644 --- a/backtesting/lib.py +++ b/backtesting/lib.py @@ -465,6 +465,7 @@ class PercentageTrailingStrategy(Strategy): overridden methods. """ _sl_percent = 5. + def init(self): super().init()