feat: Sort trades by entry_date before plotting trade history

This commit is contained in:
Bobby (aider) 2025-02-19 20:39:59 -08:00
parent c802bc0584
commit b9c3b601fe

View File

@ -148,6 +148,9 @@ def plot_trade_history(trades):
pnl = []
cumulative_pnl = 0
# Sort trades by entry_date
trades.sort(key=lambda x: x.get('entry_date'))
for trade in trades:
try:
# For sell orders