diff --git a/freqtrade/persistence/models.py b/freqtrade/persistence/models.py index 9de1947db..e785ba49b 100644 --- a/freqtrade/persistence/models.py +++ b/freqtrade/persistence/models.py @@ -325,6 +325,7 @@ class LocalTrade(): if self.isolated_liq: self.set_isolated_liq(self.isolated_liq) self.recalc_open_trade_value() + # TODO-lev: Throw exception if on margin and interest_rate is none def _set_stop_loss(self, stop_loss: float, percent: float): """ diff --git a/tests/conftest.py b/tests/conftest.py index 188236f40..609823409 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -6,6 +6,7 @@ from copy import deepcopy from datetime import datetime, timedelta from functools import reduce from pathlib import Path +from typing import Tuple from unittest.mock import MagicMock, Mock, PropertyMock import arrow @@ -262,6 +263,10 @@ def create_mock_trades_with_leverage(fee, use_db: bool = True): Trade.query.session.flush() +def get_sides(is_short: bool) -> Tuple[str, str]: + return ("sell", "buy") if is_short else ("buy", "sell") + + @pytest.fixture(autouse=True) def patch_coingekko(mocker) -> None: """