docs(reference): bring the API examples in line with the current code

Merged
RI
10d ago
+130-33

Follow-up to #76, which moved the developer reference to docs/reference.md unchanged. The review there flagged stale examples; this fixes those and about fifteen more found by checking every example against the source:

  • CostModel: bps fields are f64, min_trade_fee is min_commission.
  • Position::apply_fill takes Shares.
  • backtest_weights (Rust and Python) takes CostModel, FillPolicy and BarPrices; equity_curve holds the initial equity plus one entry per period; result fields listed in full.
  • Broker trait: open_orders, BrokerOrder.client_order_id, Quote.timestamp.
  • Event list: the four SubmitStop* variants. Symbol limit: 8 UTF-8 bytes.
  • compute_metrics returns Option<Metrics>; risk statuses are PASS|WARN|FAIL; rebalancer and lob CLI commands completed; Python stop and broker options documented.

Check: every changed Rust example compiles and runs (with asserts) in a scratch crate depending on the workspace by path; the old snippets fail to compile. Python examples checked against the PyO3 source and run against a local build.