JavaScript control room

The strategy pipeline and every operational command are JavaScript. The CLI calls the same typed Encore controls used by the dashboard.

Open settings

Start in paper mode

Set the operator key, run one cycle, then inspect the ledger. Local development accepts dev-robinsharks when no production key exists.

Operator keyexport ROBINSHARKS_OPERATOR_KEY=dev-robinsharks
Run paper fleetpnpm trade:run
Read statuspnpm trade:status
Review an agentpnpm trade:review -- --agent talon

Strategy pipeline

Deployed under backend/api/strategy and covered by Vitest.

compute-features.js

EMA, RSI, ATR, MACD, volatility, range, and momentum features from closing prices.

compute-confluence.js

Strategy-specific indicator agreement score used to calibrate entry confidence.

compute-signal.js

Trend, mean reversion, breakout, momentum, low-volatility, and rotation decisions.

size-position.js

Risk-based sizing with confidence, cash, and maximum-position caps.

risk-checks.js

Global halt, circuit breaker, daily loss, confidence, cash, and position checks.

trailing-stop.js

ATR-based stop ratchet with a break-even rule that never loosens risk.

Operations

Commands under scripts use ROBINSHARKS_API_URL for remote deployments.

run.mjs

Run the paper fleet or one explicitly confirmed live agent.

halt.mjs

Set the global halt, cancel working broker orders, and optionally flatten positions.

resume.mjs

Clear the halt and circuit breaker. Live arming requires the exact confirmation phrase.

reconcile.mjs

Sync the configured live agent against Robinhood positions.

trading-status.mjs

Print fleet, system, agent, and integration state as JSON.

review-trades.mjs

Calculate outcome, streak, profit-factor, and drawdown lessons for one agent.

update-metrics.mjs

Apply a bounded confidence-floor adaptation while preserving every hard risk limit.

robinhood-mcp-auth.mjs

Complete Robinhood OAuth with PKCE and save the MCP token locally with mode 0600.

Halt and recovery

The halt flag is written before any cancellation or flatten request reaches Robinhood.

pnpm trade:halt -- --cancel-orders --reason maintenance
pnpm trade:halt -- --cancel-orders --flatten --confirm 'HALT AND FLATTEN'
pnpm trade:resume
pnpm trade:reconcile

Robinhood MCP

The helper performs dynamic client registration, PKCE authorization, and a local callback. Robinhood credentials never enter source control.

pnpm robinhood:mcp-auth
nstack env set RobinhoodMCPAccessToken
nstack env push