Improve chart trade overlays and paper fill markers.
De-clutter setup labels (left roles, right prices; hide Entry near Now; S/R in-plot), and draw green/red arrows for paper trade entry and exit on the matching sessions.
This commit is contained in:
@@ -145,12 +145,21 @@ export default function TickerDetailPage() {
|
||||
// Status labels: is there an open paper trade on this ticker, and is it the
|
||||
// current top pick (same ranking the dashboard highlights)?
|
||||
const openTrades = usePaperTrades('open');
|
||||
// Full history for chart entry/exit arrows (open + closed on this symbol).
|
||||
const paperTradeHistory = usePaperTrades();
|
||||
const allTrades = useTrades();
|
||||
const activation = useActivation();
|
||||
const hasOpenTrade = useMemo(
|
||||
() => (openTrades.data ?? []).some((t) => t.symbol.toUpperCase() === symbol.toUpperCase()),
|
||||
[openTrades.data, symbol],
|
||||
);
|
||||
const symbolPaperTrades = useMemo(
|
||||
() =>
|
||||
(paperTradeHistory.data ?? []).filter(
|
||||
(t) => t.symbol.toUpperCase() === symbol.toUpperCase(),
|
||||
),
|
||||
[paperTradeHistory.data, symbol],
|
||||
);
|
||||
const isTopPick = useMemo(
|
||||
() => topPickSymbol(allTrades.data, activation.data)?.toUpperCase() === symbol.toUpperCase(),
|
||||
[allTrades.data, activation.data, symbol],
|
||||
@@ -456,11 +465,20 @@ export default function TickerDetailPage() {
|
||||
onShowGateTrafficChange={setShowGateTraffic}
|
||||
tradeSetup={overlayWithTarget}
|
||||
currentPrice={priceInfo?.price}
|
||||
paperTrades={symbolPaperTrades}
|
||||
/>
|
||||
<p className="mt-2 text-[11px] text-gray-500">
|
||||
Only the nearest support & resistance are drawn. Full list in the S/R Levels tab.
|
||||
{srLevels.isError && ' S/R levels unavailable.'}
|
||||
{gateTargetLadder.isError && ' GTL diagnostic unavailable.'}
|
||||
{symbolPaperTrades.length > 0 && (
|
||||
<>
|
||||
{' '}
|
||||
<span className="text-emerald-400/90">▼</span> paper entry
|
||||
{' · '}
|
||||
<span className="text-red-400/90">▲</span> paper exit
|
||||
</>
|
||||
)}
|
||||
</p>
|
||||
<ProductionRankStrip
|
||||
setup={longSetup ?? shortSetup}
|
||||
|
||||
Reference in New Issue
Block a user