mirror of
https://github.com/freqtrade/freqtrade.git
synced 2024-09-20 01:21:11 +00:00
flake8 fix and cleanup
This commit is contained in:
parent
2811a470aa
commit
6b8ca7217b
|
@ -1710,7 +1710,7 @@ class FreqtradeBot(LoggingMixin):
|
||||||
self.handle_cancel_exit(
|
self.handle_cancel_exit(
|
||||||
trade, order, open_order, reason
|
trade, order, open_order, reason
|
||||||
)
|
)
|
||||||
|
|
||||||
def cancel_all_open_orders(self) -> None:
|
def cancel_all_open_orders(self) -> None:
|
||||||
"""
|
"""
|
||||||
Cancel all orders that are currently open
|
Cancel all orders that are currently open
|
||||||
|
@ -1975,7 +1975,7 @@ class FreqtradeBot(LoggingMixin):
|
||||||
[trade.exit_side]
|
[trade.exit_side]
|
||||||
)
|
)
|
||||||
Trade.commit()
|
Trade.commit()
|
||||||
|
|
||||||
# First cancelling stoploss on exchange ...
|
# First cancelling stoploss on exchange ...
|
||||||
trade = self.cancel_stoploss_on_exchange(trade)
|
trade = self.cancel_stoploss_on_exchange(trade)
|
||||||
|
|
||||||
|
|
|
@ -639,7 +639,7 @@ class LocalTrade:
|
||||||
logger.info(f"untied_remaining: {untied_remaining}")
|
logger.info(f"untied_remaining: {untied_remaining}")
|
||||||
|
|
||||||
return untied_remaining
|
return untied_remaining
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def has_untied_assets(self) -> bool:
|
def has_untied_assets(self) -> bool:
|
||||||
"""
|
"""
|
||||||
|
|
|
@ -480,23 +480,12 @@ def test_dca_order_adjust(default_conf_usdt, ticker_usdt, leverage, fee, mocker,
|
||||||
assert pytest.approx(trade.orders[-1].amount) == 91.689215 * leverage
|
assert pytest.approx(trade.orders[-1].amount) == 91.689215 * leverage
|
||||||
assert freqtrade.strategy.adjust_entry_price.call_count == 0
|
assert freqtrade.strategy.adjust_entry_price.call_count == 0
|
||||||
|
|
||||||
print("BEFORE Process trade.orders")
|
|
||||||
print(trade.orders)
|
|
||||||
|
|
||||||
# adding this will prevent the second exit order creation, but this test case must be handled properly
|
|
||||||
#freqtrade.strategy.custom_exit = MagicMock(return_value=None)
|
|
||||||
|
|
||||||
caplog.clear()
|
caplog.clear()
|
||||||
caplog.set_level(logging.DEBUG)
|
caplog.set_level(logging.DEBUG)
|
||||||
# Process again, should not adjust entry price
|
# Process again, should not adjust entry price
|
||||||
freqtrade.process()
|
freqtrade.process()
|
||||||
trade = Trade.get_trades().first()
|
trade = Trade.get_trades().first()
|
||||||
|
|
||||||
print(f"DEBUG TEST")
|
|
||||||
print(caplog.text)
|
|
||||||
print("AFTER Process trade.orders")
|
|
||||||
print(trade.orders)
|
|
||||||
|
|
||||||
assert trade.orders[-2].status == "canceled"
|
assert trade.orders[-2].status == "canceled"
|
||||||
assert len(trade.orders) == 6
|
assert len(trade.orders) == 6
|
||||||
assert trade.orders[-1].side == trade.exit_side
|
assert trade.orders[-1].side == trade.exit_side
|
||||||
|
|
Loading…
Reference in New Issue
Block a user