@extends('portal.layouts.master') @section('title', $symbol->name . ' Position') @section('page-title', $symbol->name) @section('extra-css') .stat-pills { display: flex; gap: .75rem; flex-wrap: wrap; margin-bottom: 1rem; } .stat-pill { background: var(--bg-card); border: 1px solid var(--border); border-radius: 8px; padding: .65rem 1rem; flex: 1; min-width: 130px; } .stat-pill .lbl { font-size: .68rem; color: var(--text-secondary); text-transform: uppercase; letter-spacing: .04em; } .stat-pill .val { font-size: 1.05rem; font-weight: 700; margin-top: .1rem; } #perf_chart { width: 100%; height: 420px; } @endsection @section('content')
Back to Portfolio
{{-- Symbol header --}}
{{ strtoupper(substr($symbol->name, 0, 2)) }}

{{ $symbol->name }}

{{ $symbol->tv_symbol }} · {{ ucfirst($symbol->category) }}
@if($latestPrice > 0)
{{ \App\Support\MarketPriceFormatter::format($latestPrice) }}
Twelve Data
@endif Trade
{{-- Position stats --}} @if($position && (float) $position->quantity > 0)
Quantity
{{ rtrim(rtrim(number_format($position->quantity, 8), '0'), '.') }}
Avg. Entry
{{ number_format($position->avg_price, $symbol->decimal_places) }}
Current Value
{{ $latestPrice > 0 ? '$' . number_format($currentValue, 2) : '—' }}
Unrealised P&L
@if($latestPrice > 0)
{{ ($unrealisedPnl >= 0 ? '+' : '') . number_format($unrealisedPnl, 2) }} ({{ ($pnlPercent >= 0 ? '+' : '') . number_format($pnlPercent, 2) }}%)
@else
—
@endif
@endif {{-- Performance Chart --}}
Twelve Data Price History @if($position && $position->avg_price > 0) · ⎯⎯ Entry @ {{ number_format($position->avg_price, $symbol->decimal_places) }} @endif
{{-- Trade history --}}
Trade History — {{ $symbol->name }}
@if($trades->isEmpty())
No trades yet for this symbol.
@else
@foreach($trades as $trade) @endforeach
Date Side Quantity Price Total Currency
{{ $trade->traded_at->format('Y-m-d H:i') }} {{ strtoupper($trade->side) }} {{ rtrim(rtrim(number_format($trade->quantity, 8), '0'), '.') }} {{ number_format($trade->price, $symbol->decimal_places) }} {{ number_format($trade->total_cost, 2) }} {{ $trade->currency }}
@endif
@endsection @section('page-js') @endsection