PageSourceSearch

https://app.boosted.ai/assets/CrXGcbBv.js

js boosted.ai collected 2026-10-03 20:18:20 UTC 12,706 bytes, 1 lines download raw bytes

1import{bN as F,bY as O,de as $,j as e,l as L,bO as q,a1 as D}from"./C24N-clC.js";import{r as K,au as Q}from"./BrrVqsAE.js";import{a as w}from"./B9t2xlIC.js";import{c as V,l as z,f as T,p as c,u as G,m as h}from"./BdWYbjuk.js";import{u as U,b as Y,c as k,e as P,p as M,m as E,f as H,F as J,g as W,D as X,h as Z}from"./CqHGW6ca.js";import{a as S,b as ee}from"./BYfjKDNg.js";import"./2GphJ173.js";import"./vv02AzSu.js";import"./BkCKyb1q.js";import"./Ce9rR6Hq.js";import"./Dp7ijaip.js";import"./Dhh4oLOP.js";import"./B7Y27RyX.js";import"./BouhNmGN.js";import"./B9MF30Cq.js";import"./DXXT8Fmh.js";import"./CVaKrjgf.js";import"./DS3sXihf.js";import"./D6NakcF-.js";import"./DDskA0xn.js";import"./FEFE15x4.js";import"./BrynCA9f.js";import"./JwN3l5mb.js";import"./CB43Ye3X.js";import"./D0kEYzbj.js";import"./C7IhdmEG.js";import"./Dk355brz.js";import"./lmdFKtAz.js";import"./BStQyUtf.js";import"./CfIvmbeB.js";import"./apNQqoWq.js";import"./BkpSDYFp.js";import"./DGOfiX9D.js";import"./D2JANKyQ.js";import"./BbmmwCo0.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};t.SENTRY_RELEASE={id:"all-0.0.1680"};var s=new t.Error().stack;s&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[s]="af545785-25a3-4daf-b2d8-a2f730d455a2",t._sentryDebugIdIdentifier="sentry-dbid-af545785-25a3-4daf-b2d8-a2f730d455a2")}catch{}})();function A(t){return t==null?"text-text-muted":t<30?"text-success":t<40?"text-success/70":t>70?"text-error":t>60?"text-error/70":"text-warning"}function R(t){return t==null?"text-text-muted":t>.01?"text-success":t<-.01?"text-error":"text-warning"}function B(t){return t?t==="below"||t==="lower"?"text-success":t==="above"||t==="upper"?"text-error":"text-warning":"text-text-muted"}function te(t){return t==null?"text-text-muted":t>=65?"text-success":t>=55?"text-success/70":t<=35?"text-error":t<=45?"text-error/70":"text-warning"}function ie(t){return t!=null&&t!=="long"}function N(t,s){return s?t.includes("text-success")?t.replace("text-success","text-error"):t.includes("text-error")?t.replace("text-error","text-success"):t:t}function re(t,s){return t?e.jsx("span",{className:"rounded-full bg-success/15 px-1.5 py-0.5 text-xs font-medium text-success",children:"Golden"}):s?e.jsx("span",{className:"rounded-full bg-error/15 px-1.5 py-0.5 text-xs font-medium text-error",children:"Death"}):e.jsx("span",{className:"text-text-muted",children:"—"})}function se(t){const s={full:"bg-success/15 text-success",maintenance:"bg-warning/15 text-warning",preservation:"bg-error/15 text-error"};return e.jsx("span",{className:`px-2 py-0.5 rounded-full text-xs font-medium ${s[t]}`,children:t.charAt(0).toUpperCase()+t.slice(1)})}function ae(t){const s={risk_on:"bg-success/15 text-success",risk_off:"bg-error/15 text-error",transitional:"bg-warning/15 text-warning"},l={risk_on:"Risk-on",risk_off:"Risk-off",transitional:"Transitional"};return e.jsx("span",{className:`px-2 py-0.5 rounded-full text-xs font-medium ${s[t]}`,children:l[t]})}function g(t,s=2){return t==null?"—":t.toFixed(s)}function Qe(){const{technicalsData:t,isTechnicalsLoading:s,fetchTechnicals:l,portfolioPositions:x,fetchPortfolio:i,selectedOrgId:o,selectedFundId:r}=F(),a=S(["technicals",r],()=>l(!1),!!r),m=S(["portfolio",r],i,!!(r&&x.length===0)),u=O({mutationFn:()=>l(!0)});U({label:"Recompute technicals",onClick:()=>u.mutate(),disabled:s||u.isPending,loading:s||u.isPending,issues:[...a.isError&&t?[{id:"technicals",source:"Portfolio and per-name technicals",error:a.error,consequence:"Refresh failed. Showing previously loaded data.",severity:"warning",retry:{onClick:()=>void a.refetch(),loading:a.isFetching}}]:[],...u.isError&&t?[{id:"technicals-recompute",source:"Technical recompute",error:u.error,consequence:"The latest technical calculation request failed; previous values remain available.",severity:"warning",retry:{onClick:()=>u.mutate(),loading:u.isPending}}]:[],...m.isError?[{id:"portfolio-directions",source:"Portfolio position directions",error:m.error,consequence:"Portfolio position directions couldn't be loaded.",severity:x.length>0?"warning":"error",retry:{onClick:()=>void m.refetch(),loading:m.isFetching}}]:[]]});const y=K.useMemo(()=>{const b=new Map;for(const v of x){const I=$(v.gbi_id);I!==void 0&&b.set(I,v.direction)}return b},[x]);if(a.isPending&&!t)return e.jsx(Y,{rows:8,tab:"technicals"});if(!t||t.signals.length===0)return e.jsxs(k,{children:[e.jsx(P,{value:t==null?void 0:t.as_of,className:"text-right",testId:"technicals-data-timestamp"}),e.jsx(ee,{title:a.isError?"Technical analysis unavailable":"No technical data",description:a.isError?q(a.error,"Couldn't load portfolio and per-name technicals."):"Technical signals are computed from portfolio positions using historical price data. Start the system and add positions to see per-name RSI, MACD, Bollinger Bands, and moving averages.",icon:e.jsx(Q,{size:32}),action:a.isError?e.jsx(L,{type:"button",disabled:a.isFetching,onClick:()=>void a.refetch(),children:"Retry"}):void 0})]});const{signals:_,portfolio:n}=t,f=n?M(n.citations):null,j=E(o??void 0,f,r??void 0,{asOf:t.as_of});return e.jsxs(k,{className:"space-y-6",children:[e.jsx(P,{value:t.as_of,className:"text-right",testId:"technicals-data-timestamp"}),n&&e.jsx("section",{"aria-labelledby":"portfolio-technical-composite-title",children:e.jsxs(D,{variant:"workspace",className:"overflow-hidden p-0",children:[e.jsx("div",{className:"border-b border-border-secondary px-6 py-3",children:e.jsx("h3",{id:"portfolio-technical-composite-title",className:"type-card-title text-text-primary",children:"Portfolio technical composite"})}),e.jsxs("div",{className:"grid grid-cols-2 bg-border-secondary gap-px md:grid-cols-5",children:[e.jsx(C,{label:"Portfolio RSI",value:g(n.portfolio_rsi,1),color:A(n.portfolio_rsi),citationIds:d(n,f,["portfolio_rsi"]),citations:f,fetchDetail:j}),e.jsx(C,{label:"Portfolio Bollinger",value:n.portfolio_bollinger,color:B(n.portfolio_bollinger),citationIds:d(n,f,["portfolio_bollinger"]),citations:f,fetchDetail:j}),e.jsx(C,{label:"Portfolio MACD",value:n.portfolio_macd,color:R(n.portfolio_macd==="bullish"?1:n.portfolio_macd==="bearish"?-1:0),citationIds:d(n,f,["portfolio_macd"]),citations:f,fetchDetail:j}),e.jsx(w,{variant:"compact",className:"bg-surface-primary",label:"Capital deployment",value:e.jsxs("span",{className:"inline-flex items-center gap-1",children:[se(n.deployment_mode),e.jsx(p,{citations:f,citationIds:d(n,f,["deployment_mode"]),fetchDetail:j})]})}),e.jsx(w,{variant:"compact",className:"bg-surface-primary",label:"Market regime",value:e.jsxs("span",{className:"inline-flex items-center gap-1",children:[ae(n.market_regime),e.jsx(p,{citations:f,citationIds:d(n,f,["market_regime"]),fetchDetail:j})]})})]})]})}),e.jsxs(D,{variant:"workspace",role:"region","aria-labelledby":"per
1-name-technicals-title",className:"overflow-hidden p-0",children:[e.jsx("div",{className:H,children:e.jsx("h3",{id:"per-name-technicals-title",className:"type-card-title text-text-primary",children:"Per-name technicals"})}),e.jsx("div",{className:"overflow-x-auto",children:e.jsxs(V,{className:"w-full text-xs",children:[e.jsx(z,{children:e.jsxs(T,{className:"border-b border-border-primary text-text-muted hover:bg-transparent",children:[e.jsx(c,{className:"px-4 py-2.5 text-left font-medium",children:"Ticker"}),e.jsx(c,{className:"px-3 py-2.5 text-left font-medium",children:"Side"}),e.jsx(c,{className:"px-3 py-2.5 text-right font-medium",children:"RSI(14)"}),e.jsx(c,{className:"px-3 py-2.5 text-right font-medium",children:"MACD Line"}),e.jsx(c,{className:"px-3 py-2.5 text-right font-medium",children:"MACD Signal"}),e.jsx(c,{className:"px-3 py-2.5 text-center font-medium",children:"Bollinger"}),e.jsx(c,{className:"px-3 py-2.5 text-right font-medium",children:"MA 20"}),e.jsx(c,{className:"px-3 py-2.5 text-right font-medium",children:"MA 50"}),e.jsx(c,{className:"px-3 py-2.5 text-right font-medium",children:"MA 100"}),e.jsx(c,{className:"px-3 py-2.5 text-right font-medium",children:"MA 200"}),e.jsx(c,{className:"px-3 py-2.5 text-right font-medium",children:"ATR(14)"}),e.jsx(c,{className:"px-3 py-2.5 text-right font-medium",children:"Vol ratio"}),e.jsx(c,{className:"px-3 py-2.5 text-center font-medium",children:"Cross"}),e.jsx(c,{className:"px-3 py-2.5 text-right font-medium",children:"Score"})]})}),e.jsx(G,{children:_.map((b,v)=>e.jsx(ne,{signal:b,direction:b.gbi_id==null?void 0:y.get(b.gbi_id),orgId:o??void 0,fundId:r??void 0},b.id??b.gbi_id??`unresolved-${v}`))})]})})]})]})}function C({label:t,value:s,color:l,citations:x,citationIds:i,fetchDetail:o}){return e.jsx(w,{variant:"compact",className:"bg-surface-primary",label:t,value:e.jsxs("span",{className:`inline-flex items-center gap-1 ${l}`,children:[s,e.jsx(p,{citations:x,citationIds:i,fetchDetail:o})]})})}function ne({signal:t,direction:s,orgId:l,fundId:x}){const i=t,o=ie(s),r=M(i.citations),a=E(l,r,x,{technicalSignalId:i.id==null?void 0:String(i.id),asOf:i.signal_date}),m=i.macd_signal!=null&&i.macd_histogram!=null?i.macd_signal+i.macd_histogram:null;return e.jsxs(T,{className:"border-b border-border-primary/50 transition-colors hover:bg-surface-hover",children:[e.jsx(h,{className:"px-4 py-2.5 text-left font-medium text-text-primary",children:i.ticker}),e.jsx(h,{className:"px-3 py-2.5 text-left text-text-muted",children:s?o?"Short":"Long":"—"}),e.jsxs(h,{className:`px-3 py-2.5 text-right tabular-nums ${N(A(i.rsi_14),o)}`,children:[g(i.rsi_14,1),e.jsx(p,{citations:r,citationIds:d(i,r,["rsi_14"]),fetchDetail:a})]}),e.jsxs(h,{className:`px-3 py-2.5 text-right tabular-nums ${N(R(i.macd_histogram),o)}`,children:[g(m,4),m!=null&&i.macd_signal!=null&&i.macd_histogram!=null?e.jsx(X,{citations:r,fetchDetail:a,name:`${i.ticker} MACD line`,formula:"macd_line = macd_signal + macd_histogram",outputValue:m,outputDisplay:g(m,4),inputs:[{label:"MACD signal line",value:i.macd_signal,fieldKeys:"macd_signal",display:g(i.macd_signal,4),knownOn:i.signal_date,knownOnBasis:"Technical signal date"},{label:"MACD histogram",value:i.macd_histogram,fieldKeys:"macd_histogram",display:g(i.macd_histogram,4),knownOn:i.signal_date,knownOnBasis:"Technical signal date"}],asOf:i.signal_date,asOfBasis:"Technical signal date",unit:"MACD price units",testId:"technical-macd-line-citation"}):e.jsx(p,{citations:r,citationIds:d(i,r,["macd_signal","macd_histogram"]),fetchDetail:a})]}),e.jsxs(h,{className:"px-3 py-2.5 text-right tabular-nums text-text-secondary",children:[g(i.macd_signal,4),e.jsx(p,{citations:r,citationIds:d(i,r,["macd_signal"]),fetchDetail:a})]}),e.jsxs(h,{className:`px-3 py-2.5 text-center ${N(B(i.bollinger_position),o)}`,children:[i.bollinger_position??"—",e.jsx(p,{citations:r,citationIds:d(i,r,["bollinger_position"]),fetchDetail:a})]}),[20,50,100,200].map(u=>{const y=`ma_${u}`;return e.jsxs(h,{className:"px-3 py-2.5 text-right tabular-nums text-text-secondary",children:[g(i[y]),e.jsx(p,{citations:r,citationIds:d(i,r,[y]),fetchDetail:a})]},y)}),e.jsxs(h,{className:"px-3 py-2.5 text-right tabular-nums text-text-secondary",children:[g(i.atr_14),e.jsx(p,{citations:r,citationIds:d(i,r,["atr_14"]),fetchDetail:a})]}),e.jsxs(h,{className:"px-3 py-2.5 text-right tabular-nums text-text-secondary",children:[g(i.volume_ratio,1),"x",e.jsx(p,{citations:r,citationIds:d(i,r,["volume_ratio"]),fetchDetail:a})]}),e.jsx(h,{className:"px-3 py-2.5 text-center",children:e.jsxs("div",{className:"flex items-center justify-center gap-1",children:[re(i.golden_cross,i.death_cross),e.jsx(p,{citations:r,citationIds:d(i,r,["golden_cross","death_cross"]),fetchDetail:a})]})}),e.jsxs(h,{className:`px-3 py-2.5 text-right tabular-nums font-medium ${te(i.overall_score)}`,children:[g(i.overall_score,0),e.jsx(p,{citations:r,citationIds:d(i,r,["overall_score"]),fetchDetail:a})]})]})}function d(t,s,l){const x=s?new Map(s.items.map(o=>[o.id,o])):new Map,i=l.flatMap(o=>{var u;const r=(u=t.citation_ids)==null?void 0:u[o];if(r)return[r];const a=(s==null?void 0:s.sections[o])??[],m=[...a].reverse().find(y=>{var _;return((_=x.get(y))==null?void 0:_.citation_type)==="variable"});return m?[m]:a.filter(y=>x.has(y))});return[...new Set(i)]}function p({citations:t,citationIds:s=[],fetchDetail:l}){return!t||!l?e.jsx("span",{className:"ml-1 inline-flex items-center align-middle",children:e.jsx(J,{citations:null,fieldKeys:"technical metric",fetchDetail:oe})}):e.jsx("span",{className:"ml-1 inline-flex items-center gap-0.5 align-middle",children:e.jsx(W,{citations:t,citationIds:s,fetchDetail:l})})}const oe=Z("prime-technicals-unavailable");export{Qe as TechnicalsView,B as bollingerColor,N as directionalTone,ie as isShortDirection,R as macdColor,A as rsiColor,te as scoreColor};

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.