@extends('layouts.app') @section('title', 'Trade Tracking - CLEDA.I Insights') @section('content')

{{ $activeTradesCount ?? 0 }}

Active Trades

${{ number_format($totalValue ?? 0, 2) }}

Total Portfolio Value

${{ number_format($totalPnL ?? 0, 2) }}

Total P&L

{{ number_format($winRate ?? 0, 1) }}%

Win Rate

@if(isset($activeTrades) && $activeTrades->count() > 0)

Active Trades {{ $activeTrades->count() }}

@foreach($activeTrades as $trade)
{{ $trade->ticker }}
{{ $trade->company_name ?? 'Company Name' }}
{{ ucfirst($trade->status) }}
Action: {{ strtoupper($trade->action) }}
Type: {{ strtoupper($trade->trade_type) }}
@if($trade->trade_type === 'call' || $trade->trade_type === 'put')
Contracts: {{ $trade->contracts ?? $trade->shares }}
Strike: ${{ number_format($trade->strike_price, 2) }}
Expiration: {{ \Carbon\Carbon::parse($trade->expiration_date)->format('M j, Y') }} @php $daysToExp = \Carbon\Carbon::now()->diffInDays(\Carbon\Carbon::parse($trade->expiration_date), false); @endphp {{ $daysToExp > 0 ? $daysToExp . ' days' : 'Expired' }}
@else
Shares: {{ $trade->shares }}
Entry Price: ${{ number_format($trade->share_price, 2) }}
@endif
Cost: ${{ number_format($trade->cost_estimate, 2) }}
@php $currentPnL = $trade->current_pnl ?? 0; @endphp Current P&L: ${{ number_format($currentPnL, 2) }}
@php $returnPercent = $trade->cost_estimate > 0 ? (($currentPnL / $trade->cost_estimate) * 100) : 0; $progressClass = $returnPercent >= 0 ? 'bg-success' : 'bg-danger'; $progressWidth = min(abs($returnPercent), 100); @endphp
Return: {{ number_format($returnPercent, 1) }}%
@endforeach
@endif @if(isset($recentClosedTrades) && $recentClosedTrades->count() > 0)

Recent Closed Trades {{ $recentClosedTrades->count() }}

@foreach($recentClosedTrades as $trade) @endforeach
Ticker Type Action Entry Date Close Date Cost Final P&L Return % Actions
{{ $trade->ticker }}
{{ $trade->company_name ?? 'N/A' }}
{{ strtoupper($trade->trade_type) }} {{ strtoupper($trade->action) }} {{ \Carbon\Carbon::parse($trade->created_at)->format('M j, Y') }} {{ \Carbon\Carbon::parse($trade->updated_at)->format('M j, Y') }} ${{ number_format($trade->cost_estimate, 2) }} ${{ number_format($trade->final_pnl ?? 0, 2) }} {{ number_format($trade->return_percentage ?? 0, 1) }}%
@endif
@endsection