/* * ============================================================================= * VibeQuant (vquant) — AI-Powered Financial Intelligence Platform * ----------------------------------------------------------------------------- * File: client/src/components/chat/monte-carlo-results.tsx * * Author: Simon-Pierre Boucher * Contact: contact@spboucher.ai * Website: https://www.spboucher.ai * Demo: https://www.vquant.ai * License: MIT (see LICENSE) * * Copyright © 2026 Simon-Pierre Boucher. All rights reserved. * ============================================================================= */ import { motion } from "framer-motion"; import { Card, CardHeader, CardTitle, CardContent } from "@/components/ui/card"; import { TrendingUp, Code2, BarChart3, DollarSign } from "lucide-react"; import { Badge } from "@/components/ui/badge"; import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs"; interface MonteCarloResultsProps { pythonCode?: string; results?: { success: boolean; parameters?: { num_simulations: number; time_horizon: number; initial_investment: number; mean_return: number; std_return: number; }; statistics?: { mean_final_value: number; median_final_value: number; std_final_value: number; min_final_value: number; max_final_value: number; percentile_5: number; percentile_25: number; percentile_75: number; percentile_95: number; probability_of_profit: number; }; }; } export function MonteCarloResults({ pythonCode, results }: MonteCarloResultsProps) { if (!pythonCode && !results) return null; const formatCurrency = (value: number) => { return new Intl.NumberFormat('fr-FR', { style: 'currency', currency: 'USD', minimumFractionDigits: 2, maximumFractionDigits: 2 }).format(value); }; const formatPercent = (value: number) => { return `${value.toFixed(2)}%`; }; return (
Simulation Monte Carlo

Analyse de risque et projection des rendements futurs

Résultats Code Python {results?.success && results.statistics && results.parameters ? (
{/* Parameters */}

Paramètres de simulation

Simulations

{results.parameters.num_simulations.toLocaleString()}

Horizon (jours)

{results.parameters.time_horizon}

Investissement initial

{formatCurrency(results.parameters.initial_investment)}

Volatilité

{formatPercent(results.parameters.std_return * 100)}

{/* Key Statistics */}

Valeur moyenne

{formatCurrency(results.statistics.mean_final_value)}

Valeur médiane

{formatCurrency(results.statistics.median_final_value)}

Probabilité de profit

{formatPercent(results.statistics.probability_of_profit)}

{/* Percentiles */}

Distribution des résultats

5e percentile (pire scénario probable) {formatCurrency(results.statistics.percentile_5)}
25e percentile {formatCurrency(results.statistics.percentile_25)}
75e percentile {formatCurrency(results.statistics.percentile_75)}
95e percentile (meilleur scénario probable) {formatCurrency(results.statistics.percentile_95)}
{/* Range */}

Plage de résultats

Minimum

{formatCurrency(results.statistics.min_final_value)}

Maximum

{formatCurrency(results.statistics.max_final_value)}

) : (
Aucun résultat disponible
)} {pythonCode ? (
Python
                    {pythonCode}
                  
) : (
Aucun code disponible
)}
); }