wip
This commit is contained in:
parent
d29cc312fd
commit
c72199400d
@ -409,7 +409,8 @@ def update_live_html(candles, trade_history, epoch, loss, total_pnl):
|
|||||||
fig, ax = plt.subplots(figsize=(12, 6))
|
fig, ax = plt.subplots(figsize=(12, 6))
|
||||||
update_live_chart(ax, candles, trade_history)
|
update_live_chart(ax, candles, trade_history)
|
||||||
epoch_pnl = sum(trade["pnl"] for trade in trade_history)
|
epoch_pnl = sum(trade["pnl"] for trade in trade_history)
|
||||||
ax.set_title(f"Epoch {epoch} | Loss: {loss:.4f} | PnL: {epoch_pnl:.2f}| Total PnL: {total_pnl:.2f}")
|
|
||||||
|
ax.set_title(f"Epoch {epoch} | Loss: {loss:.4f} | PnL: {epoch_pnl:.2f} | Total PnL: {total_pnl:.2f}")
|
||||||
buf = BytesIO()
|
buf = BytesIO()
|
||||||
fig.savefig(buf, format='png')
|
fig.savefig(buf, format='png')
|
||||||
plt.close(fig)
|
plt.close(fig)
|
||||||
@ -442,7 +443,7 @@ def update_live_html(candles, trade_history, epoch, loss, total_pnl):
|
|||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div class="chart-container">
|
<div class="chart-container">
|
||||||
<h2>Epoch {epoch} | Loss: {loss:.4f} | PnL: {epoch_pnl:.2f}| Total PnL: {total_pnl:.2f}</h2>
|
<h2>Epoch {epoch} | Loss: {loss:.4f} | PnL: {epoch_pnl:.2f} | Total PnL: {total_pnl:.2f}</h2>
|
||||||
<img src="data:image/png;base64,{image_base64}" alt="Live Chart"/>
|
<img src="data:image/png;base64,{image_base64}" alt="Live Chart"/>
|
||||||
</div>
|
</div>
|
||||||
</body>
|
</body>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user