Convert nan to None in get_signal.
This commit is contained in:
@@ -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)
|
||||
|
Reference in New Issue
Block a user