chore: use "filled" over amount for balance distribution

This commit is contained in:
Matthias
2025-11-16 14:17:34 +01:00
parent c877d267c7
commit bf5ec98918
2 changed files with 2 additions and 2 deletions
@@ -91,7 +91,7 @@ def balance_distribution_over_time(
orders = [o for o in trade.orders if o["order_filled_timestamp"]]
for order in sorted(orders, key=lambda x: x["order_filled_timestamp"]):
filled_at = pd.Timestamp(dt_from_ts(order["order_filled_timestamp"]))
real_amount = order["amount"] / trade.leverage
real_amount = order.get("filled", order["amount"]) / trade.leverage
stake = order["safe_price"] * real_amount
if order["ft_is_entry"]:
fee = stake * trade.fee_open
@@ -30,7 +30,7 @@ def migrate_wallet_history(config: Config, exchange: Exchange, starting_balance:
def _migrate_wallet_history(config: Config, exchange: Exchange, starting_balance: float):
trade_df = trade_list_to_dataframe(Trade.get_trades_proxy())
trade_df = trade_list_to_dataframe(Trade.get_trades_proxy(), minified=False)
if trade_df.empty:
# no trades, nothing to do
return