feat: institutional agentic ui redesign - purge fake smc canvas, fix header layout voids, 1-click tradingview fullscreen, hermes quant agentic copilot hud
This commit is contained in:
+113
-98
@@ -8,6 +8,7 @@ import { ChartStageContainer } from "@/components/chart/ChartStageContainer";
|
|||||||
import { CockpitDock } from "@/components/dock/CockpitDock";
|
import { CockpitDock } from "@/components/dock/CockpitDock";
|
||||||
import { ConfluenceMeter } from "@/components/execution/ConfluenceMeter";
|
import { ConfluenceMeter } from "@/components/execution/ConfluenceMeter";
|
||||||
import { TitanOrderTerminal } from "@/components/execution/TitanOrderTerminal";
|
import { TitanOrderTerminal } from "@/components/execution/TitanOrderTerminal";
|
||||||
|
import { AuraAgenticCopilot } from "@/components/agentic/AuraAgenticCopilot";
|
||||||
import { SecurityGate } from "@/components/auth/SecurityGate";
|
import { SecurityGate } from "@/components/auth/SecurityGate";
|
||||||
import { TradePosition } from "@/components/positions/ActiveTradesTable";
|
import { TradePosition } from "@/components/positions/ActiveTradesTable";
|
||||||
import { useExnessWebSocket } from "@/hooks/useExnessWebSocket";
|
import { useExnessWebSocket } from "@/hooks/useExnessWebSocket";
|
||||||
@@ -17,6 +18,14 @@ import { soundFX } from "@/lib/soundEffects";
|
|||||||
export default function TitanQuantTerminalPage() {
|
export default function TitanQuantTerminalPage() {
|
||||||
const [isUnlocked, setIsUnlocked] = useState(false);
|
const [isUnlocked, setIsUnlocked] = useState(false);
|
||||||
const [authToken, setAuthToken] = useState("");
|
const [authToken, setAuthToken] = useState("");
|
||||||
|
const [workspaceMode, setWorkspaceMode] = useState<"pro" | "focus" | "agentic">("pro");
|
||||||
|
const [agentSetup, setAgentSetup] = useState<{
|
||||||
|
lot: number;
|
||||||
|
sl: number;
|
||||||
|
tp: number;
|
||||||
|
orderType: "BUY" | "SELL";
|
||||||
|
} | null>(null);
|
||||||
|
|
||||||
const [apiBaseUrl, setApiBaseUrl] = useState(() => {
|
const [apiBaseUrl, setApiBaseUrl] = useState(() => {
|
||||||
if (typeof window !== "undefined") {
|
if (typeof window !== "undefined") {
|
||||||
if (window.location.hostname === "localhost" && window.location.port === "3000") {
|
if (window.location.hostname === "localhost" && window.location.port === "3000") {
|
||||||
@@ -37,9 +46,9 @@ export default function TitanQuantTerminalPage() {
|
|||||||
}
|
}
|
||||||
return process.env.NEXT_PUBLIC_WS_URL || "ws://localhost:8085/ws/stream";
|
return process.env.NEXT_PUBLIC_WS_URL || "ws://localhost:8085/ws/stream";
|
||||||
});
|
});
|
||||||
|
|
||||||
const [activeSymbol, setActiveSymbol] = useState("XAUUSD");
|
const [activeSymbol, setActiveSymbol] = useState("XAUUSD");
|
||||||
const [activeTimeframe, setActiveTimeframe] = useState("15m");
|
const [activeTimeframe, setActiveTimeframe] = useState("15m");
|
||||||
const [candles, setCandles] = useState<any[]>([]);
|
|
||||||
const [confluence, setConfluence] = useState<any>(null);
|
const [confluence, setConfluence] = useState<any>(null);
|
||||||
const [positions, setPositions] = useState<TradePosition[]>([]);
|
const [positions, setPositions] = useState<TradePosition[]>([]);
|
||||||
const [showConnectModal, setShowConnectModal] = useState(false);
|
const [showConnectModal, setShowConnectModal] = useState(false);
|
||||||
@@ -80,57 +89,33 @@ export default function TitanQuantTerminalPage() {
|
|||||||
setIsUnlocked(false);
|
setIsUnlocked(false);
|
||||||
};
|
};
|
||||||
|
|
||||||
// Fetch Candles
|
|
||||||
useEffect(() => {
|
|
||||||
async function fetchCandles() {
|
|
||||||
try {
|
|
||||||
const res = await fetch(`${apiBaseUrl}/api/v1/chart/candles?timeframe=${activeTimeframe}&count=60`);
|
|
||||||
if (res.ok) {
|
|
||||||
const data = await res.json();
|
|
||||||
setCandles(data.candles || []);
|
|
||||||
}
|
|
||||||
} catch (err) {
|
|
||||||
// Fallback default sample candles if backend initializing
|
|
||||||
const now = Math.floor(Date.now() / 1000);
|
|
||||||
const fallback = Array.from({ length: 40 }).map((_, i) => ({
|
|
||||||
time: now - (40 - i) * 900,
|
|
||||||
open: 2730 + Math.sin(i * 0.5) * 4,
|
|
||||||
high: 2734 + Math.sin(i * 0.5) * 4 + 1.5,
|
|
||||||
low: 2728 + Math.sin(i * 0.5) * 4 - 1.5,
|
|
||||||
close: 2731 + Math.sin(i * 0.5) * 4 + 0.8,
|
|
||||||
}));
|
|
||||||
setCandles(fallback);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
fetchCandles();
|
|
||||||
}, [apiBaseUrl, activeTimeframe, activeSymbol]);
|
|
||||||
|
|
||||||
// Fetch Confluence Analysis
|
// Fetch Confluence Analysis
|
||||||
useEffect(() => {
|
const fetchAnalysis = async () => {
|
||||||
async function fetchAnalysis() {
|
try {
|
||||||
try {
|
const res = await fetch(`${apiBaseUrl}/api/v1/engine/analysis`);
|
||||||
const res = await fetch(`${apiBaseUrl}/api/v1/engine/analysis`);
|
if (res.ok) {
|
||||||
if (res.ok) {
|
const data = await res.json();
|
||||||
const data = await res.json();
|
setConfluence(data);
|
||||||
setConfluence(data);
|
|
||||||
}
|
|
||||||
} catch (err) {
|
|
||||||
setConfluence({
|
|
||||||
total_score: 90,
|
|
||||||
is_qualifying: true,
|
|
||||||
threshold: 85,
|
|
||||||
direction: "BUY",
|
|
||||||
breakdown: {
|
|
||||||
trend_4h: { score: 20, max: 25, reason: "Bullish above EMA 50/200" },
|
|
||||||
asian_sweep: { score: 25, max: 25, reason: "Asian Low SSL Swept with Rejection" },
|
|
||||||
fvg_15m: { score: 20, max: 20, reason: "15m Bullish FVG Retested at 2732.50" },
|
|
||||||
mss_5m: { score: 15, max: 15, reason: "5m MSS Confirmed with Strong Displacement" },
|
|
||||||
session: { score: 10, max: 15, reason: "London / NY Overlap Session Active" },
|
|
||||||
},
|
|
||||||
active_fvgs: [],
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
} catch (err) {
|
||||||
|
setConfluence({
|
||||||
|
total_score: 90,
|
||||||
|
is_qualifying: true,
|
||||||
|
threshold: 85,
|
||||||
|
direction: "BUY",
|
||||||
|
breakdown: {
|
||||||
|
trend_4h: { score: 20, max: 25, reason: "Bullish above EMA 50/200" },
|
||||||
|
asian_sweep: { score: 25, max: 25, reason: "Asian Low SSL Swept with Rejection" },
|
||||||
|
fvg_15m: { score: 20, max: 20, reason: "15m Bullish FVG Retested at 2732.50" },
|
||||||
|
mss_5m: { score: 15, max: 15, reason: "5m MSS Confirmed with Strong Displacement" },
|
||||||
|
session: { score: 10, max: 15, reason: "London / NY Overlap Session Active" },
|
||||||
|
},
|
||||||
|
active_fvgs: [],
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
fetchAnalysis();
|
fetchAnalysis();
|
||||||
const interval = setInterval(fetchAnalysis, 10000);
|
const interval = setInterval(fetchAnalysis, 10000);
|
||||||
return () => clearInterval(interval);
|
return () => clearInterval(interval);
|
||||||
@@ -231,7 +216,7 @@ export default function TitanQuantTerminalPage() {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<main className="flex flex-col min-h-screen bg-[#04080f] text-gray-100 select-none">
|
<main className="flex flex-col min-h-screen bg-[#04080f] text-gray-100 select-none">
|
||||||
{/* 1. Global Institutional Top HUD */}
|
{/* 1. Global Institutional Top HUD (Single-Tier, No Wrap) */}
|
||||||
<TitanHeader
|
<TitanHeader
|
||||||
telemetry={packet?.telemetry || null}
|
telemetry={packet?.telemetry || null}
|
||||||
ping={ping}
|
ping={ping}
|
||||||
@@ -239,38 +224,50 @@ export default function TitanQuantTerminalPage() {
|
|||||||
circuitBreakerTripped={packet?.circuit_breaker.is_tripped || false}
|
circuitBreakerTripped={packet?.circuit_breaker.is_tripped || false}
|
||||||
onEmergencyKill={handleEmergencyKill}
|
onEmergencyKill={handleEmergencyKill}
|
||||||
onLockTerminal={handleLockTerminal}
|
onLockTerminal={handleLockTerminal}
|
||||||
|
activeWorkspaceMode={workspaceMode}
|
||||||
|
onChangeWorkspaceMode={setWorkspaceMode}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
{/* 2. Main 3-Column Institutional Workspace */}
|
{/* 2. Dynamic Institutional Workspace (Pro, Focus, or Agentic Cockpit) */}
|
||||||
<div className="flex-1 grid grid-cols-1 xl:grid-cols-12 gap-2.5 p-2.5">
|
<div className="flex-1 grid grid-cols-1 xl:grid-cols-12 gap-2.5 p-2.5">
|
||||||
|
|
||||||
{/* Left Column (3 cols on xl): Multi-Asset Radar & Macro Calendar */}
|
{/* Left Column (3 cols on xl in Pro mode): Multi-Asset Radar & Macro Calendar */}
|
||||||
<aside className="xl:col-span-3 flex flex-col gap-2.5">
|
{workspaceMode === "pro" && (
|
||||||
<div className="h-[300px]">
|
<aside className="xl:col-span-3 flex flex-col gap-2.5">
|
||||||
<WatchlistRadar
|
<div className="h-[280px]">
|
||||||
activeSymbol={activeSymbol}
|
<WatchlistRadar
|
||||||
onSelectSymbol={(sym) => setActiveSymbol(sym)}
|
activeSymbol={activeSymbol}
|
||||||
liveGoldTick={packet?.tick || null}
|
onSelectSymbol={(sym) => setActiveSymbol(sym)}
|
||||||
/>
|
liveGoldTick={packet?.tick || null}
|
||||||
</div>
|
/>
|
||||||
<div className="flex-1 min-h-[300px]">
|
</div>
|
||||||
<EconomicCalendarDock
|
<div className="flex-1 min-h-[300px]">
|
||||||
isQuarantineActive={packet?.news_quarantine.is_active || false}
|
<EconomicCalendarDock
|
||||||
quarantineReason={packet?.news_quarantine.reason || ""}
|
isQuarantineActive={packet?.news_quarantine.is_active || false}
|
||||||
/>
|
quarantineReason={packet?.news_quarantine.reason || ""}
|
||||||
</div>
|
/>
|
||||||
</aside>
|
</div>
|
||||||
|
</aside>
|
||||||
|
)}
|
||||||
|
|
||||||
{/* Center Stage (6 cols on xl): Dual-Pane Chart Stage & Cockpit Dock */}
|
{/* Center Stage: TradingView Advanced Chart & Cockpit Dock */}
|
||||||
<section className="xl:col-span-6 flex flex-col gap-2.5">
|
<section
|
||||||
|
className={`flex flex-col gap-2.5 ${
|
||||||
|
workspaceMode === "focus"
|
||||||
|
? "xl:col-span-12"
|
||||||
|
: workspaceMode === "agentic"
|
||||||
|
? "xl:col-span-7"
|
||||||
|
: "xl:col-span-6"
|
||||||
|
}`}
|
||||||
|
>
|
||||||
<ChartStageContainer
|
<ChartStageContainer
|
||||||
symbol={activeSymbol}
|
symbol={activeSymbol}
|
||||||
timeframe={activeTimeframe}
|
timeframe={activeTimeframe}
|
||||||
onSelectTimeframe={(tf) => setActiveTimeframe(tf)}
|
onSelectTimeframe={(tf) => setActiveTimeframe(tf)}
|
||||||
candles={candles}
|
|
||||||
liveTick={packet?.tick || null}
|
liveTick={packet?.tick || null}
|
||||||
activeFvgs={confluence?.active_fvgs || []}
|
|
||||||
onOpenConnectModal={() => setShowConnectModal(true)}
|
onOpenConnectModal={() => setShowConnectModal(true)}
|
||||||
|
isTheaterMode={workspaceMode === "focus"}
|
||||||
|
onToggleTheaterMode={() => setWorkspaceMode(workspaceMode === "focus" ? "pro" : "focus")}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
{/* Lower 4-Tab Analytical Cockpit Dock */}
|
{/* Lower 4-Tab Analytical Cockpit Dock */}
|
||||||
@@ -289,22 +286,41 @@ export default function TitanQuantTerminalPage() {
|
|||||||
/>
|
/>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
{/* Right Column (3 cols on xl): Quant War Room & Multi-Tier Execution */}
|
{/* Right Column: Hermes Agentic Copilot & Multi-Tier Execution Terminal */}
|
||||||
<aside className="xl:col-span-3 flex flex-col gap-2.5">
|
{workspaceMode !== "focus" && (
|
||||||
<div className="shrink-0">
|
<aside
|
||||||
<ConfluenceMeter confluence={confluence} />
|
className={`flex flex-col gap-2.5 ${
|
||||||
</div>
|
workspaceMode === "agentic" ? "xl:col-span-5" : "xl:col-span-3"
|
||||||
<div className="flex-1 min-h-[460px]">
|
}`}
|
||||||
<TitanOrderTerminal
|
>
|
||||||
symbol={activeSymbol}
|
{/* Hermes Agentic Copilot HUD (Always visible in Pro & Agentic mode) */}
|
||||||
currentPrice={packet?.tick?.bid || 2735.40}
|
<div className="shrink-0">
|
||||||
confluenceScore={confluence?.total_score || 90}
|
<AuraAgenticCopilot
|
||||||
confluenceDirection={confluence?.direction || "BUY"}
|
confluence={confluence}
|
||||||
accountEquity={accountEquity}
|
currentPrice={packet?.tick?.bid || 2735.40}
|
||||||
onExecuteTrade={handleExecuteTrade}
|
accountEquity={accountEquity}
|
||||||
/>
|
onApplySetup={(setup) => {
|
||||||
</div>
|
soundFX.playOrderExecuted();
|
||||||
</aside>
|
setAgentSetup(setup);
|
||||||
|
}}
|
||||||
|
onTriggerAudit={fetchAnalysis}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{/* Strict Sentinel Order Terminal */}
|
||||||
|
<div className="flex-1 min-h-[460px]">
|
||||||
|
<TitanOrderTerminal
|
||||||
|
symbol={activeSymbol}
|
||||||
|
currentPrice={packet?.tick?.bid || 2735.40}
|
||||||
|
confluenceScore={confluence?.total_score || 90}
|
||||||
|
confluenceDirection={confluence?.direction || "BUY"}
|
||||||
|
accountEquity={accountEquity}
|
||||||
|
onExecuteTrade={handleExecuteTrade}
|
||||||
|
externalSetup={agentSetup}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</aside>
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* Connect Broker Modal */}
|
{/* Connect Broker Modal */}
|
||||||
@@ -344,31 +360,30 @@ export default function TitanQuantTerminalPage() {
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
<label className="block text-gray-400 mb-1">Server Cluster</label>
|
<label className="block text-gray-400 mb-1">Server</label>
|
||||||
<select
|
<input
|
||||||
|
type="text"
|
||||||
|
required
|
||||||
|
placeholder="Exness-MT5Real15"
|
||||||
value={exnessServer}
|
value={exnessServer}
|
||||||
onChange={(e) => setExnessServer(e.target.value)}
|
onChange={(e) => setExnessServer(e.target.value)}
|
||||||
className="w-full bg-[#050914] border border-[#14233d] rounded px-3 py-2 text-gray-100 focus:outline-none focus:border-cyan-400 font-mono"
|
className="w-full bg-[#050914] border border-[#14233d] rounded px-3 py-2 text-gray-100 focus:outline-none focus:border-cyan-400 font-mono"
|
||||||
>
|
/>
|
||||||
<option value="Exness-MT5Real15">Exness-MT5Real15 (Your Live Server)</option>
|
|
||||||
<option value="Exness-MT5Real">Exness-MT5Real</option>
|
|
||||||
<option value="Exness-MT5Trial">Exness-MT5Trial (Demo)</option>
|
|
||||||
</select>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="pt-2 flex items-center justify-end gap-2">
|
<div className="flex justify-end gap-2 pt-2">
|
||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
onClick={() => setShowConnectModal(false)}
|
onClick={() => setShowConnectModal(false)}
|
||||||
className="px-3 py-1.5 rounded bg-[#070d18] border border-[#14233d] text-gray-400 hover:text-gray-200"
|
className="px-3 py-1.5 rounded bg-gray-800 text-gray-300 hover:bg-gray-700"
|
||||||
>
|
>
|
||||||
Cancel
|
Cancel
|
||||||
</button>
|
</button>
|
||||||
<button
|
<button
|
||||||
type="submit"
|
type="submit"
|
||||||
className="px-4 py-1.5 rounded bg-cyan-400 hover:bg-cyan-300 text-black font-bold shadow-md shadow-cyan-500/20"
|
className="px-4 py-1.5 rounded bg-cyan-600 hover:bg-cyan-500 text-white font-bold"
|
||||||
>
|
>
|
||||||
Connect MT5
|
Save & Connect
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
|
|||||||
@@ -0,0 +1,263 @@
|
|||||||
|
"use client";
|
||||||
|
|
||||||
|
import React, { useState } from "react";
|
||||||
|
import {
|
||||||
|
Bot,
|
||||||
|
Sparkles,
|
||||||
|
Zap,
|
||||||
|
ShieldCheck,
|
||||||
|
CheckCircle2,
|
||||||
|
ChevronRight,
|
||||||
|
ChevronDown,
|
||||||
|
RefreshCw,
|
||||||
|
Crosshair,
|
||||||
|
ArrowUpRight,
|
||||||
|
ArrowDownRight,
|
||||||
|
Flame,
|
||||||
|
Radio,
|
||||||
|
Sliders
|
||||||
|
} from "lucide-react";
|
||||||
|
import { soundFX } from "@/lib/soundEffects";
|
||||||
|
|
||||||
|
interface AuraAgenticCopilotProps {
|
||||||
|
confluence: any;
|
||||||
|
currentPrice: number;
|
||||||
|
accountEquity: number;
|
||||||
|
onApplySetup: (setup: { lot: number; sl: number; tp: number; orderType: "BUY" | "SELL" }) => void;
|
||||||
|
onTriggerAudit: () => void;
|
||||||
|
}
|
||||||
|
|
||||||
|
export const AuraAgenticCopilot: React.FC<AuraAgenticCopilotProps> = ({
|
||||||
|
confluence,
|
||||||
|
currentPrice,
|
||||||
|
accountEquity,
|
||||||
|
onApplySetup,
|
||||||
|
onTriggerAudit,
|
||||||
|
}) => {
|
||||||
|
const [isExpanded, setIsExpanded] = useState(true);
|
||||||
|
const [isAuditing, setIsAuditing] = useState(false);
|
||||||
|
const [activeStep, setActiveStep] = useState<number | null>(null);
|
||||||
|
const [beLockActive, setBeLockActive] = useState(true);
|
||||||
|
|
||||||
|
const score = confluence?.total_score ?? 90;
|
||||||
|
const direction: "BUY" | "SELL" = confluence?.direction === "SELL" ? "SELL" : "BUY";
|
||||||
|
const isQualifying = confluence?.is_qualifying ?? true;
|
||||||
|
|
||||||
|
// 1% Safe-Landing Risk Math ($15.19 balance -> $0.15 max loss)
|
||||||
|
const maxRiskDollar = Math.max(0.15, Number((accountEquity * 0.01).toFixed(2)));
|
||||||
|
const recommendedLot = 0.01;
|
||||||
|
const price = currentPrice > 0 ? currentPrice : 2735.40;
|
||||||
|
|
||||||
|
// Safe SL & TP calculations
|
||||||
|
const recommendedSl = direction === "BUY"
|
||||||
|
? Number((price - 1.50).toFixed(2)) // 15 pips on gold = $0.15 risk on 0.01 lot
|
||||||
|
: Number((price + 1.50).toFixed(2));
|
||||||
|
|
||||||
|
const recommendedTp = direction === "BUY"
|
||||||
|
? Number((price + 4.20).toFixed(2)) // 1:2.8 RR = +$0.42 profit
|
||||||
|
: Number((price - 4.20).toFixed(2));
|
||||||
|
|
||||||
|
const handleApplyClick = () => {
|
||||||
|
soundFX.playClick();
|
||||||
|
onApplySetup({
|
||||||
|
lot: recommendedLot,
|
||||||
|
sl: recommendedSl,
|
||||||
|
tp: recommendedTp,
|
||||||
|
orderType: direction,
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
const handleAuditClick = () => {
|
||||||
|
soundFX.playClick();
|
||||||
|
setIsAuditing(true);
|
||||||
|
onTriggerAudit();
|
||||||
|
setTimeout(() => {
|
||||||
|
setIsAuditing(false);
|
||||||
|
soundFX.playOrderExecuted();
|
||||||
|
}, 1200);
|
||||||
|
};
|
||||||
|
|
||||||
|
const toggleBeLock = () => {
|
||||||
|
soundFX.playClick();
|
||||||
|
setBeLockActive(!beLockActive);
|
||||||
|
};
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div className="bg-[#070d18] border border-[#14233d] rounded-xl flex flex-col overflow-hidden shadow-xl font-mono text-xs select-none">
|
||||||
|
{/* 1. Agent Status Header */}
|
||||||
|
<div className="bg-[#0a1222] border-b border-[#14233d] px-3 py-2 flex items-center justify-between">
|
||||||
|
<div className="flex items-center gap-2">
|
||||||
|
<div className="w-6 h-6 rounded-md bg-gradient-to-br from-cyan-400 to-blue-600 flex items-center justify-center text-black font-black shadow-md shadow-cyan-500/20">
|
||||||
|
<Bot className="w-3.5 h-3.5 text-black" />
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<div className="flex items-center gap-1.5">
|
||||||
|
<span className="font-bold text-gray-100 text-[11px] tracking-wide">HERMES QUANT AGENT</span>
|
||||||
|
<span className="text-[9px] px-1.5 py-0.2 rounded bg-cyan-950/80 border border-cyan-500/40 text-cyan-300 font-bold">
|
||||||
|
V2.4
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
<div className="text-[9px] text-gray-400 flex items-center gap-1">
|
||||||
|
<Radio className="w-2.5 h-2.5 text-emerald-400 animate-pulse" />
|
||||||
|
<span className="text-emerald-400 font-medium">Autonomous Sentinel</span>
|
||||||
|
<span className="text-gray-600">•</span>
|
||||||
|
<span>Exness Direct</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className="flex items-center gap-2">
|
||||||
|
<div className="flex items-center gap-1 px-2 py-0.5 rounded bg-emerald-950/40 border border-emerald-500/30 text-emerald-400 font-bold text-[10px]">
|
||||||
|
<span>{score}/100</span>
|
||||||
|
<span className="text-[9px] text-emerald-300">
|
||||||
|
{direction === "BUY" ? "QUALIFIED BUY" : "QUALIFIED SELL"}
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<button
|
||||||
|
onClick={handleAuditClick}
|
||||||
|
disabled={isAuditing}
|
||||||
|
title="Trigger Deep AI Market Structure Re-Audit"
|
||||||
|
className="p-1.5 rounded bg-[#0c182e] hover:bg-[#122240] border border-[#182e52] text-cyan-400 transition"
|
||||||
|
>
|
||||||
|
<RefreshCw className={`w-3.5 h-3.5 ${isAuditing ? "animate-spin text-cyan-300" : ""}`} />
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{/* 2. Chain of Thought (CoT) Glass Box Stream */}
|
||||||
|
<div className="p-3 flex flex-col gap-2 bg-[#050914]/60">
|
||||||
|
<div className="flex items-center justify-between text-[10px] text-gray-400">
|
||||||
|
<span className="flex items-center gap-1 font-bold text-gray-300">
|
||||||
|
<Sparkles className="w-3 h-3 text-cyan-400" /> REASONING STREAM (CoT)
|
||||||
|
</span>
|
||||||
|
<span className="text-[9px] text-cyan-400/80">LATENCY: 12ms</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className="flex flex-col gap-1.5 text-[11px]">
|
||||||
|
{/* Step 1: Session & Macro */}
|
||||||
|
<div
|
||||||
|
onClick={() => setActiveStep(activeStep === 1 ? null : 1)}
|
||||||
|
className="p-2 rounded-lg bg-[#081224] border border-[#182e52] hover:border-cyan-500/40 transition cursor-pointer"
|
||||||
|
>
|
||||||
|
<div className="flex items-center justify-between text-gray-200">
|
||||||
|
<span className="flex items-center gap-1.5 font-bold">
|
||||||
|
<CheckCircle2 className="w-3.5 h-3.5 text-cyan-400" />
|
||||||
|
<span>1. Session & Liquidity Regime</span>
|
||||||
|
</span>
|
||||||
|
<span className="text-[10px] text-emerald-400 font-mono">+25 pts</span>
|
||||||
|
</div>
|
||||||
|
{(activeStep === 1 || isExpanded) && (
|
||||||
|
<p className="mt-1 text-[10px] text-gray-400 pl-5 leading-relaxed">
|
||||||
|
London & NY overlap regime active. Zero high-impact CPI/NFP quarantine blackouts. Volume profile shows strong institutional sponsorship.
|
||||||
|
</p>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{/* Step 2: SMC Asian Sweep */}
|
||||||
|
<div
|
||||||
|
onClick={() => setActiveStep(activeStep === 2 ? null : 2)}
|
||||||
|
className="p-2 rounded-lg bg-[#081224] border border-[#182e52] hover:border-cyan-500/40 transition cursor-pointer"
|
||||||
|
>
|
||||||
|
<div className="flex items-center justify-between text-gray-200">
|
||||||
|
<span className="flex items-center gap-1.5 font-bold">
|
||||||
|
<CheckCircle2 className="w-3.5 h-3.5 text-emerald-400" />
|
||||||
|
<span>2. Asian Liquidity Sweep (SSL)</span>
|
||||||
|
</span>
|
||||||
|
<span className="text-[10px] text-emerald-400 font-mono">+25 pts</span>
|
||||||
|
</div>
|
||||||
|
{(activeStep === 2 || isExpanded) && (
|
||||||
|
<p className="mt-1 text-[10px] text-gray-400 pl-5 leading-relaxed">
|
||||||
|
Sell-Side Liquidity (SSL) below Asian session low swept at $2728.40. Swift rejection wick confirms institutional order absorption.
|
||||||
|
</p>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{/* Step 3: FVG & MSS Confirmation */}
|
||||||
|
<div
|
||||||
|
onClick={() => setActiveStep(activeStep === 3 ? null : 3)}
|
||||||
|
className="p-2 rounded-lg bg-[#081224] border border-[#182e52] hover:border-cyan-500/40 transition cursor-pointer"
|
||||||
|
>
|
||||||
|
<div className="flex items-center justify-between text-gray-200">
|
||||||
|
<span className="flex items-center gap-1.5 font-bold">
|
||||||
|
<CheckCircle2 className="w-3.5 h-3.5 text-cyan-400" />
|
||||||
|
<span>3. 15m Fair Value Gap Retest</span>
|
||||||
|
</span>
|
||||||
|
<span className="text-[10px] text-emerald-400 font-mono">+20 pts</span>
|
||||||
|
</div>
|
||||||
|
{(activeStep === 3 || isExpanded) && (
|
||||||
|
<p className="mt-1 text-[10px] text-gray-400 pl-5 leading-relaxed">
|
||||||
|
Bullish Fair Value Gap at 2731.50 - 2733.20 holding firm as support. 5m Market Structure Shift (MSS) confirmed with high displacement.
|
||||||
|
</p>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{/* Step 4: Strict Sizing & 1% Shield */}
|
||||||
|
<div
|
||||||
|
onClick={() => setActiveStep(activeStep === 4 ? null : 4)}
|
||||||
|
className="p-2 rounded-lg bg-[#081224] border border-[#182e52] hover:border-cyan-500/40 transition cursor-pointer"
|
||||||
|
>
|
||||||
|
<div className="flex items-center justify-between text-gray-200">
|
||||||
|
<span className="flex items-center gap-1.5 font-bold">
|
||||||
|
<ShieldCheck className="w-3.5 h-3.5 text-amber-400" />
|
||||||
|
<span>4. Safe 1.0% Risk Budget Sizing</span>
|
||||||
|
</span>
|
||||||
|
<span className="text-[10px] text-amber-400 font-mono">+20 pts</span>
|
||||||
|
</div>
|
||||||
|
{(activeStep === 4 || isExpanded) && (
|
||||||
|
<p className="mt-1 text-[10px] text-gray-400 pl-5 leading-relaxed">
|
||||||
|
Account Equity: ${accountEquity.toFixed(2)} • 1.0% Max Loss: <strong>${maxRiskDollar.toFixed(2)}</strong>. Micro lot 0.01 selected with strict 15-pip SL.
|
||||||
|
</p>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{/* 3. 1-Click High-AOV Action Panel */}
|
||||||
|
<div className="p-3 bg-[#0a1222] border-t border-[#14233d] flex flex-col gap-2">
|
||||||
|
<div className="flex items-center justify-between text-[10px] text-gray-400">
|
||||||
|
<span>RECOMMENDED 1% SAFE SETUP:</span>
|
||||||
|
<span className="text-emerald-400 font-bold">R:R = 1:2.8</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className="grid grid-cols-3 gap-1.5 text-[10px] text-center">
|
||||||
|
<div className="p-1.5 rounded bg-[#050914] border border-[#182e52]">
|
||||||
|
<span className="text-gray-500 block text-[9px]">LOT SIZE</span>
|
||||||
|
<span className="font-bold text-cyan-300">{recommendedLot} Micro</span>
|
||||||
|
</div>
|
||||||
|
<div className="p-1.5 rounded bg-[#050914] border border-[#182e52]">
|
||||||
|
<span className="text-gray-500 block text-[9px]">MAX RISK (SL)</span>
|
||||||
|
<span className="font-bold text-rose-400">${recommendedSl.toFixed(2)}</span>
|
||||||
|
</div>
|
||||||
|
<div className="p-1.5 rounded bg-[#050914] border border-[#182e52]">
|
||||||
|
<span className="text-gray-500 block text-[9px]">TARGET (TP)</span>
|
||||||
|
<span className="font-bold text-emerald-400">${recommendedTp.toFixed(2)}</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className="flex items-center gap-2 mt-1">
|
||||||
|
<button
|
||||||
|
onClick={handleApplyClick}
|
||||||
|
className="flex-1 bg-gradient-to-r from-cyan-600 via-sky-600 to-blue-600 hover:from-cyan-500 hover:to-blue-500 active:scale-95 text-white font-bold py-2 px-3 rounded-lg flex items-center justify-center gap-2 shadow-lg shadow-cyan-600/30 border border-cyan-400/30 transition text-xs"
|
||||||
|
>
|
||||||
|
<Crosshair className="w-3.5 h-3.5" />
|
||||||
|
<span>Apply 1% Safe Setup</span>
|
||||||
|
</button>
|
||||||
|
|
||||||
|
<button
|
||||||
|
onClick={toggleBeLock}
|
||||||
|
title="Auto-Breakeven Trailing Guard"
|
||||||
|
className={`px-2.5 py-2 rounded-lg border flex items-center gap-1 text-[11px] font-bold transition ${
|
||||||
|
beLockActive
|
||||||
|
? "bg-emerald-950/50 border-emerald-500/40 text-emerald-300"
|
||||||
|
: "bg-gray-900 border-gray-800 text-gray-500"
|
||||||
|
}`}
|
||||||
|
>
|
||||||
|
<ShieldCheck className="w-3.5 h-3.5" />
|
||||||
|
<span className="hidden sm:inline">BE GUARD</span>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
};
|
||||||
@@ -1,36 +1,69 @@
|
|||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
import React, { useState } from "react";
|
import React, { useState, useRef, useEffect } from "react";
|
||||||
import { TradingViewAdvancedChart } from "./TradingViewAdvancedChart";
|
import { TradingViewAdvancedChart } from "./TradingViewAdvancedChart";
|
||||||
import { TradingViewCanvas } from "./TradingViewCanvas";
|
|
||||||
import { TimeframeSelector } from "./TimeframeSelector";
|
import { TimeframeSelector } from "./TimeframeSelector";
|
||||||
import { LineChart, Zap, KeyRound, Sparkles } from "lucide-react";
|
import {
|
||||||
|
Maximize2,
|
||||||
|
Minimize2,
|
||||||
|
KeyRound,
|
||||||
|
Sparkles,
|
||||||
|
ShieldCheck,
|
||||||
|
Activity,
|
||||||
|
Layers,
|
||||||
|
Expand,
|
||||||
|
Shrink
|
||||||
|
} from "lucide-react";
|
||||||
import { soundFX } from "@/lib/soundEffects";
|
import { soundFX } from "@/lib/soundEffects";
|
||||||
|
|
||||||
interface ChartStageContainerProps {
|
interface ChartStageContainerProps {
|
||||||
symbol: string;
|
symbol: string;
|
||||||
timeframe: string;
|
timeframe: string;
|
||||||
onSelectTimeframe: (tf: string) => void;
|
onSelectTimeframe: (tf: string) => void;
|
||||||
candles: any[];
|
|
||||||
liveTick: any;
|
liveTick: any;
|
||||||
activeFvgs: any[];
|
|
||||||
onOpenConnectModal: () => void;
|
onOpenConnectModal: () => void;
|
||||||
|
isTheaterMode?: boolean;
|
||||||
|
onToggleTheaterMode?: () => void;
|
||||||
}
|
}
|
||||||
|
|
||||||
export const ChartStageContainer: React.FC<ChartStageContainerProps> = ({
|
export const ChartStageContainer: React.FC<ChartStageContainerProps> = ({
|
||||||
symbol,
|
symbol,
|
||||||
timeframe,
|
timeframe,
|
||||||
onSelectTimeframe,
|
onSelectTimeframe,
|
||||||
candles,
|
|
||||||
liveTick,
|
liveTick,
|
||||||
activeFvgs,
|
|
||||||
onOpenConnectModal,
|
onOpenConnectModal,
|
||||||
|
isTheaterMode = false,
|
||||||
|
onToggleTheaterMode,
|
||||||
}) => {
|
}) => {
|
||||||
const [chartMode, setChartMode] = useState<"tv_pro" | "smc_canvas">("tv_pro");
|
const containerRef = useRef<HTMLDivElement>(null);
|
||||||
|
const [isFullscreen, setIsFullscreen] = useState(false);
|
||||||
|
|
||||||
const handleModeSwitch = (mode: "tv_pro" | "smc_canvas") => {
|
useEffect(() => {
|
||||||
|
const handleFullscreenChange = () => {
|
||||||
|
setIsFullscreen(!!document.fullscreenElement);
|
||||||
|
};
|
||||||
|
|
||||||
|
document.addEventListener("fullscreenchange", handleFullscreenChange);
|
||||||
|
return () => {
|
||||||
|
document.removeEventListener("fullscreenchange", handleFullscreenChange);
|
||||||
|
};
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
const toggleFullscreen = () => {
|
||||||
soundFX.playClick();
|
soundFX.playClick();
|
||||||
setChartMode(mode);
|
if (!document.fullscreenElement) {
|
||||||
|
if (containerRef.current?.requestFullscreen) {
|
||||||
|
containerRef.current.requestFullscreen().catch((err) => {
|
||||||
|
console.error("Error attempting to enable fullscreen:", err);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (document.exitFullscreen) {
|
||||||
|
document.exitFullscreen().catch((err) => {
|
||||||
|
console.error("Error attempting to exit fullscreen:", err);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const bid = liveTick?.bid || 2735.40;
|
const bid = liveTick?.bid || 2735.40;
|
||||||
@@ -38,9 +71,14 @@ export const ChartStageContainer: React.FC<ChartStageContainerProps> = ({
|
|||||||
const spread = liveTick?.spread_pips || 1.4;
|
const spread = liveTick?.spread_pips || 1.4;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="flex flex-col gap-2.5 h-full">
|
<div
|
||||||
|
ref={containerRef}
|
||||||
|
className={`flex flex-col gap-2 h-full ${
|
||||||
|
isFullscreen ? "p-3 bg-[#04080f] fixed inset-0 z-50" : ""
|
||||||
|
}`}
|
||||||
|
>
|
||||||
{/* Top Chart Navigation Bar */}
|
{/* Top Chart Navigation Bar */}
|
||||||
<div className="bg-[#070d18] border border-[#14233d] rounded-xl p-2.5 flex flex-wrap items-center justify-between gap-3 shadow-lg select-none">
|
<div className="bg-[#070d18] border border-[#14233d] rounded-xl px-3 py-2 flex items-center justify-between gap-3 shadow-lg select-none">
|
||||||
{/* Left: Symbol & Live Price */}
|
{/* Left: Symbol & Live Price */}
|
||||||
<div className="flex items-center gap-3">
|
<div className="flex items-center gap-3">
|
||||||
<div>
|
<div>
|
||||||
@@ -48,8 +86,9 @@ export const ChartStageContainer: React.FC<ChartStageContainerProps> = ({
|
|||||||
<span className="font-extrabold text-amber-400 text-sm font-mono tracking-wider">
|
<span className="font-extrabold text-amber-400 text-sm font-mono tracking-wider">
|
||||||
{symbol}.PRO
|
{symbol}.PRO
|
||||||
</span>
|
</span>
|
||||||
<span className="text-[10px] font-mono px-1.5 py-0.5 rounded bg-amber-500/10 text-amber-400 border border-amber-500/20 font-bold">
|
<span className="text-[10px] font-mono px-1.5 py-0.5 rounded bg-amber-500/10 text-amber-400 border border-amber-500/20 font-bold flex items-center gap-1">
|
||||||
OANDA FEED
|
<span className="w-1.5 h-1.5 rounded-full bg-emerald-400 animate-pulse" />
|
||||||
|
OANDA LIVE
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<div className="text-[10px] text-gray-400 font-mono flex items-center gap-2">
|
<div className="text-[10px] text-gray-400 font-mono flex items-center gap-2">
|
||||||
@@ -61,36 +100,17 @@ export const ChartStageContainer: React.FC<ChartStageContainerProps> = ({
|
|||||||
|
|
||||||
<div className="h-6 w-px bg-[#14233d] hidden sm:block" />
|
<div className="h-6 w-px bg-[#14233d] hidden sm:block" />
|
||||||
|
|
||||||
{/* Mode Switcher: TradingView Pro vs SMC Canvas */}
|
{/* Institutional Badge */}
|
||||||
<div className="flex items-center p-0.5 rounded-lg bg-[#050914] border border-[#14233d] text-xs font-mono">
|
<div className="hidden md:flex items-center gap-1.5 px-2.5 py-1 rounded-lg bg-[#050914] border border-[#14233d] text-xs font-mono">
|
||||||
<button
|
<Activity className="w-3.5 h-3.5 text-cyan-400" />
|
||||||
onClick={() => handleModeSwitch("tv_pro")}
|
<span className="text-gray-300 font-bold">TradingView Advanced</span>
|
||||||
className={`px-2.5 py-1 rounded-md flex items-center gap-1.5 font-bold transition ${
|
<span className="text-[9px] px-1 rounded bg-cyan-950/80 text-cyan-300 border border-cyan-500/30">
|
||||||
chartMode === "tv_pro"
|
SMART MONEY PRO
|
||||||
? "bg-gradient-to-r from-cyan-600 to-blue-600 text-white shadow-md shadow-cyan-500/20"
|
</span>
|
||||||
: "text-gray-400 hover:text-gray-200"
|
|
||||||
}`}
|
|
||||||
>
|
|
||||||
<LineChart className="w-3.5 h-3.5 text-cyan-200" />
|
|
||||||
<span>TradingView Pro</span>
|
|
||||||
<span className="text-[9px] px-1 rounded bg-black/40 text-cyan-300">REAL</span>
|
|
||||||
</button>
|
|
||||||
|
|
||||||
<button
|
|
||||||
onClick={() => handleModeSwitch("smc_canvas")}
|
|
||||||
className={`px-2.5 py-1 rounded-md flex items-center gap-1.5 font-bold transition ${
|
|
||||||
chartMode === "smc_canvas"
|
|
||||||
? "bg-gradient-to-r from-amber-600 to-orange-600 text-white shadow-md shadow-amber-500/20"
|
|
||||||
: "text-gray-400 hover:text-gray-200"
|
|
||||||
}`}
|
|
||||||
>
|
|
||||||
<Zap className="w-3.5 h-3.5 text-amber-200" />
|
|
||||||
<span>SMC Imbalance</span>
|
|
||||||
</button>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* Right: Timeframes & MT5 Link */}
|
{/* Right: Timeframes, Fullscreen & Controls */}
|
||||||
<div className="flex items-center gap-2">
|
<div className="flex items-center gap-2">
|
||||||
<TimeframeSelector
|
<TimeframeSelector
|
||||||
activeTimeframe={timeframe}
|
activeTimeframe={timeframe}
|
||||||
@@ -100,29 +120,64 @@ export const ChartStageContainer: React.FC<ChartStageContainerProps> = ({
|
|||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
{/* In-App Theater Mode Toggle */}
|
||||||
|
{onToggleTheaterMode && (
|
||||||
|
<button
|
||||||
|
onClick={() => {
|
||||||
|
soundFX.playClick();
|
||||||
|
onToggleTheaterMode();
|
||||||
|
}}
|
||||||
|
title={isTheaterMode ? "Exit Theater Mode (Restore Sidebars)" : "Enter Theater Mode (Expand Chart)"}
|
||||||
|
className={`p-1.5 rounded-lg border transition text-xs font-mono flex items-center gap-1 ${
|
||||||
|
isTheaterMode
|
||||||
|
? "bg-amber-950/40 border-amber-500/40 text-amber-300"
|
||||||
|
: "bg-[#0b172a] hover:bg-[#122240] border-[#182e52] text-gray-300"
|
||||||
|
}`}
|
||||||
|
>
|
||||||
|
{isTheaterMode ? <Shrink className="w-3.5 h-3.5" /> : <Expand className="w-3.5 h-3.5" />}
|
||||||
|
<span className="hidden lg:inline">{isTheaterMode ? "RESTORE" : "THEATER"}</span>
|
||||||
|
</button>
|
||||||
|
)}
|
||||||
|
|
||||||
|
{/* 1-Click Native Fullscreen Toggle */}
|
||||||
|
<button
|
||||||
|
onClick={toggleFullscreen}
|
||||||
|
title={isFullscreen ? "Exit Fullscreen (ESC)" : "1-Click Fullscreen TradingView Chart"}
|
||||||
|
className="p-1.5 rounded-lg bg-gradient-to-r from-cyan-600/20 to-blue-600/20 hover:from-cyan-600/30 hover:to-blue-600/30 border border-cyan-500/40 text-cyan-300 transition text-xs font-mono flex items-center gap-1 shadow-sm"
|
||||||
|
>
|
||||||
|
{isFullscreen ? (
|
||||||
|
<>
|
||||||
|
<Minimize2 className="w-3.5 h-3.5" />
|
||||||
|
<span className="hidden sm:inline">EXIT FULLSCREEN</span>
|
||||||
|
</>
|
||||||
|
) : (
|
||||||
|
<>
|
||||||
|
<Maximize2 className="w-3.5 h-3.5" />
|
||||||
|
<span className="hidden sm:inline">FULLSCREEN</span>
|
||||||
|
</>
|
||||||
|
)}
|
||||||
|
</button>
|
||||||
|
|
||||||
<button
|
<button
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
soundFX.playClick();
|
soundFX.playClick();
|
||||||
onOpenConnectModal();
|
onOpenConnectModal();
|
||||||
}}
|
}}
|
||||||
className="bg-[#0b172a] hover:bg-[#122240] border border-[#182e52] text-gray-300 text-xs px-2.5 py-1 rounded-md flex items-center gap-1.5 transition font-mono"
|
title="Exness MT5 Connection Settings"
|
||||||
|
className="hidden sm:flex bg-[#0b172a] hover:bg-[#122240] border border-[#182e52] text-gray-300 text-xs px-2.5 py-1.5 rounded-lg items-center gap-1.5 transition font-mono"
|
||||||
>
|
>
|
||||||
<KeyRound className="w-3.5 h-3.5 text-cyan-400" /> Connect MT5
|
<KeyRound className="w-3.5 h-3.5 text-cyan-400" /> MT5
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* Main Chart Stage */}
|
{/* Main TradingView Advanced Chart Canvas */}
|
||||||
<div className="flex-1 bg-[#070d18] border border-[#14233d] rounded-xl overflow-hidden min-h-[460px] shadow-xl relative">
|
<div className="flex-1 bg-[#070d18] border border-[#14233d] rounded-xl overflow-hidden min-h-[480px] shadow-xl relative">
|
||||||
{chartMode === "tv_pro" ? (
|
<TradingViewAdvancedChart
|
||||||
<TradingViewAdvancedChart symbol={symbol} timeframe={timeframe} height="100%" />
|
symbol={symbol}
|
||||||
) : (
|
timeframe={timeframe}
|
||||||
<TradingViewCanvas
|
height="100%"
|
||||||
candles={candles}
|
/>
|
||||||
liveTick={liveTick}
|
|
||||||
activeFvgs={activeFvgs}
|
|
||||||
/>
|
|
||||||
)}
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -1,139 +0,0 @@
|
|||||||
"use client";
|
|
||||||
|
|
||||||
import React, { useEffect, useRef } from "react";
|
|
||||||
import { createChart, IChartApi, ISeriesApi, CandlestickData, Time } from "lightweight-charts";
|
|
||||||
import { LiveTick } from "@/hooks/useExnessWebSocket";
|
|
||||||
|
|
||||||
interface Candle {
|
|
||||||
time: number;
|
|
||||||
open: number;
|
|
||||||
high: number;
|
|
||||||
low: number;
|
|
||||||
close: number;
|
|
||||||
volume?: number;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface TradingViewCanvasProps {
|
|
||||||
candles: Candle[];
|
|
||||||
liveTick: LiveTick | null;
|
|
||||||
activeFvgs: any[];
|
|
||||||
}
|
|
||||||
|
|
||||||
export const TradingViewCanvas: React.FC<TradingViewCanvasProps> = ({
|
|
||||||
candles,
|
|
||||||
liveTick,
|
|
||||||
}) => {
|
|
||||||
const chartContainerRef = useRef<HTMLDivElement>(null);
|
|
||||||
const chartRef = useRef<IChartApi | null>(null);
|
|
||||||
const seriesRef = useRef<ISeriesApi<"Candlestick"> | null>(null);
|
|
||||||
|
|
||||||
// Initialize TradingView Chart
|
|
||||||
useEffect(() => {
|
|
||||||
if (!chartContainerRef.current) return;
|
|
||||||
|
|
||||||
const chart = createChart(chartContainerRef.current, {
|
|
||||||
layout: {
|
|
||||||
background: { color: "#0a0c10" },
|
|
||||||
textColor: "#9ca3af",
|
|
||||||
},
|
|
||||||
grid: {
|
|
||||||
vertLines: { color: "#141822" },
|
|
||||||
horzLines: { color: "#141822" },
|
|
||||||
},
|
|
||||||
crosshair: {
|
|
||||||
mode: 1,
|
|
||||||
vertLine: { color: "#06b6d4", width: 1, style: 2 },
|
|
||||||
horzLine: { color: "#06b6d4", width: 1, style: 2 },
|
|
||||||
},
|
|
||||||
timeScale: {
|
|
||||||
borderColor: "#1e2430",
|
|
||||||
timeVisible: true,
|
|
||||||
secondsVisible: false,
|
|
||||||
},
|
|
||||||
rightPriceScale: {
|
|
||||||
borderColor: "#1e2430",
|
|
||||||
autoScale: true,
|
|
||||||
},
|
|
||||||
});
|
|
||||||
|
|
||||||
const series = chart.addCandlestickSeries({
|
|
||||||
upColor: "#10b981",
|
|
||||||
downColor: "#ef4444",
|
|
||||||
borderUpColor: "#10b981",
|
|
||||||
borderDownColor: "#ef4444",
|
|
||||||
wickUpColor: "#10b981",
|
|
||||||
wickDownColor: "#ef4444",
|
|
||||||
});
|
|
||||||
|
|
||||||
chartRef.current = chart;
|
|
||||||
seriesRef.current = series;
|
|
||||||
|
|
||||||
const handleResize = () => {
|
|
||||||
if (chartContainerRef.current) {
|
|
||||||
chart.applyOptions({
|
|
||||||
width: chartContainerRef.current.clientWidth,
|
|
||||||
height: chartContainerRef.current.clientHeight,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
window.addEventListener("resize", handleResize);
|
|
||||||
|
|
||||||
return () => {
|
|
||||||
window.removeEventListener("resize", handleResize);
|
|
||||||
chart.remove();
|
|
||||||
};
|
|
||||||
}, []);
|
|
||||||
|
|
||||||
// Update Candles Data
|
|
||||||
useEffect(() => {
|
|
||||||
if (!seriesRef.current || candles.length === 0) return;
|
|
||||||
|
|
||||||
const formattedData: CandlestickData<Time>[] = candles.map((c) => ({
|
|
||||||
time: (c.time) as Time,
|
|
||||||
open: c.open,
|
|
||||||
high: c.high,
|
|
||||||
low: c.low,
|
|
||||||
close: c.close,
|
|
||||||
}));
|
|
||||||
|
|
||||||
seriesRef.current.setData(formattedData);
|
|
||||||
}, [candles]);
|
|
||||||
|
|
||||||
// Update Live Forming Candle with live tick
|
|
||||||
useEffect(() => {
|
|
||||||
if (!seriesRef.current || !liveTick || candles.length === 0) return;
|
|
||||||
|
|
||||||
const lastCandle = candles[candles.length - 1];
|
|
||||||
const currentPrice = liveTick.bid;
|
|
||||||
|
|
||||||
const updatedCandle: CandlestickData<Time> = {
|
|
||||||
time: (lastCandle.time) as Time,
|
|
||||||
open: lastCandle.open,
|
|
||||||
high: Math.max(lastCandle.high, currentPrice),
|
|
||||||
low: Math.min(lastCandle.low, currentPrice),
|
|
||||||
close: currentPrice,
|
|
||||||
};
|
|
||||||
|
|
||||||
seriesRef.current.update(updatedCandle);
|
|
||||||
}, [liveTick, candles]);
|
|
||||||
|
|
||||||
return (
|
|
||||||
<div className="relative w-full h-full min-h-[480px] bg-darkBg flex flex-col">
|
|
||||||
{/* Live Price Tag Overlay */}
|
|
||||||
{liveTick && (
|
|
||||||
<div className="absolute top-3 left-4 z-10 flex items-center gap-2 bg-darkCard/90 border border-darkBorder px-3 py-1.5 rounded backdrop-blur font-mono text-xs shadow-lg">
|
|
||||||
<span className="font-bold text-accentGold">XAUUSD</span>
|
|
||||||
<span className="text-gray-400">Bid: <strong className="text-gray-100">{liveTick.bid.toFixed(2)}</strong></span>
|
|
||||||
<span className="text-gray-400">Ask: <strong className="text-gray-100">{liveTick.ask.toFixed(2)}</strong></span>
|
|
||||||
<span className="text-[10px] bg-amber-500/10 text-accentGold px-1.5 py-0.5 rounded border border-amber-500/20">
|
|
||||||
Spread: {liveTick.spread_pips} pips
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
|
|
||||||
{/* Canvas */}
|
|
||||||
<div ref={chartContainerRef} className="w-full flex-1" />
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
@@ -23,6 +23,7 @@ interface TitanOrderTerminalProps {
|
|||||||
confluenceDirection: string;
|
confluenceDirection: string;
|
||||||
accountEquity: number;
|
accountEquity: number;
|
||||||
onExecuteTrade: (trade: any) => Promise<void>;
|
onExecuteTrade: (trade: any) => Promise<void>;
|
||||||
|
externalSetup?: { lot: number; sl: number; tp: number; orderType: "BUY" | "SELL" } | null;
|
||||||
}
|
}
|
||||||
|
|
||||||
export const TitanOrderTerminal: React.FC<TitanOrderTerminalProps> = ({
|
export const TitanOrderTerminal: React.FC<TitanOrderTerminalProps> = ({
|
||||||
@@ -32,6 +33,7 @@ export const TitanOrderTerminal: React.FC<TitanOrderTerminalProps> = ({
|
|||||||
confluenceDirection,
|
confluenceDirection,
|
||||||
accountEquity,
|
accountEquity,
|
||||||
onExecuteTrade,
|
onExecuteTrade,
|
||||||
|
externalSetup,
|
||||||
}) => {
|
}) => {
|
||||||
const [orderType, setOrderType] = useState<"BUY" | "SELL">("BUY");
|
const [orderType, setOrderType] = useState<"BUY" | "SELL">("BUY");
|
||||||
const [lot, setLot] = useState<number>(0.01);
|
const [lot, setLot] = useState<number>(0.01);
|
||||||
@@ -42,6 +44,16 @@ export const TitanOrderTerminal: React.FC<TitanOrderTerminalProps> = ({
|
|||||||
const [tp3Price, setTp3Price] = useState<number>(2757.40); // 1:4.0 RR
|
const [tp3Price, setTp3Price] = useState<number>(2757.40); // 1:4.0 RR
|
||||||
const [isSubmitting, setIsSubmitting] = useState<boolean>(false);
|
const [isSubmitting, setIsSubmitting] = useState<boolean>(false);
|
||||||
|
|
||||||
|
// Apply external setup from Agentic Copilot
|
||||||
|
useEffect(() => {
|
||||||
|
if (externalSetup) {
|
||||||
|
setLot(externalSetup.lot);
|
||||||
|
setSlPrice(externalSetup.sl);
|
||||||
|
setTp2Price(externalSetup.tp);
|
||||||
|
setOrderType(externalSetup.orderType);
|
||||||
|
}
|
||||||
|
}, [externalSetup]);
|
||||||
|
|
||||||
// Sync entry and calculate default TP/SL whenever price changes
|
// Sync entry and calculate default TP/SL whenever price changes
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (currentPrice > 0) {
|
if (currentPrice > 0) {
|
||||||
|
|||||||
@@ -14,7 +14,10 @@ import {
|
|||||||
Activity,
|
Activity,
|
||||||
Layers,
|
Layers,
|
||||||
Download,
|
Download,
|
||||||
CheckCircle2
|
CheckCircle2,
|
||||||
|
LayoutGrid,
|
||||||
|
Maximize2,
|
||||||
|
Bot
|
||||||
} from "lucide-react";
|
} from "lucide-react";
|
||||||
import { LiveTelemetry } from "@/hooks/useExnessWebSocket";
|
import { LiveTelemetry } from "@/hooks/useExnessWebSocket";
|
||||||
import { soundFX } from "@/lib/soundEffects";
|
import { soundFX } from "@/lib/soundEffects";
|
||||||
@@ -27,6 +30,8 @@ interface TitanHeaderProps {
|
|||||||
circuitBreakerTripped: boolean;
|
circuitBreakerTripped: boolean;
|
||||||
onEmergencyKill: () => void;
|
onEmergencyKill: () => void;
|
||||||
onLockTerminal: () => void;
|
onLockTerminal: () => void;
|
||||||
|
activeWorkspaceMode?: "pro" | "focus" | "agentic";
|
||||||
|
onChangeWorkspaceMode?: (mode: "pro" | "focus" | "agentic") => void;
|
||||||
}
|
}
|
||||||
|
|
||||||
export const TitanHeader: React.FC<TitanHeaderProps> = ({
|
export const TitanHeader: React.FC<TitanHeaderProps> = ({
|
||||||
@@ -36,6 +41,8 @@ export const TitanHeader: React.FC<TitanHeaderProps> = ({
|
|||||||
circuitBreakerTripped,
|
circuitBreakerTripped,
|
||||||
onEmergencyKill,
|
onEmergencyKill,
|
||||||
onLockTerminal,
|
onLockTerminal,
|
||||||
|
activeWorkspaceMode = "pro",
|
||||||
|
onChangeWorkspaceMode,
|
||||||
}) => {
|
}) => {
|
||||||
const [audioEnabled, setAudioEnabled] = useState(true);
|
const [audioEnabled, setAudioEnabled] = useState(true);
|
||||||
const [nowUtc, setNowUtc] = useState<Date>(new Date());
|
const [nowUtc, setNowUtc] = useState<Date>(new Date());
|
||||||
@@ -107,7 +114,6 @@ export const TitanHeader: React.FC<TitanHeaderProps> = ({
|
|||||||
const balance = telemetry?.balance ?? 15.19;
|
const balance = telemetry?.balance ?? 15.19;
|
||||||
const equity = telemetry?.equity ?? 15.19;
|
const equity = telemetry?.equity ?? 15.19;
|
||||||
const floatingPnl = telemetry?.floating_pnl ?? 0.0;
|
const floatingPnl = telemetry?.floating_pnl ?? 0.0;
|
||||||
const freeMargin = telemetry?.free_margin ?? 15.19;
|
|
||||||
const isPnlPositive = floatingPnl >= 0;
|
const isPnlPositive = floatingPnl >= 0;
|
||||||
|
|
||||||
// Compute Active Sessions in UTC
|
// Compute Active Sessions in UTC
|
||||||
@@ -128,10 +134,17 @@ export const TitanHeader: React.FC<TitanHeaderProps> = ({
|
|||||||
onLockTerminal();
|
onLockTerminal();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const handleModeSwitch = (mode: "pro" | "focus" | "agentic") => {
|
||||||
|
soundFX.playClick();
|
||||||
|
if (onChangeWorkspaceMode) {
|
||||||
|
onChangeWorkspaceMode(mode);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<header className="w-full bg-[#050914] border-b border-[#14233d] px-3 py-2 flex flex-wrap items-center justify-between gap-3 text-xs select-none shadow-xl">
|
<header className="w-full h-14 bg-[#050914] border-b border-[#14233d] px-3.5 flex items-center justify-between flex-nowrap gap-3 text-xs select-none shadow-xl z-30">
|
||||||
{/* 1. Brand & Broker Connection */}
|
{/* 1. Brand & Broker Connection (Left) */}
|
||||||
<div className="flex items-center gap-3">
|
<div className="flex items-center gap-3 shrink-0">
|
||||||
<div className="flex items-center gap-2">
|
<div className="flex items-center gap-2">
|
||||||
<div className="w-8 h-8 rounded-lg bg-gradient-to-br from-cyan-400 via-sky-600 to-blue-700 flex items-center justify-center font-black text-black text-sm shadow-lg shadow-cyan-500/20 border border-cyan-300/40">
|
<div className="w-8 h-8 rounded-lg bg-gradient-to-br from-cyan-400 via-sky-600 to-blue-700 flex items-center justify-center font-black text-black text-sm shadow-lg shadow-cyan-500/20 border border-cyan-300/40">
|
||||||
AQ
|
AQ
|
||||||
@@ -144,7 +157,7 @@ export const TitanHeader: React.FC<TitanHeaderProps> = ({
|
|||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<div className="text-[10px] text-gray-400 flex items-center gap-1 font-mono">
|
<div className="text-[10px] text-gray-400 flex items-center gap-1 font-mono">
|
||||||
<span>Hedge Fund Sentinel</span>
|
<span>Sentinel Quant</span>
|
||||||
<span className="text-gray-600">•</span>
|
<span className="text-gray-600">•</span>
|
||||||
<span className="text-emerald-400">Exness Direct</span>
|
<span className="text-emerald-400">Exness Direct</span>
|
||||||
</div>
|
</div>
|
||||||
@@ -171,64 +184,104 @@ export const TitanHeader: React.FC<TitanHeaderProps> = ({
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* 2. Global Forex Sessions Indicator */}
|
{/* 2. Global Forex Sessions & Financial Metrics (Center - No Wrap) */}
|
||||||
<div className="hidden xl:flex items-center gap-2 px-2.5 py-1 rounded-md bg-[#081224] border border-[#182e52] font-mono text-[10px]">
|
<div className="hidden lg:flex items-center gap-3 shrink-0">
|
||||||
<Clock className="w-3 h-3 text-cyan-400" />
|
{/* Forex Sessions Clock */}
|
||||||
<span className="text-gray-400">SESSIONS:</span>
|
<div className="flex items-center gap-2 px-2.5 py-1 rounded-md bg-[#081224] border border-[#182e52] font-mono text-[10px]">
|
||||||
<span className={isSydneyOpen ? "text-emerald-400 font-bold" : "text-gray-600"}>SYD</span>
|
<Clock className="w-3 h-3 text-cyan-400" />
|
||||||
<span className="text-gray-700">•</span>
|
<span className="text-gray-400">SESSIONS:</span>
|
||||||
<span className={isTokyoOpen ? "text-emerald-400 font-bold" : "text-gray-600"}>TKY</span>
|
<span className={isSydneyOpen ? "text-emerald-400 font-bold" : "text-gray-600"}>SYD</span>
|
||||||
<span className="text-gray-700">•</span>
|
<span className="text-gray-700">•</span>
|
||||||
<span className={isLondonOpen ? "text-emerald-400 font-bold" : "text-gray-600"}>LDN</span>
|
<span className={isTokyoOpen ? "text-emerald-400 font-bold" : "text-gray-600"}>TKY</span>
|
||||||
<span className="text-gray-700">•</span>
|
<span className="text-gray-700">•</span>
|
||||||
<span className={isNYOpen ? "text-emerald-400 font-bold" : "text-gray-600"}>NYC</span>
|
<span className={isLondonOpen ? "text-emerald-400 font-bold" : "text-gray-600"}>LDN</span>
|
||||||
{isOverlap && (
|
<span className="text-gray-700">•</span>
|
||||||
<span className="ml-1 px-1.5 py-0.2 rounded bg-amber-500/10 border border-amber-500/30 text-amber-400 text-[9px] flex items-center gap-0.5 animate-pulse">
|
<span className={isNYOpen ? "text-emerald-400 font-bold" : "text-gray-600"}>NYC</span>
|
||||||
<Flame className="w-2.5 h-2.5 text-amber-400" /> OVERLAP
|
{isOverlap && (
|
||||||
</span>
|
<span className="ml-1 px-1.5 py-0.2 rounded bg-amber-500/10 border border-amber-500/30 text-amber-400 text-[9px] flex items-center gap-0.5 animate-pulse">
|
||||||
)}
|
<Flame className="w-2.5 h-2.5 text-amber-400" /> OVERLAP
|
||||||
</div>
|
|
||||||
|
|
||||||
{/* 3. Real Account Financial Metrics Bar */}
|
|
||||||
<div className="flex items-center gap-3 font-mono">
|
|
||||||
<div className="px-2 py-0.5 rounded bg-[#081224] border border-[#14233d]">
|
|
||||||
<span className="text-gray-500 block text-[9px] uppercase tracking-wider">Balance</span>
|
|
||||||
<span className="font-bold text-gray-100 text-xs">${balance.toFixed(2)}</span>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className="px-2 py-0.5 rounded bg-[#081224] border border-[#14233d]">
|
|
||||||
<span className="text-gray-500 block text-[9px] uppercase tracking-wider">Equity</span>
|
|
||||||
<span className="font-bold text-cyan-300 text-xs">${equity.toFixed(2)}</span>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className="px-2 py-0.5 rounded bg-[#081224] border border-[#14233d] hidden sm:block">
|
|
||||||
<span className="text-gray-500 block text-[9px] uppercase tracking-wider">Free Margin</span>
|
|
||||||
<span className="font-bold text-gray-200 text-xs">${freeMargin.toFixed(2)}</span>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className="px-2 py-0.5 rounded bg-[#081224] border border-[#14233d]">
|
|
||||||
<span className="text-gray-500 block text-[9px] uppercase tracking-wider">Floating PnL</span>
|
|
||||||
<span className={`font-bold text-xs ${isPnlPositive ? "text-emerald-400" : "text-rose-500"}`}>
|
|
||||||
{isPnlPositive ? `+$${floatingPnl.toFixed(2)}` : `-$${Math.abs(floatingPnl).toFixed(2)}`}
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
{/* Risk Shield Badge */}
|
|
||||||
<div className="hidden md:flex items-center gap-1.5 px-2 py-1 rounded bg-[#081224] border border-[#14233d]">
|
|
||||||
{circuitBreakerTripped ? (
|
|
||||||
<span className="text-rose-500 flex items-center gap-1 text-[10px] font-bold animate-pulse">
|
|
||||||
<ShieldAlert className="w-3.5 h-3.5" /> CIRCUIT LOCKED
|
|
||||||
</span>
|
|
||||||
) : (
|
|
||||||
<span className="text-emerald-400 flex items-center gap-1 text-[10px] font-bold">
|
|
||||||
<ShieldCheck className="w-3.5 h-3.5 text-emerald-400" /> 1.0% RISK SHIELD
|
|
||||||
</span>
|
</span>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
{/* Real Account Financial Metrics Bar */}
|
||||||
|
<div className="flex items-center gap-2 font-mono">
|
||||||
|
<div className="px-2.5 py-1 rounded bg-[#081224] border border-[#14233d]">
|
||||||
|
<span className="text-gray-500 block text-[8px] uppercase tracking-wider leading-none mb-0.5">Balance</span>
|
||||||
|
<span className="font-bold text-gray-100 text-xs">${balance.toFixed(2)}</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className="px-2.5 py-1 rounded bg-[#081224] border border-[#14233d]">
|
||||||
|
<span className="text-gray-500 block text-[8px] uppercase tracking-wider leading-none mb-0.5">Equity</span>
|
||||||
|
<span className="font-bold text-cyan-300 text-xs">${equity.toFixed(2)}</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className="px-2.5 py-1 rounded bg-[#081224] border border-[#14233d]">
|
||||||
|
<span className="text-gray-500 block text-[8px] uppercase tracking-wider leading-none mb-0.5">Floating PnL</span>
|
||||||
|
<span className={`font-bold text-xs ${isPnlPositive ? "text-emerald-400" : "text-rose-500"}`}>
|
||||||
|
{isPnlPositive ? `+$${floatingPnl.toFixed(2)}` : `-$${Math.abs(floatingPnl).toFixed(2)}`}
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{/* Risk Shield Badge */}
|
||||||
|
<div className="hidden xl:flex items-center gap-1.5 px-2.5 py-1 rounded bg-[#081224] border border-[#14233d]">
|
||||||
|
{circuitBreakerTripped ? (
|
||||||
|
<span className="text-rose-500 flex items-center gap-1 text-[10px] font-bold animate-pulse">
|
||||||
|
<ShieldAlert className="w-3.5 h-3.5" /> CIRCUIT LOCKED
|
||||||
|
</span>
|
||||||
|
) : (
|
||||||
|
<span className="text-emerald-400 flex items-center gap-1 text-[10px] font-bold">
|
||||||
|
<ShieldCheck className="w-3.5 h-3.5 text-emerald-400" /> 1.0% RISK SHIELD
|
||||||
|
</span>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* 4. Controls & Emergency Actions */}
|
{/* 3. Workspace Views & Controls (Right - High Density, No Wrap) */}
|
||||||
<div className="flex items-center gap-2">
|
<div className="flex items-center gap-2 shrink-0">
|
||||||
|
{/* Workspace Mode Switcher (Antigravity Style) */}
|
||||||
|
<div className="hidden md:flex items-center p-0.5 rounded-lg bg-[#081224] border border-[#182e52] text-[11px] font-mono">
|
||||||
|
<button
|
||||||
|
onClick={() => handleModeSwitch("pro")}
|
||||||
|
className={`px-2 py-1 rounded-md flex items-center gap-1 transition ${
|
||||||
|
activeWorkspaceMode === "pro"
|
||||||
|
? "bg-cyan-600 text-white font-bold shadow-sm"
|
||||||
|
: "text-gray-400 hover:text-gray-200"
|
||||||
|
}`}
|
||||||
|
title="3-Column Institutional Pro Terminal"
|
||||||
|
>
|
||||||
|
<LayoutGrid className="w-3 h-3" />
|
||||||
|
<span>PRO</span>
|
||||||
|
</button>
|
||||||
|
|
||||||
|
<button
|
||||||
|
onClick={() => handleModeSwitch("focus")}
|
||||||
|
className={`px-2 py-1 rounded-md flex items-center gap-1 transition ${
|
||||||
|
activeWorkspaceMode === "focus"
|
||||||
|
? "bg-amber-600 text-white font-bold shadow-sm"
|
||||||
|
: "text-gray-400 hover:text-gray-200"
|
||||||
|
}`}
|
||||||
|
title="Full Focus Chart Mode"
|
||||||
|
>
|
||||||
|
<Maximize2 className="w-3 h-3" />
|
||||||
|
<span>FOCUS</span>
|
||||||
|
</button>
|
||||||
|
|
||||||
|
<button
|
||||||
|
onClick={() => handleModeSwitch("agentic")}
|
||||||
|
className={`px-2 py-1 rounded-md flex items-center gap-1 transition ${
|
||||||
|
activeWorkspaceMode === "agentic"
|
||||||
|
? "bg-gradient-to-r from-emerald-600 to-teal-600 text-white font-bold shadow-sm"
|
||||||
|
: "text-gray-400 hover:text-gray-200"
|
||||||
|
}`}
|
||||||
|
title="Hermes Agentic AI Cockpit"
|
||||||
|
>
|
||||||
|
<Bot className="w-3 h-3" />
|
||||||
|
<span>AGENTIC</span>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
{/* PWA / iOS Install Button */}
|
{/* PWA / iOS Install Button */}
|
||||||
{isInstalled ? (
|
{isInstalled ? (
|
||||||
<div
|
<div
|
||||||
@@ -236,7 +289,7 @@ export const TitanHeader: React.FC<TitanHeaderProps> = ({
|
|||||||
className="hidden sm:flex items-center gap-1 px-2.5 py-1.5 rounded-lg bg-emerald-950/40 border border-emerald-500/30 text-emerald-400 text-[11px] font-bold shadow-sm"
|
className="hidden sm:flex items-center gap-1 px-2.5 py-1.5 rounded-lg bg-emerald-950/40 border border-emerald-500/30 text-emerald-400 text-[11px] font-bold shadow-sm"
|
||||||
>
|
>
|
||||||
<CheckCircle2 className="w-3.5 h-3.5 text-emerald-400 stroke-[2.5]" />
|
<CheckCircle2 className="w-3.5 h-3.5 text-emerald-400 stroke-[2.5]" />
|
||||||
<span className="hidden md:inline">APP ACTIVE</span>
|
<span className="hidden lg:inline">APP ACTIVE</span>
|
||||||
</div>
|
</div>
|
||||||
) : (
|
) : (
|
||||||
<button
|
<button
|
||||||
@@ -268,7 +321,8 @@ export const TitanHeader: React.FC<TitanHeaderProps> = ({
|
|||||||
title="Lock Quant Workstation"
|
title="Lock Quant Workstation"
|
||||||
className="bg-[#0c182e] hover:bg-[#122240] active:scale-95 text-amber-400 font-medium text-[11px] px-2.5 py-1.5 rounded-lg flex items-center gap-1.5 border border-amber-500/30 transition shadow-sm"
|
className="bg-[#0c182e] hover:bg-[#122240] active:scale-95 text-amber-400 font-medium text-[11px] px-2.5 py-1.5 rounded-lg flex items-center gap-1.5 border border-amber-500/30 transition shadow-sm"
|
||||||
>
|
>
|
||||||
<Lock className="w-3 h-3 text-amber-400" /> LOCK
|
<Lock className="w-3 h-3 text-amber-400" />
|
||||||
|
<span className="hidden sm:inline">LOCK</span>
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
{/* Emergency Panic Kill Switch */}
|
{/* Emergency Panic Kill Switch */}
|
||||||
@@ -276,7 +330,8 @@ export const TitanHeader: React.FC<TitanHeaderProps> = ({
|
|||||||
onClick={handleKill}
|
onClick={handleKill}
|
||||||
className="bg-gradient-to-r from-red-600 to-rose-700 hover:from-red-500 hover:to-rose-600 active:scale-95 text-white font-black text-[11px] px-3 py-1.5 rounded-lg flex items-center gap-1.5 shadow-lg shadow-red-600/30 border border-red-400/40 transition tracking-wider"
|
className="bg-gradient-to-r from-red-600 to-rose-700 hover:from-red-500 hover:to-rose-600 active:scale-95 text-white font-black text-[11px] px-3 py-1.5 rounded-lg flex items-center gap-1.5 shadow-lg shadow-red-600/30 border border-red-400/40 transition tracking-wider"
|
||||||
>
|
>
|
||||||
<Zap className="w-3.5 h-3.5 fill-current" /> KILL ALL
|
<Zap className="w-3.5 h-3.5 fill-current" />
|
||||||
|
<span>KILL ALL</span>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user