/** * Trading view/formatter helpers. * * Anything that turns engine state into human/agent-readable markdown * belongs here. Split out of `trading-execute.ts` so the tool handlers in * `trading-router.ts` stay focused on request handling and the engine * stays free of presentation concerns. This mirrors the view/controller * separation OpenBB enforces between `standard_models` (data) and the * router-side rendering that happens in their MCP layer. */ import type { Position } from '../trading/portfolio.js'; import type { Portfolio } from '../trading/portfolio.js'; import type { RiskConfig } from '../trading/risk.js'; import type { TradeLogEntry } from '../trading/trade-log.js'; export declare function formatUsd(n: number): string; export declare function formatPct(n: number): string; export declare function formatPositionLine(p: Position & { markUsd: number; unrealizedPnlUsd: number; }): string; export declare function formatTradeLine(entry: TradeLogEntry): string; /** Parse a window string ("24h", "7d", "all") into a lower-bound timestamp. */ export declare function windowToSince(window: string, now: number): number; export interface PortfolioSnapshot { cashUsd: number; equityUsd: number; unrealizedPnlUsd: number; realizedPnlUsd: number; positions: (Position & { markUsd: number; unrealizedPnlUsd: number; })[]; } export declare function renderPortfolio(snap: PortfolioSnapshot, riskConfig?: RiskConfig): string; export declare function renderOrderFilled(params: { symbol: string; fill: { qty: number; priceUsd: number; feeUsd: number; }; portfolio: Portfolio; }): string; export declare function renderOrderBlocked(params: { symbol: string; qty: number; priceUsd: number; reason: string; }): string; export declare function renderPositionClosed(params: { symbol: string; fill: { qty: number; priceUsd: number; feeUsd: number; }; tradeRealized: number; portfolio: Portfolio; }): string; export declare function renderTradeHistory(params: { windowRaw: string; entries: TradeLogEntry[]; realized: number; }): string;