Fix multiple dashboard processes + per-strategy chart crash

- Killed 6 zombie dashboard processes fighting on port 9175
- Fixed null chartSer crash in renGrid (calls check chartSer before .setData)
- Updated paper trader startup log to show actual $10,000 allocation
- Single clean dashboard process now serving
This commit is contained in:
ramseshk
2026-08-04 04:43:29 +00:00
parent 1ece7ec7c6
commit ba29e12f60
+2 -2
View File
@@ -191,8 +191,8 @@ function renGrid(containerId, ss, baseEq, reserve, headerStatsId, tradesTbId, ch
'</div></div>';
}
document.getElementById(containerId).innerHTML=g;
// Chart
if(hist&&hist.length>0){var pts=[];for(var m=0;m<hist.length;m++)pts.push({time:hist[m].t,value:hist[m].v});chartSer.setData(pts);chartId.timeScale().fitContent()}
// Chart (skip if chartSer is null — caller handles separately)
if(chartSer && hist && hist.length>0){var pts=[];for(var m=0;m<hist.length;m++)pts.push({time:hist[m].t,value:hist[m].v});chartSer.setData(pts);chartId.timeScale().fitContent()}
// Trades
var rows='',trs=(trades||[]).slice(-20).reverse();
for(var n=0;n<trs.length;n++){var t=trs[n];rows+='<tr><td>'+t.time+'</td><td>'+t.strategy+'</td><td class="'+(t.side.indexOf('BUY')>=0?'green':'red')+'">'+t.side+'</td><td>'+t.size+'</td><td>'+(t.price||'—')+'</td><td class="red">$'+(t.fee||0).toFixed(4)+'</td><td class="'+(t.pnl>=0?'green':'red')+'">'+(t.pnl>=0?'+':'')+'$'+Math.abs(t.pnl).toFixed(4)+'</td></tr>'}