Merge pull request #4996 from JoeSchr/patch-5

Fix missing `not` in `empty` check
This commit is contained in:
Matthias 2021-05-22 13:57:17 +01:00 committed by GitHub
commit 5191c869c9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -65,7 +65,7 @@ class AwesomeStrategy(IStrategy):
# Look up trade candle.
trade_candle = dataframe.loc[dataframe['date'] == trade_date]
# trade_candle may be empty for trades that just opened as it is still incomplete.
if trade_candle.empty:
if not trade_candle.empty:
trade_candle = trade_candle.squeeze()
# <...>
```