Python SDK
Trading Bot Guardrails — Python SDK quick start
Install the SEIGYO Python SDK and add pre-trade discipline evaluation to trading bot guardrails in 5 lines of code.
Who this page is for
Developers and quant traders building automated trading bots who need pre-trade discipline enforcement.
Core problem
Bots execute faster than humans can intervene. Without a guardrail layer, a single logic bug or market anomaly can spiral into catastrophic loss before anyone notices.
Why this matters
Why this page exists
The page should answer the exact query before asking the user to convert.
pip install seigyo — zero dependencies, works with any Python trading bot or framework.
Dataclass models for trades, rules, and session state mean your IDE gives you autocomplete and type safety.
The SDK handles authentication, serialization, and error handling so you write application logic, not HTTP plumbing.
What to do first
Start with the smallest useful workflow
A specific first step keeps the page practical and reduces decision fatigue.
Run pip install seigyo and set the SEIGYO_API_KEY environment variable.
Import SeigyoClient, Trade, RuleDefinition, and SessionState.
Call client.evaluate() before every order and check result.verdict.
What to measure
Look for signals that change behavior
Useful review starts with a small number of repeatable measurements.
trades blocked per day, drawdown prevented, and time from violation to enforcement
Integration time from install to first successful evaluation
SDK error rate and retry behavior under load
How it helps
Where SEIGYO fits
Move from the query into a workflow users can try with demo data, CSV history, or a setup path.
The SDK returns typed EvaluateResponse objects with verdict, violations, discipline score, and budget remaining.
Works with Alpaca, IBKR, Tradovate, and any broker that gives you a Python order flow.
Session state tracking is your responsibility — the SDK stays stateless and predictable.