feat: display five GLB PnL series with distinct colors
Deploy production / deploy (push) Successful in 56s
Deploy production / deploy (push) Successful in 56s
This commit is contained in:
@@ -26,10 +26,13 @@ async def search(ctx, args):
|
||||
async def pnl(ctx, args):
|
||||
data = await ctx.business.get_alpha_pnl(args.alpha_id)
|
||||
points = data.pop("points")
|
||||
# Chart data is fetched by the UI; keep large series out of model context.
|
||||
series = data.pop("series", [])
|
||||
return {
|
||||
**data,
|
||||
"alpha_id": args.alpha_id,
|
||||
"count": len(points),
|
||||
"series": [{"id": item["id"], "label": item["label"]} for item in series],
|
||||
"first": points[0] if points else None,
|
||||
"last": points[-1] if points else None,
|
||||
"null_count": sum(p["value"] is None for p in points),
|
||||
|
||||
Reference in New Issue
Block a user