trader.errors module¶
Typed exceptions for the whole package.
Every failure the app raises deliberately derives from TraderError, so callers can distinguish our errors from third-party SDK noise.
- exception trader.errors.BacktestError[source]¶
Bases:
TraderErrorA backtest cannot produce a meaningful result from the inputs given.
- exception trader.errors.BrokerError[source]¶
Bases:
TraderErrorThe broker API call failed.
- exception trader.errors.ConfigError[source]¶
Bases:
TraderErrorConfiguration is missing or invalid.
- exception trader.errors.MarketDataError[source]¶
Bases:
TraderErrorThe market data provider call failed or returned nothing usable.
- exception trader.errors.MissingCredentialsError[source]¶
Bases:
ConfigErrorCredentials required for the selected trading mode are absent.
- exception trader.errors.NonRetryableMarketDataError[source]¶
Bases:
MarketDataErrorA MarketDataError caused by the content of what was returned, not a transient fetch failure – retrying reproduces the identical failure (issue #99: yfinance served the same malformed bar 17 minutes apart). resilience/retrying.py’s _NEVER_RETRIED skips the retry-with-backoff for exactly this reason: waiting does not fix these.
- exception trader.errors.OrderError[source]¶
Bases:
TraderErrorSubmitting, cancelling, or reading an order failed.
- exception trader.errors.PerformanceError[source]¶
Bases:
TraderErrorA return (account or benchmark) cannot be computed from the inputs given.
- exception trader.errors.ReplayError[source]¶
Bases:
TraderErrorA replay tried to use information from after the decision instant.
Raised, never warned: a point-in-time leak does not degrade a replay result, it manufactures one. Issue #7’s scoring rule calls this “the easiest thing to get wrong and the one that would silently invent skill”.
- exception trader.errors.RiskHaltError[source]¶
Bases:
TraderErrorA guardrail halted trading for the remainder of the day.
- exception trader.errors.TraderError[source]¶
Bases:
ExceptionBase class for all errors raised by this application.
- exception trader.errors.UnsafeConfigError[source]¶
Bases:
ConfigErrorConfiguration would risk real money. The app must fail closed.