feat: update dry-run calculation params to be more generic

This commit is contained in:
Matthias
2024-08-29 19:55:21 +02:00
parent 0560567058
commit ec79b0b17b
3 changed files with 27 additions and 17 deletions

View File

@@ -3532,8 +3532,7 @@ class Exchange:
stake_amount: float,
leverage: float,
wallet_balance: float,
mm_ex_1: float = 0.0, # (Binance) Cross only
upnl_ex_1: float = 0.0, # (Binance) Cross only
other_trades: list,
) -> Optional[float]:
"""
Set's the margin mode on the exchange to cross or isolated for a specific pair
@@ -3555,8 +3554,7 @@ class Exchange:
leverage=leverage,
stake_amount=stake_amount,
wallet_balance=wallet_balance,
mm_ex_1=mm_ex_1,
upnl_ex_1=upnl_ex_1,
other_trades=other_trades,
)
else:
positions = self.fetch_positions(pair)
@@ -3582,8 +3580,7 @@ class Exchange:
stake_amount: float,
leverage: float,
wallet_balance: float, # Or margin balance
mm_ex_1: float = 0.0, # (Binance) Cross only
upnl_ex_1: float = 0.0, # (Binance) Cross only
other_trades: list,
) -> Optional[float]:
"""
Important: Must be fetching data from cached values as this is used by backtesting!
@@ -3608,10 +3605,7 @@ class Exchange:
:param wallet_balance: Amount of margin_mode in the wallet being used to trade
Cross-Margin Mode: crossWalletBalance
Isolated-Margin Mode: isolatedWalletBalance
# * Not required by Gate or OKX
:param mm_ex_1:
:param upnl_ex_1:
:param other_trades: List of other open trades in the same wallet
"""
market = self.markets[pair]