/algo-trading-skills:saxo-bank-openapi-integrationfrom algo-trading-skills
Routes multi-asset orders through Saxo Bank OpenAPI, handling UIC resolution and AssetType requirements for FX spot, equities, futures, and options across simulation and live environments.
Ships in algo-trading-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
Use this skill when connecting algorithmic trading systems to Saxo Bank using their multi-asset OpenAPI REST endpoints. Saxo Bank OpenAPI enables cross-asset trading across FX Spot, Global Stocks, Contract Futures, Options, and Stock CFDs. Unlike single-asset brokers, Saxo Bank identifies instruments via numeric Unique Instrument Codes (UICs) and requires explicit AssetType declarations on order payloads.
access_token. Saxo's authorization-code flow, the 20-minute access-token lifetime, and refresh rotation belong upstream — see headless-broker-auth-patterns and secrets-rotation-without-bot-downtime.live-streaming.saxobank.com / sim-streaming.saxobank.com), which is a different transport with its own subscription lifecycle — see websocket-reconnection-with-state-recovery.ExternalReference (see Pitfalls). Retry-safe submission is order-placement-idempotency.place_order validates payload shape, not exposure. Pre-trade limits, drawdown halts, and kill switches must sit out-of-band — see kill-switch-and-drawdown-circuit-breakers.access_token) and Account Key (account_key).is_simulation: True for gateway.saxobank.com/sim/openapi, False for live gateway.saxobank.com/openapi). Application key/secret are not shared between the two environments, and the Developer Portal's 24-hour token authorizes simulation only.http_fn(method, url, headers, body), returning (status_code, body) or (status_code, body, headers). Returning headers is what enables rate-limit back-off./ref/v1/instruments?Keywords={ticker}&AssetTypes={asset_type} to resolve ticker symbols to Saxo numeric UICs. The UIC is the Identifier field of each instrument summary.Symbol, ExchangeId and CurrencyCode on the chosen row before routing — never take Data[0] on trust when several rows return./trade/v2/orders specifying AccountKey, Uic, AssetType, BuySell, Amount, OrderType, OrderDuration, and ManualOrder.ManualOrder: false for algorithmically generated orders; Saxo documents this field as mandatory for almost all applications.OrderPrice for every OrderType except Market. Attach a random ExternalReference (≤ 50 chars) so an ambiguous submission can be reconciled later.OrderId and any related Orders, and carries no execution status. If OrderId is absent, the order state is UNKNOWN — reconcile, do not resubmit./port/v1/positions?AccountKey={account_key}&FieldGroups=PositionBase,PositionView,DisplayAndFormat.PositionId/NetPositionId from the row root, instrument fields from PositionBase, valuation from PositionView, and Symbol/Currency from DisplayAndFormat.PositionView.CalculationReliability before trusting any valuation, and aggregate portfolio P&L on ProfitLossOnTradeInBaseCurrency.Full procedure: see
references/workflows.md. Standards reference: seereferences/standards.md. Printable pre-flight checklist: seeassets/checklist.md.
"Equity" instead of Saxo's exact enum string "Stock" or "FxSpot".OptionRoot as an AssetType: OptionRoot is an instrument-search concept used to enumerate a contract option space; it is not in Saxo's tradable AssetType enum and will not route. Resolve the contract's own UIC and trade it as StockOption, FuturesOption, StockIndexOption, or FxVanillaOption.ExternalReference for uniqueness and will not reject a repeated one — it is a correlation tag, not an idempotency key. A blind retry places a second order. Query /port/v1/orders filtered on your ExternalReference first, and remember that an empty result does not prove non-placement: that endpoint returns working orders only, so an order that already filled has left it. Check positions before concluding anything.Symbol or PositionId out of PositionBase: PositionBase contains neither. PositionId and NetPositionId sit at the top level of each Data row, and Symbol is only returned inside DisplayAndFormat — which Saxo omits unless you request that FieldGroups value. Code that misses this silently produces blank position identifiers, breaking any close-by-PositionId logic.ProfitLossOnTrade across a multi-currency book: That figure is denominated in the instrument's own currency. Adding USD and JPY P&L produces a meaningless number. Aggregate ProfitLossOnTradeInBaseCurrency, which Saxo has already converted to the account's base currency.CalculationReliability: PositionView valuations carry a reliability marker. Sizing or de-risking off a valuation Saxo has not marked "Ok" propagates a stale or approximated price into risk decisions.Data array as the complete set: Saxo's collection endpoints are OData-paged ($top / $skip). A positions response whose __count exceeds the rows returned is a partial book — feeding it into an exposure or drawdown check silently understates risk. Page to exhaustion, or at minimum detect and refuse to act on a truncated result.X-RateLimit-<dimension>-{Limit,Remaining,Reset}, where Reset is seconds until that quota resets. Back off using the exhausted dimension's Reset. Note the order-submission bucket is far tighter than the general session bucket — a burst loop will trip it.SaxoBankOpenAPIClient. Search instrument "EURUSD" (FxSpot) $\implies$ verify UIC 21 returned. Place limit buy order $\implies$ verify OrderId returned and status is None (Saxo returns no status on placement). Query positions $\implies$ verify PositionId read from the row root, Symbol from DisplayAndFormat, and unrealized P&L parsed in both instrument and base currency.Market order without a price raises before any HTTP call, and that HTTP 401/429 raise SaxoAuthError/SaxoRateLimitError respectively.python -m unittest discover -s skills/saxo-bank-openapi-integration/scripts.broker-agnostic-adapter-interfacesandbox-credential-leakage-preventionorder-placement-idempotencymulti-broker-rate-limit-handlingmulti-currency-pnl-and-fx-conversionWhat SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
saxo-bank, openapi, multi-asset-trading, uic-resolution, order-routing
36 skills in this plugin
/alpaca-paper-live-key-separationUse when a bot connects to the Alpaca Trading API and must never cross paper keys with the live endpoint; pins the base URL per environment, checks the key prefix, probes /v2/account and requires an explicit ALLOW_LIVE_TRADING flag./api-key-least-privilege-audit-toolUse before deploying a live bot, to audit existing broker API keys for scopes they do not need. Flags withdrawal, transfer and admin rights that turn a leaked execution key into theft./broker-account-margin-call-handlingUse when a bot trades a Reg T, portfolio or futures margin account and must act before the broker liquidates: tiered maintenance-margin warnings cross-checked against broker excess liquidity, initial-margin order gating and liquidity-aware de-leveraging./broker-agnostic-adapter-interfaceUse when strategy code must run across several brokers and should not import kiteconnect, alpaca-py or ibapi directly; defines an adapter contract with Decimal prices, typed exceptions and normalised order status across venues./broker-api-changelog-diffing-toolUse before upgrading a broker SDK or OpenAPI spec, to diff two schema snapshots for removed endpoints, newly required parameters, enum mutations and type changes so CI fails before the change reaches an order path./broker-api-deprecation-notice-monitoringUse when a long-running bot calls REST endpoints a broker may retire; parses RFC 8594 Sunset and RFC 9745 Deprecation headers plus changelog feeds into one dated migration deadline with an escalation tier.npx claudepluginhub himanshuj16/algo-trading-skills --plugin algo-trading-broker-integrationOther plugins' skills for the same job