with one click
trader-portfolio
Optimize portfolio allocation using npx neural-trader mean-variance engine with risk constraints and rebalancing plan
Menu
Optimize portfolio allocation using npx neural-trader mean-variance engine with risk constraints and rebalancing plan
Based on SOC occupation classification
| name | trader-portfolio |
| description | Optimize portfolio allocation using npx neural-trader mean-variance engine with risk constraints and rebalancing plan |
| allowed-tools | Bash Read mcp__claude-flow__memory_store mcp__claude-flow__memory_retrieve mcp__claude-flow__memory_search mcp__claude-flow__neural_predict mcp__claude-flow__agentdb_pattern-search |
| argument-hint | [--risk-target NUMBER] |
Optimize portfolio allocation using neural-trader's portfolio engine.
Steps:
npm ls neural-trader 2>/dev/null || npm install --ignore-scripts neural-tradermcp__claude-flow__memory_search({ query: "current portfolio holdings", namespace: "trading-portfolio" })npx neural-trader --portfolio optimize
With risk target:
npx neural-trader --portfolio optimize --risk-target <number>
npx neural-trader --risk assess --portfolio current
npx neural-trader --var --portfolio current
npx neural-trader --correlation --portfolio current --flag-threshold 0.8
mcp__claude-flow__neural_predict({ input: "expected returns for [HOLDINGS] given current regime" })npx neural-trader --portfolio rebalance
Output: trades needed, current vs target weights, estimated costsmcp__claude-flow__agentdb_pattern-search({ query: "optimized portfolio Sharpe > 1", namespace: "trading-portfolio" })mcp__claude-flow__memory_store({ key: "portfolio-optimal-TIMESTAMP", value: "ALLOCATION_JSON", namespace: "trading-portfolio" })One-command drift detection. Composes audit-list + oia-audit + audit-trend into a single primitive — finds the most recent audit in `metaharness-audit` namespace, runs a fresh audit against the current repo, diffs them via ADR-152 §3.1 similarity, and alerts when structural distance crosses `--threshold`. Iter 53 of ADR-150 deep integration.
ADR-152 — weighted similarity between two harness fingerprints (genome + score JSON). Returns overall score in [0,1] plus per-component breakdown (cosine over 9 numerics, categorical agreement over 4 enums, jaccard over agent_topology). Unblocks ADR-151 §3.2 Recommender, §3.3 Drift Detection, §3.5 Plugin Compat. Pure-TS, no `@metaharness/*` dep — preserves ADR-150's four architectural constraints.
Composite Phase-2 audit worker (ADR-150). Bundles harness oia-manifest + threat-model + mcp-scan into one timestamped audit record stored in the `metaharness-audit` memory namespace. Designed for cron-scheduled drift detection.
7-section repo readiness report from `metaharness genome <path>`. Returns repo_type / agent_topology / risk_score / mcp_surface / test_confidence / publish_readiness. Pure-read; degrades gracefully (ADR-150).
Static security scan of a harness's declared MCP surface via `harness mcp-scan <path>`. Reads `.mcp/servers.json` + `.harness/claims.json`. Pure-read, no dispatch. Exits 1 on findings at or above `--fail-on` severity.
Scaffold a custom AI agent harness via `metaharness new <name> --template <id> --host <id>`. Defaults to DRY-RUN (no writes) unless --confirm is passed. Refuses to write to the calling repo root or anywhere inside it. Honors ADR-150 architectural constraint + ruflo's "destructive-action confirmation" pattern.