feat: Sort trades by entry_date before plotting trade history
This commit is contained in:
parent
c802bc0584
commit
b9c3b601fe
@ -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
|
||||
|
||||
Loading…
Reference in New Issue
Block a user