import type { ColumnDef } from '@tanstack/react-table'; import type { BacktestRunTrade as Trade } from '@stock-bot/types'; import { DataTable } from '@/components/ui/DataTable'; import { browserLog } from '@/utils/browserLog'; import type { RunResult } from '../services/backtestApiV2'; interface BacktestTradesProps { result: RunResult | null; isLoading: boolean; } export function BacktestTrades({ result, isLoading }: BacktestTradesProps) { if (isLoading) { return (
No trades executed in this backtest.
Closed Trades
{result.metrics.totalTrades}
Win Rate
{winRate.toFixed(1)}%
Wins
{tradeStats.wins}
Losses
{tradeStats.losses}
Total P&L
= 0 ? 'text-success' : 'text-error'}`} > ${tradeStats.totalPnL.toFixed(2)}