mirror of
https://github.com/freqtrade/freqtrade.git
synced 2024-11-10 10:21:59 +00:00
Update method name for trade fee updating
This commit is contained in:
parent
048119ad3d
commit
5e6cda11ef
|
@ -191,7 +191,7 @@ class FreqtradeBot(LoggingMixin):
|
|||
# Check whether markets have to be reloaded and reload them when it's needed
|
||||
self.exchange.reload_markets()
|
||||
|
||||
self.update_closed_trades_without_assigned_fees()
|
||||
self.update_trades_without_assigned_fees()
|
||||
|
||||
# Query trades from persistence layer
|
||||
trades = Trade.get_open_trades()
|
||||
|
@ -354,7 +354,7 @@ class FreqtradeBot(LoggingMixin):
|
|||
if self.trading_mode == TradingMode.FUTURES:
|
||||
self._schedule.run_pending()
|
||||
|
||||
def update_closed_trades_without_assigned_fees(self) -> None:
|
||||
def update_trades_without_assigned_fees(self) -> None:
|
||||
"""
|
||||
Update closed trades without close fees assigned.
|
||||
Only acts when Orders are in the database, otherwise the last order-id is unknown.
|
||||
|
|
|
@ -5046,7 +5046,7 @@ def test_startup_backpopulate_precision(mocker, default_conf_usdt, fee, caplog):
|
|||
|
||||
@pytest.mark.usefixtures("init_persistence")
|
||||
@pytest.mark.parametrize("is_short", [False, True])
|
||||
def test_update_closed_trades_without_assigned_fees(mocker, default_conf_usdt, fee, is_short):
|
||||
def test_update_trades_without_assigned_fees(mocker, default_conf_usdt, fee, is_short):
|
||||
freqtrade = get_patched_freqtradebot(mocker, default_conf_usdt)
|
||||
|
||||
def patch_with_fee(order):
|
||||
|
@ -5075,7 +5075,7 @@ def test_update_closed_trades_without_assigned_fees(mocker, default_conf_usdt, f
|
|||
assert trade.fee_close_cost is None
|
||||
assert trade.fee_close_currency is None
|
||||
|
||||
freqtrade.update_closed_trades_without_assigned_fees()
|
||||
freqtrade.update_trades_without_assigned_fees()
|
||||
|
||||
# Does nothing for dry-run
|
||||
trades = Trade.get_trades().all()
|
||||
|
@ -5088,7 +5088,7 @@ def test_update_closed_trades_without_assigned_fees(mocker, default_conf_usdt, f
|
|||
|
||||
freqtrade.config['dry_run'] = False
|
||||
|
||||
freqtrade.update_closed_trades_without_assigned_fees()
|
||||
freqtrade.update_trades_without_assigned_fees()
|
||||
|
||||
trades = Trade.get_trades().all()
|
||||
assert len(trades) == MOCK_TRADE_COUNT
|
||||
|
@ -5551,7 +5551,7 @@ def test_position_adjust(mocker, default_conf_usdt, fee) -> None:
|
|||
assert trade.stake_amount == 110
|
||||
|
||||
# Assume it does nothing since order is closed and trade is open
|
||||
freqtrade.update_closed_trades_without_assigned_fees()
|
||||
freqtrade.update_trades_without_assigned_fees()
|
||||
|
||||
trade = Trade.query.first()
|
||||
assert trade
|
||||
|
@ -5622,7 +5622,7 @@ def test_position_adjust(mocker, default_conf_usdt, fee) -> None:
|
|||
mocker.patch('freqtrade.exchange.Exchange.create_order', fetch_order_mm)
|
||||
mocker.patch('freqtrade.exchange.Exchange.fetch_order', fetch_order_mm)
|
||||
mocker.patch('freqtrade.exchange.Exchange.fetch_order_or_stoploss_order', fetch_order_mm)
|
||||
freqtrade.update_closed_trades_without_assigned_fees()
|
||||
freqtrade.update_trades_without_assigned_fees()
|
||||
|
||||
orders = Order.query.all()
|
||||
assert orders
|
||||
|
@ -5839,7 +5839,7 @@ def test_position_adjust2(mocker, default_conf_usdt, fee) -> None:
|
|||
assert trade.stake_amount == bid * amount
|
||||
|
||||
# Assume it does nothing since order is closed and trade is open
|
||||
freqtrade.update_closed_trades_without_assigned_fees()
|
||||
freqtrade.update_trades_without_assigned_fees()
|
||||
|
||||
trade = Trade.query.first()
|
||||
assert trade
|
||||
|
|
Loading…
Reference in New Issue
Block a user