PageSourceSearch

https://futurecast.pro/assets/PaperBacktestDetail-C0UO4-Tf.js

js futurecast.pro collected 2026-10-07 03:09:37 UTC 4,832 bytes, 1 lines download raw bytes

1import{j as e}from"./vendor-query-Dkm4furz.js";import{c as m,L as d}from"./vendor-react-C4nmQqxk.js";import{s as h,g as j,E as u,h as v,k as g,S as t,i,p as b,j as N,t as r}from"./paper-lab-B6zBiTX3.js";import{A as k}from"./arrow-left-D-SlLMUr.js";import"./vendor-supabase-CbPlSJWC.js";import"./lock-ncMfD5dg.js";import"./index-Bxl4mrbd.js";import"./vendor-pdf-5g-lfC8S.js";import"./vendor-charts-DHhRtk-9.js";import"./triangle-alert-B8mDITLe.js";function R(){const{id:o=""}=m(),{data:c,isLoading:p,error:n,refetch:x}=h(o);if(p)return e.jsx(j,{});if(n||!c)return e.jsxs("div",{className:"space-y-4",children:[e.jsx(d,{to:"/paper-lab/backtests",className:"pl-label",children:"Back to backtests"}),e.jsx(u,{error:n,onRetry:()=>x()})]});const s=c.backtest,a=s.result.summary;return e.jsxs("div",{className:"space-y-8",children:[e.jsxs(d,{to:"/paper-lab/backtests",className:"pl-label inline-flex items-center gap-1 hover:text-[hsl(var(--pl-ink))]","data-testid":"link-back",children:[e.jsx(k,{className:"w-3 h-3"}),"Backtests"]}),e.jsxs(v,{kicker:`${s.id.slice(0,8)} · ${s.version} · ${s.mode}`,title:`${s.asset}`,children:[e.jsx("span",{className:"pl-stamp pl-cobalt",children:"separate candle-rule simulation"}),s.coverage.complete&&e.jsx("span",{className:"pl-stamp pl-moss",children:"coverage complete"})]}),e.jsx(g,{compact:!0}),e.jsx("div",{className:"pl-caveat p-3 text-sm",children:"This historical candle-rule result is not a forecast backtest and does not validate an edge in issued Futurecast forecasts."}),e.jsxs("section",{className:"grid grid-cols-2 md:grid-cols-4 gap-3",children:[e.jsx(t,{label:"Final equity",value:i(a.finalEquity),testid:"text-final-equity"}),e.jsx(t,{label:"Net P&L",value:i(a.totalNetPnlUsd),tone:a.totalNetPnlUsd>=0?"pl-moss":"pl-ox",testid:"text-net-pnl"}),e.jsx(t,{label:"Return",value:b(a.totalReturnPct),tone:a.totalReturnPct>=0?"pl-moss":"pl-ox",testid:"text-return"}),e.jsx(t,{label:"Max drawdown",value:`-${a.maxDrawdownPct.toFixed(2)}
1%`,tone:"pl-ox"}),e.jsx(t,{label:"Round trips",value:a.numTrades}),e.jsx(t,{label:"Fees paid",value:i(a.feesUsd)}),e.jsx(t,{label:"Fee / slip bps",value:`${s.feeBps} / ${s.slippageBps}`}),e.jsx(t,{label:"Starting capital",value:i(a.startingCapitalUsd)})]}),e.jsxs("section",{className:"pl-sheet p-5",children:[e.jsxs("div",{className:"flex justify-between mb-3",children:[e.jsx("span",{className:"pl-label",children:"Equity (hourly, marked to close)"}),e.jsx("span",{className:"pl-label",children:"dashed = starting capital"})]}),e.jsx(N,{points:s.result.equity,baseline:s.capital,height:220})]}),e.jsxs("section",{className:"grid md:grid-cols-3 gap-4",children:[e.jsxs("div",{className:"pl-sheet p-4 pl-mono text-xs space-y-1.5 md:col-span-1","data-testid":"text-coverage",children:[e.jsx("div",{className:"pl-label mb-2",children:"Coverage & provenance"}),e.jsxs("div",{children:[e.jsx("span",{className:"pl-ink3",children:"range "}),r(s.coverage.from)," → ",r(s.coverage.to)]}),e.jsxs("div",{children:[e.jsx("span",{className:"pl-ink3",children:"candles "}),s.coverage.candles," (incl. ",s.coverage.warmupHours,"h warmup)"]}),e.jsxs("div",{children:[e.jsx("span",{className:"pl-ink3",children:"complete "}),String(s.coverage.complete)]}),e.jsxs("div",{children:[e.jsx("span",{className:"pl-ink3",children:"config "}),s.strategy]}),e.jsxs("div",{children:[e.jsx("span",{className:"pl-ink3",children:"source "}),s.source]}),e.jsxs("div",{children:[e.jsx("span",{className:"pl-ink3",children:"created "}),r(s.createdAt)]})]}),e.jsxs("div",{className:"pl-caveat p-4 text-sm md:col-span-2",children:[e.jsx("span",{className:"pl-label !text-current mr-2",children:"Stored warning"}),s.warning]})]}),e.jsxs("section",{children:[e.jsxs("h2",{className:"pl-display text-2xl mb-3",children:["Trade ledger ",e.jsxs("span",{className:"pl-mono text-sm pl-ink3",children:[s.result.fills.length," fills"]})]}),s.result.fills.length===0?e.jsx("div",{className:"pl-sheet p-6 pl-ink2 text-sm","data-testid":"status-no-fills",children:"The rule never triggered an entry in this range."}):e.jsx("div",{className:"pl-sheet overflow-x-auto max-h-[480px] overflow-y-auto",children:e.jsxs("table",{className:"pl-table",children:[e.jsx("thead",{className:"sticky top-0 bg-[hsl(var(--pl-sheet))]",children:e.jsxs("tr",{children:[e.jsx("th",{children:"Time (UTC)"}),e.jsx("th",{children:"Side"}),e.jsx("th",{children:"Price"}),e.jsx("th",{children:"Qty"}),e.jsx("th",{children:"Fee"})]})}),e.jsx("tbody",{children:s.result.fills.map(l=>e.jsxs("tr",{"data-testid":`row-fill-${l.id}`,children:[e.jsx("td",{children:r(l.at)}),e.jsx("td",{className:l.side==="buy"?"pl-cobalt":"pl-amber",children:l.side}),e.jsx("td",{children:l.price.toPrecision(6)}),e.jsx("td",{children:l.qty.toPrecision(6)}),e.jsx("td",{children:l.fee.toFixed(2)})]},l.id))})]})})]})]})}export{R as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.