Professionals
Opt-in modules for advisors, funds, and regulated desks: accounts, audit trail, secrets, calendars, live feeds.
The Professionals section covers modules you only need when running Horizon against client capital. If you are backtesting or trading your own account, skip this and use Quick Mode or the pipeline.
Everything here is opt-in. The core SDK does not require any of it, and existing Tier 1 to 3 code keeps working unchanged when these modules are added.
The gradient
Horizon is layered so you adopt only what you need:
Tier 1. Research and backtesting
import horizon as hz
from horizon.quant import BollingerMeanRev
result = (hz.pipe("AAPL", "MSFT")
.strategy(BollingerMeanRev(window=20))
.kelly(fraction=0.25)
.backtest(bars=252, cash=100_000))
Tier 2. Paper or imperative trading
ex = hz.connect("paper", initial_cash_usd=100_000)
ex.buy("AAPL", qty=10, limit=180.0)
Tier 3. Full pipeline, single portfolio
hz.run(mode="backtest", strategies=[MyStrat],
universe=["AAPL", "MSFT"])
Tier 4. Professional
from horizon.accounts import AccountRegistry, Account, InvestmentPolicyStatement
from horizon.audit import AuditLog, SQLiteSink
from horizon.secrets import EnvSecrets
from horizon.calendars import NYSECalendar
registry = AccountRegistry()
registry.add_account(Account(..., ips=InvestmentPolicyStatement(...)))
log = AuditLog(sink=SQLiteSink("audit.db"))
secrets = EnvSecrets()
calendar = NYSECalendar()
hz.run(mode="live", accounts=registry, audit_log=log,
secrets=secrets, calendar=calendar, ...)
What’s in this section
| Page | Topic |
|---|---|
| Roadmap | What’s shipped (L0/L1), what’s next, what’s out of scope. |
| Accounts and IPS | Household, Client, Account, Custodian. Investment Policy Statement per account. Per-account asset class allowlists. SMA vs. Fund vs. firm prop. |
| Order lifecycle | FIX-style order states, client_order_id idempotency, extended VenueOrder / VenueFill fields (NBBO, liquidity, exchange of execution), TIF enum, tax-lot election. |
| Audit trail | Hash-chained event log. SQLite WORM sink. Daily anchor hashes. Rule 204-2 / 17a-4 context. |
| Secrets | Secrets Protocol. How venues read credentials without touching os.environ. Backends: env var, dict (tests), vault adapters. |
| Market calendars | ExchangeCalendar Protocol. NYSE holidays and half-days. AlwaysOpen for crypto. ResolutionCalendar for prediction markets. |
| Live feeds | LiveFeed Protocol for real-time quotes with heartbeat, reconnect, and surfaced sequence gaps. Null feed for tests. |
| Alpaca adapter | Concrete REST and WebSocket venue. Paper and live. |
Do I need this?
- Trading your own money. No. Tier 1 to 3 is enough.
- Trading your own money, want better records. Read Audit trail. The immutable log is useful without regulatory pressure.
- Series 65 advisor, or running an RIA. Read every page. Plan the compliance program around this infrastructure.
- Running a 3(c)(1) or 3(c)(7) fund. Same as RIA, plus watch for the L2 fund NAV / units / subscriptions module on the roadmap.
- Building a multi-tenant SaaS around Horizon. This section does not cover tenant isolation, RBAC, or rate limiting. Contact the maintainers first.
What this is not
This SDK provides the technical substrate a compliance program needs: immutable records, pre-trade controls, auditable state. It is not a turnkey compliance program. Form ADV filings, the Business Continuity Plan, the Code of Ethics, the advisory agreement, and custodian relationships remain the firm’s and counsel’s responsibility. The SDK produces the records your rules reference.