Add sell_order_status to keep track of cancellations

This commit is contained in:
Matthias
2020-05-17 10:52:20 +02:00
parent 15ef6df950
commit 1e76bff1bd
6 changed files with 21 additions and 4 deletions

View File

@@ -60,6 +60,7 @@ def test_rpc_trade_status(default_conf, ticker, fee, mocker) -> None:
'open_trade_price': ANY,
'close_rate_requested': ANY,
'sell_reason': ANY,
'sell_order_status': ANY,
'min_rate': ANY,
'max_rate': ANY,
'strategy': ANY,
@@ -103,6 +104,7 @@ def test_rpc_trade_status(default_conf, ticker, fee, mocker) -> None:
'open_trade_price': ANY,
'close_rate_requested': ANY,
'sell_reason': ANY,
'sell_order_status': ANY,
'min_rate': ANY,
'max_rate': ANY,
'strategy': ANY,

View File

@@ -520,6 +520,7 @@ def test_api_status(botclient, mocker, ticker, fee, markets):
'open_rate_requested': 1.098e-05,
'open_trade_price': 0.0010025,
'sell_reason': None,
'sell_order_status': None,
'strategy': 'DefaultStrategy',
'ticker_interval': 5}]
@@ -626,6 +627,7 @@ def test_api_forcebuy(botclient, mocker, fee):
'open_rate_requested': None,
'open_trade_price': 0.2460546025,
'sell_reason': None,
'sell_order_status': None,
'strategy': None,
'ticker_interval': None
}

View File

@@ -170,6 +170,7 @@ def test_status(default_conf, update, mocker, fee, ticker,) -> None:
'current_profit': -0.59,
'initial_stop_loss': 1.098e-05,
'stop_loss': 1.099e-05,
'sell_order_status': None,
'initial_stop_loss_pct': -0.05,
'stop_loss_pct': -0.01,
'open_order': '(limit buy rem=0.00000000)'

View File

@@ -477,6 +477,7 @@ def test_migrate_old(mocker, default_conf, fee):
assert trade.close_rate_requested is None
assert trade.close_rate is not None
assert pytest.approx(trade.close_profit_abs) == trade.calc_profit()
assert trade.sell_order_status is None
def test_migrate_new(mocker, default_conf, fee, caplog):
@@ -756,6 +757,7 @@ def test_to_json(default_conf, fee):
'stake_amount': 0.001,
'close_profit': None,
'sell_reason': None,
'sell_order_status': None,
'stop_loss': None,
'stop_loss_pct': None,
'initial_stop_loss': None,
@@ -810,6 +812,7 @@ def test_to_json(default_conf, fee):
'open_rate_requested': None,
'open_trade_price': 12.33075,
'sell_reason': None,
'sell_order_status': None,
'strategy': None,
'ticker_interval': None}