nx_fin_portfolio.nx
buildroot/runtime/nx_fin_portfolio.nx
about
nx_fin_portfolio.nx -- portfolio construction / DIVERSIFICATION: allocate across many names so NO single
position or correlated cluster can sink the account (the portfolio-level complement to R4's per-trade sizing).
Equal- or score-weighted allocation, each capped by a per-name concentration limit; sector-exposure and total-
exposure (no-leverage) checks; and a Herfindahl concentration index (lower = more diversified; 10000/N at
equal weight). Pure, i64 (cents/bps), data-driven caps (Cardinal 11). license_tier: ORIGINAL
dependencies 1 imports · 1 importers
imports: nx_syscalls.nx
imported by: nx_fin_portfolio_gate.nx
structs
| none |
consts
| 7 | const K_MAGIC_10000: i64 = 10000 |
functions
| 10 | func pf_equal_weight(equity_cents: i64, n_positions: i64, max_weight_bps: i64) -> i64 called by 1: main |
| 19 | func pf_score_weight(equity_cents: i64, score: i64, total_score: i64, max_weight_bps: i64) -> i64 called by 1: main |
| 28 | func pf_concentration_ok(position_cents: i64, equity_cents: i64, max_weight_bps: i64) -> i64 called by 1: main |
| 34 | func pf_sector_ok(sector_exposure_cents: i64, new_position_cents: i64, equity_cents: i64, max_sector_bps: i64) -> i64 called by 1: main |
| 40 | func pf_total_exposure_ok(deployed_cents: i64, new_position_cents: i64, equity_cents: i64) -> i64 called by 1: main |
| 47 | func pf_herfindahl(weights_bps: *i64, n: i64) -> i64 called by 1: main |