Skip to content

Commit

Permalink
feat: add stake_amount_filled order attribute
Browse files Browse the repository at this point in the history
  • Loading branch information
xmatthias committed Nov 5, 2024
1 parent 5cb4a65 commit 3d307fe
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions freqtrade/persistence/trade_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,11 @@ def stake_amount(self) -> float:
"""Amount in stake currency used for this order"""
return self.safe_amount * self.safe_price / self.trade.leverage

@property
def stake_amount_filled(self) -> float:
"""Filled Amount in stake currency used for this order"""
return self.safe_filled * self.safe_price / self.trade.leverage

def __repr__(self):
return (
f"Order(id={self.id}, trade={self.ft_trade_id}, order_id={self.order_id}, "
Expand Down

0 comments on commit 3d307fe

Please sign in to comment.