# V5.2 Frontend Differentiation Task ## Problem V5.1 and V5.2 currently share the same pages. Boss wants clear visual separation. ## Requirements ### 1. Signals Page (/signals) - Side-by-side comparison Currently shows one set of scores per coin. Change to show BOTH V5.1 and V5.2 scores side by side. For the "Latest Signal" cards at the top, each coin should show: ``` BTC SHORT V5.1: 80分 | V5.2: 85分 5m前 ``` The V5.2 score should show FR and Liquidation subscores that V5.1 doesn't have. To get V5.2 scores, add a new API endpoint `/api/signals/latest-v52` that returns the V5.2 evaluation alongside V5.1. Or modify the existing `/api/signals/latest` to include both strategy scores. ### 2. Paper Trading Page (/paper) - Strategy Tabs at TOP Add prominent tabs at the very top of the page: ``` [全部] [V5.1 模拟盘] [V5.2 模拟盘] ``` When selecting a strategy tab: - Current positions: only show positions for that strategy - Trade history: only show trades for that strategy - Stats: only show stats for that strategy - Equity curve: only show curve for that strategy - The "全部" tab shows everything combined (current behavior) ### 3. Visual Differentiation - V5.1 trades/positions: use a subtle blue-gray badge - V5.2 trades/positions: use a green badge with ✨ icon - V5.2 positions should show extra info: FR score and Liquidation score prominently ### 4. Backend API Changes Needed #### Modify `/api/signals/latest` endpoint in main.py Return both V5.1 and V5.2 evaluations. The signal_engine already evaluates both strategies per cycle and saves the primary one. We need to also save V5.2 evaluations or compute them on-the-fly. Simplest approach: Add a field to the signal_indicators table or return strategy-specific data. Actually, the simplest approach for NOW: In the latest signal cards, just show the score that's already there (from primary strategy), and add a note showing which strategy it's from. The real differentiation happens in paper trades where the strategy column exists. #### `/api/paper/trades` already supports `?strategy=` filter (Codex added this) #### `/api/paper/stats-by-strategy` already exists ### 5. Key Files to Modify - `frontend/app/paper/page.tsx` - Add strategy tabs at top, filter everything by selected strategy - `frontend/app/signals/page.tsx` - Show V5.2 specific info (FR/Liq scores) in latest signal cards - Backend: may need minor API tweaks ### 6. Important - Don't break existing functionality - The strategy tabs should be very prominent (not small buttons buried in a section) - Use consistent styling: slate-800 bg for active tab, slate-100 for inactive - Test with `npm run build` When completely finished, run: openclaw system event --text "Done: V5.2 frontend differentiation - strategy tabs, visual badges, FR/Liq display" --mode now