mirror of
https://github.com/chainstacklabs/pumpfun-bonkfun-bot.git
synced 2026-08-15 00:08:04 +00:00
Update src/trading/position.py
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
This commit is contained in:
co-authored by
coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
parent
578c24b17f
commit
8f8fa2a526
@@ -156,5 +156,10 @@ class Position:
|
|||||||
|
|
||||||
def __str__(self) -> str:
|
def __str__(self) -> str:
|
||||||
"""String representation of position."""
|
"""String representation of position."""
|
||||||
status = "ACTIVE" if self.is_active else f"CLOSED ({self.exit_reason.value})"
|
if self.is_active:
|
||||||
|
status = "ACTIVE"
|
||||||
|
elif self.exit_reason:
|
||||||
|
status = f"CLOSED ({self.exit_reason.value})"
|
||||||
|
else:
|
||||||
|
status = "CLOSED (UNKNOWN)"
|
||||||
return f"Position({self.symbol}: {self.quantity:.6f} @ {self.entry_price:.8f} SOL - {status})"
|
return f"Position({self.symbol}: {self.quantity:.6f} @ {self.entry_price:.8f} SOL - {status})"
|
||||||
Reference in New Issue
Block a user