Convert nan to None in get_signal.

This commit is contained in:
Matthias
2022-01-16 08:04:39 +01:00
parent 39184e1f95
commit 6c4b261469
2 changed files with 7 additions and 0 deletions

View File

@@ -36,6 +36,10 @@ def test_returns_latest_signal(ohlcv_history):
mocked_history = ohlcv_history.copy()
mocked_history['sell'] = 0
mocked_history['buy'] = 0
# Set tags in lines that don't matter to test nan in the sell line
mocked_history.loc[0, 'buy_tag'] = 'wrong_line'
mocked_history.loc[0, 'exit_tag'] = 'wrong_line'
mocked_history.loc[1, 'sell'] = 1
assert _STRATEGY.get_signal('ETH/BTC', '5m', mocked_history) == (False, True, None, None)