Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions freqtrade/exchange/exchange.py
Original file line number Diff line number Diff line change
Expand Up @@ -1303,7 +1303,7 @@ def check_dry_limit_order_filled(

return order

def fetch_dry_run_order(self, order_id) -> CcxtOrder:
def fetch_dry_run_order(self, order_id: str) -> CcxtOrder:
"""
Return dry-run order
Only call if running in dry-run mode.
Expand All @@ -1315,11 +1315,12 @@ def fetch_dry_run_order(self, order_id) -> CcxtOrder:
except KeyError as e:
from freqtrade.persistence import Order

order = Order.order_by_id(order_id)
if order:
ccxt_order = order.to_ccxt_object(self._ft_has["stop_price_prop"])
self._dry_run_open_orders[order_id] = ccxt_order
return ccxt_order
order_obj = Order.order_by_id(order_id)
if order_obj:
order = order_obj.to_ccxt_object(self._ft_has["stop_price_prop"])
order = self.check_dry_limit_order_filled(order)
self._dry_run_open_orders[order_id] = order
return order
# Gracefully handle errors with dry-run orders.
raise InvalidOrderException(
f"Tried to get an invalid dry-run-order (id: {order_id}). Message: {e}"
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ ft-pandas-ta==0.3.16
ta-lib==0.6.8
technical==1.5.3

ccxt==4.5.19
ccxt==4.5.20
cryptography==46.0.3
aiohttp==3.13.2
SQLAlchemy==2.0.44
Expand Down
2 changes: 2 additions & 0 deletions tests/conftest_trades_usdt.py
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,7 @@ def mock_order_usdt_6(is_short: bool):
"side": entry_side(is_short),
"type": "limit",
"price": 10.0,
"cost": 20.0,
"amount": 2.0,
"filled": 2.0,
"remaining": 0.0,
Expand All @@ -317,6 +318,7 @@ def mock_order_usdt_6_exit(is_short: bool):
"side": exit_side(is_short),
"type": "limit",
"price": 12.0,
"cost": 24.0,
"amount": 2.0,
"filled": 0.0,
"remaining": 2.0,
Expand Down
3 changes: 0 additions & 3 deletions tests/exchange_online/test_ccxt_compat.py
Original file line number Diff line number Diff line change
Expand Up @@ -437,9 +437,6 @@ def test_ccxt_get_fee_spot(self, exchange: EXCHANGE_FIXTURE_TYPE):
def test_ccxt_get_fee_futures(self, exchange_futures: EXCHANGE_FIXTURE_TYPE):
exch, exchangename = exchange_futures
pair = EXCHANGES[exchangename].get("futures_pair", EXCHANGES[exchangename]["pair"])
if exchangename == "gate":
# gate futures fees are sometimes zero
pytest.skip("Gate futures fees are currently not working.")
self._ccxt_get_fee(exch, pair)

def test_ccxt_get_max_leverage_spot(self, exchange: EXCHANGE_FIXTURE_TYPE):
Expand Down
1 change: 1 addition & 0 deletions tests/freqtradebot/test_freqtradebot.py
Original file line number Diff line number Diff line change
Expand Up @@ -4525,6 +4525,7 @@ def test_check_for_open_trades(mocker, default_conf_usdt, fee, is_short):
def test_startup_update_open_orders(mocker, default_conf_usdt, fee, caplog, is_short):
freqtrade = get_patched_freqtradebot(mocker, default_conf_usdt)
create_mock_trades(fee, is_short=is_short)
mocker.patch(f"{EXMS}._dry_is_price_crossed", return_value=False)

freqtrade.startup_update_open_orders()
assert not log_has_re(r"Error updating Order .*", caplog)
Expand Down
Loading