Skip to content

Python API index

Auto-generated alphabetical index of every public symbol exported by the FLOX Python binding (flox_py). Each entry shows the exact signature derived from the committed .pyi stubs.

For narrative-style "how to use this" docs, see the Engine & Backtest, Indicators, and other curated reference pages. This page is the flat appendix that AI agents grep when searching for a specific symbol.

Generated by scripts/gen_api_index.py from python/flox_py/_flox_py/__init__.pyi.

flox_py

Module: flox_py

Surface: 113 classes, 73 functions, 39 constants.

Constants

  • ALL_OR_NOTHING: OrderGroupPolicy = ...
  • BEST_EFFORT: OrderGroupPolicy = ...
  • Binance: AdlRanking = ...
  • BookAnchored: MarkImpactModel = ...
  • BookOnly: MarkImpactModel = ...
  • Bybit: AdlRanking = ...
  • CANCELLED: OrderGroupState = ...
  • Cross: MarginMode = ...
  • FAILED: OrderGroupState = ...
  • FILLED: OrderGroupState = ...
  • FIRE_ON_ANY: FeedClockPolicy = ...
  • Isolated: MarginMode = ...
  • LEADER_FOLLOWER: FeedClockPolicy = ...
  • None_: MarkImpactModel = ...
  • ONE_SIDED: OrderGroupPolicy = ...
  • ORDER_FLAG_IOC: int = 4
  • ORDER_FLAG_POST_ONLY: int = 1
  • ORDER_FLAG_REDUCE_ONLY: int = 2
  • PARTIALLY_FILLED: OrderGroupState = ...
  • PENDING: OrderGroupState = ...
  • PRICE_SCALE: int = 100000000
  • PnlRatio: AdlRanking = ...
  • PositionSize: AdlRanking = ...
  • QUANTITY_SCALE: int = 100000000
  • QUEUE_FULL: int = 2
  • QUEUE_NONE: int = 0
  • QUEUE_TOB: int = 1
  • REVERTING: OrderGroupState = ...
  • SIGNAL_FLAG_ENTER: int = 1
  • SIGNAL_FLAG_EXIT: int = 2
  • SIGNAL_FLAG_REBALANCE: int = 4
  • SLIPPAGE_FIXED_BPS: int = 2
  • SLIPPAGE_FIXED_TICKS: int = 1
  • SLIPPAGE_NONE: int = 0
  • SLIPPAGE_VOLUME_IMPACT: int = 3
  • SUBMITTED: OrderGroupState = ...
  • StreamingIndicatorGraph = IndicatorGraph
  • VOLUME_SCALE: int = 100000000
  • WAIT_FOR_ALL: FeedClockPolicy = ...

Functions

  • adf(input: typing.Annotated[numpy.typing.ArrayLike, numpy.float64], max_lag: typing.SupportsInt | typing.SupportsIndex = 4, regression: str = 'c') -> dict
  • adx(high: typing.Annotated[numpy.typing.ArrayLike, numpy.float64], low: typing.Annotated[numpy.typing.ArrayLike, numpy.float64], close: typing.Annotated[numpy.typing.ArrayLike, numpy.float64], period: typing.SupportsInt | typing.SupportsIndex = 14) -> dict
  • aggregate_heikin_ashi_bars(timestamps: typing.Annotated[numpy.typing.ArrayLike, numpy.int64], prices: typing.Annotated[numpy.typing.ArrayLike, numpy.float64], quantities: typing.Annotated[numpy.typing.ArrayLike, numpy.float64], is_buy: typing.Annotated[numpy.typing.ArrayLike, numpy.uint8], interval_seconds: typing.SupportsFloat | typing.SupportsIndex) -> numpy.ndarray[typing.Any, numpy.dtype[numpy.void]] — Aggregate trades into Heikin-Ashi bars
  • aggregate_range_bars(timestamps: typing.Annotated[numpy.typing.ArrayLike, numpy.int64], prices: typing.Annotated[numpy.typing.ArrayLike, numpy.float64], quantities: typing.Annotated[numpy.typing.ArrayLike, numpy.float64], is_buy: typing.Annotated[numpy.typing.ArrayLike, numpy.uint8], range_size: typing.SupportsFloat | typing.SupportsIndex) -> numpy.ndarray[typing.Any, numpy.dtype[numpy.void]] — Aggregate trades into range bars
  • aggregate_renko_bars(timestamps: typing.Annotated[numpy.typing.ArrayLike, numpy.int64], prices: typing.Annotated[numpy.typing.ArrayLike, numpy.float64], quantities: typing.Annotated[numpy.typing.ArrayLike, numpy.float64], is_buy: typing.Annotated[numpy.typing.ArrayLike, numpy.uint8], brick_size: typing.SupportsFloat | typing.SupportsIndex) -> numpy.ndarray[typing.Any, numpy.dtype[numpy.void]] — Aggregate trades into renko bars
  • aggregate_tick_bars(timestamps: typing.Annotated[numpy.typing.ArrayLike, numpy.int64], prices: typing.Annotated[numpy.typing.ArrayLike, numpy.float64], quantities: typing.Annotated[numpy.typing.ArrayLike, numpy.float64], is_buy: typing.Annotated[numpy.typing.ArrayLike, numpy.uint8], tick_count: typing.SupportsInt | typing.SupportsIndex) -> numpy.ndarray[typing.Any, numpy.dtype[numpy.void]] — Aggregate trades into tick bars
  • aggregate_time_bars(timestamps: typing.Annotated[numpy.typing.ArrayLike, numpy.int64], prices: typing.Annotated[numpy.typing.ArrayLike, numpy.float64], quantities: typing.Annotated[numpy.typing.ArrayLike, numpy.float64], is_buy: typing.Annotated[numpy.typing.ArrayLike, numpy.uint8], interval_seconds: typing.SupportsFloat | typing.SupportsIndex) -> numpy.ndarray[typing.Any, numpy.dtype[numpy.void]] — Aggregate trades into time bars
  • aggregate_volume_bars(timestamps: typing.Annotated[numpy.typing.ArrayLike, numpy.int64], prices: typing.Annotated[numpy.typing.ArrayLike, numpy.float64], quantities: typing.Annotated[numpy.typing.ArrayLike, numpy.float64], is_buy: typing.Annotated[numpy.typing.ArrayLike, numpy.uint8], volume_threshold: typing.SupportsFloat | typing.SupportsIndex) -> numpy.ndarray[typing.Any, numpy.dtype[numpy.void]] — Aggregate trades into volume bars
  • atr(high: typing.Annotated[numpy.typing.ArrayLike, numpy.float64], low: typing.Annotated[numpy.typing.ArrayLike, numpy.float64], close: typing.Annotated[numpy.typing.ArrayLike, numpy.float64], period: typing.SupportsInt | typing.SupportsIndex) -> numpy.typing.NDArray[numpy.float64]
  • autocorrelation(input: typing.Annotated[numpy.typing.ArrayLike, numpy.float64], window: typing.SupportsInt | typing.SupportsIndex, lag: typing.SupportsInt | typing.SupportsIndex) -> numpy.typing.NDArray[numpy.float64]
  • bar_returns(signal_long: typing.Annotated[numpy.typing.ArrayLike, numpy.int8], signal_short: typing.Annotated[numpy.typing.ArrayLike, numpy.int8], log_returns: typing.Annotated[numpy.typing.ArrayLike, numpy.float64]) -> numpy.typing.NDArray[numpy.float64]
  • baw_price(option_type: OptionType, spot: typing.SupportsFloat | typing.SupportsIndex, strike: typing.SupportsFloat | typing.SupportsIndex, t: typing.SupportsFloat | typing.SupportsIndex, vol: typing.SupportsFloat | typing.SupportsIndex, rate: typing.SupportsFloat | typing.SupportsIndex = 0.0, carry: typing.SupportsFloat | typing.SupportsIndex = 0.0) -> float — Barone-Adesi-Whaley American price: European value plus a closed-form early-exercise premium. Cheaper than a fine tree, so preferred for greeks via finite differences. An American call with carry>=rate collapses to the European price.
  • binomial_price(option_type: OptionType, spot: typing.SupportsFloat | typing.SupportsIndex, strike: typing.SupportsFloat | typing.SupportsIndex, t: typing.SupportsFloat | typing.SupportsIndex, vol: typing.SupportsFloat | typing.SupportsIndex, rate: typing.SupportsFloat | typing.SupportsIndex = 0.0, carry: typing.SupportsFloat | typing.SupportsIndex = 0.0, steps: typing.SupportsInt | typing.SupportsIndex = 200, american: bool = True) -> float — Cox-Ross-Rubinstein binomial price. american=True checks early exercise at every node (American premium); american=False is a European lattice that converges to bs_price as steps grows.
  • bollinger(input: typing.Annotated[numpy.typing.ArrayLike, numpy.float64], period: typing.SupportsInt | typing.SupportsIndex = 20, stddev: typing.SupportsFloat | typing.SupportsIndex = 2.0) -> dict
  • bootstrap_ci(data: typing.Annotated[numpy.typing.ArrayLike, numpy.float64], confidence: typing.SupportsFloat | typing.SupportsIndex = 0.95, num_samples: typing.SupportsInt | typing.SupportsIndex = 10000) -> tuple[float, float, float] — Bootstrap confidence interval, returns (lower, median, upper)
  • bs_price(option_type: OptionType, spot: typing.SupportsFloat | typing.SupportsIndex, strike: typing.SupportsFloat | typing.SupportsIndex, t: typing.SupportsFloat | typing.SupportsIndex, vol: typing.SupportsFloat | typing.SupportsIndex, rate: typing.SupportsFloat | typing.SupportsIndex = 0.0, carry: typing.SupportsFloat | typing.SupportsIndex = 0.0) -> float — Generalized Black-Scholes-Merton price. t in years; rate=discount r; carry=cost-of-carry b (0 for crypto/Black-76). Returns discounted intrinsic for expired or zero-vol inputs.
  • bs_price_discrete_dividends(option_type: OptionType, spot: typing.SupportsFloat | typing.SupportsIndex, strike: typing.SupportsFloat | typing.SupportsIndex, t: typing.SupportsFloat | typing.SupportsIndex, vol: typing.SupportsFloat | typing.SupportsIndex, rate: typing.SupportsFloat | typing.SupportsIndex, dividends: collections.abc.Sequence[tuple[typing.SupportsFloat | typing.SupportsIndex, typing.SupportsFloat | typing.SupportsIndex]]) -> float — European price on a stock paying discrete cash dividends (escrowed model). dividends is a list of (t_years, amount) paid before expiry; their present value is subtracted from spot. A dividend lowers a call and lifts a put.
  • bs_vega(spot: typing.SupportsFloat | typing.SupportsIndex, strike: typing.SupportsFloat | typing.SupportsIndex, t: typing.SupportsFloat | typing.SupportsIndex, vol: typing.SupportsFloat | typing.SupportsIndex, rate: typing.SupportsFloat | typing.SupportsIndex = 0.0, carry: typing.SupportsFloat | typing.SupportsIndex = 0.0) -> float — Black-Scholes vega (call/put identical).
  • build_surface_as_of(quotes: collections.abc.Sequence[tuple[typing.SupportsInt | typing.SupportsIndex, typing.SupportsFloat | typing.SupportsIndex, typing.SupportsFloat | typing.SupportsIndex, typing.SupportsFloat | typing.SupportsIndex]], asof_ns: typing.SupportsInt | typing.SupportsIndex) -> VolSurface — Build a point-in-time VolSurface from (ts_ns, t, log_moneyness, iv) quotes, using ONLY those stamped on or before asof_ns — the no-lookahead guarantee for honest backtests. Expiries with < 5 quotes are skipped.
  • calibrate_svi(log_moneyness: collections.abc.Sequence[typing.SupportsFloat | typing.SupportsIndex], total_variance: collections.abc.Sequence[typing.SupportsFloat | typing.SupportsIndex]) -> dict — Calibrate a raw-SVI slice to observed (log-moneyness, total-variance) points by least squares. Needs >= 5 points. Returns dict(a, b, rho, m, sigma). Total variance is iv**2 * t.
  • cci(high: typing.Annotated[numpy.typing.ArrayLike, numpy.float64], low: typing.Annotated[numpy.typing.ArrayLike, numpy.float64], close: typing.Annotated[numpy.typing.ArrayLike, numpy.float64], period: typing.SupportsInt | typing.SupportsIndex = 20) -> numpy.typing.NDArray[numpy.float64]
  • chop(high: typing.Annotated[numpy.typing.ArrayLike, numpy.float64], low: typing.Annotated[numpy.typing.ArrayLike, numpy.float64], close: typing.Annotated[numpy.typing.ArrayLike, numpy.float64], period: typing.SupportsInt | typing.SupportsIndex = 14) -> numpy.typing.NDArray[numpy.float64]
  • correlation(x: typing.Annotated[numpy.typing.ArrayLike, numpy.float64], y: typing.Annotated[numpy.typing.ArrayLike, numpy.float64]) -> float — Pearson correlation coefficient
  • cost_of_carry(rate: typing.SupportsFloat | typing.SupportsIndex, dividend_yield: typing.SupportsFloat | typing.SupportsIndex = 0.0, borrow_rate: typing.SupportsFloat | typing.SupportsIndex = 0.0) -> float — Cost-of-carry b = rate - dividend_yield - borrow_rate. Crypto/Black-76 pass all zero; equity nets the financing pieces; FX passes the foreign rate as dividend_yield.
  • cvd(open: typing.Annotated[numpy.typing.ArrayLike, numpy.float64], high: typing.Annotated[numpy.typing.ArrayLike, numpy.float64], low: typing.Annotated[numpy.typing.ArrayLike, numpy.float64], close: typing.Annotated[numpy.typing.ArrayLike, numpy.float64], volume: typing.Annotated[numpy.typing.ArrayLike, numpy.float64]) -> numpy.typing.NDArray[numpy.float64]
  • dema(input: typing.Annotated[numpy.typing.ArrayLike, numpy.float64], period: typing.SupportsInt | typing.SupportsIndex) -> numpy.typing.NDArray[numpy.float64]
  • ema(input: typing.Annotated[numpy.typing.ArrayLike, numpy.float64], period: typing.SupportsInt | typing.SupportsIndex) -> numpy.typing.NDArray[numpy.float64]
  • export_data(input_path: str, output_path: str, format: str = 'csv', from_ns: typing.Any = None, to_ns: typing.Any = None, symbols: typing.Any = None) -> dict
  • extract_symbols(input_path: str, output_path: str, symbols: collections.abc.Sequence[typing.SupportsInt | typing.SupportsIndex]) -> int
  • extract_time_range(input_path: str, output_path: str, from_ns: typing.SupportsInt | typing.SupportsIndex, to_ns: typing.SupportsInt | typing.SupportsIndex) -> int
  • forward_price(spot: typing.SupportsFloat | typing.SupportsIndex, t: typing.SupportsFloat | typing.SupportsIndex, carry: typing.SupportsFloat | typing.SupportsIndex) -> float — Forward price spot * exp(carry * t).
  • greeks(option_type: OptionType, spot: typing.SupportsFloat | typing.SupportsIndex, strike: typing.SupportsFloat | typing.SupportsIndex, t: typing.SupportsFloat | typing.SupportsIndex, vol: typing.SupportsFloat | typing.SupportsIndex, rate: typing.SupportsFloat | typing.SupportsIndex = 0.0, carry: typing.SupportsFloat | typing.SupportsIndex = 0.0) -> dict — First-order greeks dict(delta, gamma, vega, theta, rho). theta is per year (divide by 365 for per-day); rho is the b-fixed partial dV/dr. carry=b (0 for crypto).
  • hurst_dfa(returns: typing.Annotated[numpy.typing.ArrayLike, numpy.float64], scales: typing.Any = None) -> float — Hurst exponent via Detrended Fluctuation Analysis on a series of returns (NOT prices). H ≈ 0.5 random, H > 0.5 persistent / trending, H < 0.5 anti-persistent / mean-reverting. If scales is None, uses a log-spaced default grid from 4 to N/4. Returns NaN if input is too short (< 32) or degenerate.
  • implied_percentile_in_cone(realized_samples: collections.abc.Sequence[typing.SupportsFloat | typing.SupportsIndex], implied_vol: typing.SupportsFloat | typing.SupportsIndex) -> float — Fraction of realized-vol samples at or below implied_vol (0..1). High = options rich vs realized history; low = cheap. NaN on empty samples.
  • implied_vol(option_type: OptionType, price: typing.SupportsFloat | typing.SupportsIndex, spot: typing.SupportsFloat | typing.SupportsIndex, strike: typing.SupportsFloat | typing.SupportsIndex, t: typing.SupportsFloat | typing.SupportsIndex, rate: typing.SupportsFloat | typing.SupportsIndex = 0.0, carry: typing.SupportsFloat | typing.SupportsIndex = 0.0) -> dict — Implied volatility from an option price via Newton-Raphson with bracketed bisection fallback. Returns dict(vol, converged, iterations); vol is NaN and converged False when the price violates no-arbitrage bounds.
  • inspect(data_dir: str) -> dict — Inspect a data directory and return summary statistics
  • kama(input: typing.Annotated[numpy.typing.ArrayLike, numpy.float64], period: typing.SupportsInt | typing.SupportsIndex = 10) -> numpy.typing.NDArray[numpy.float64]
  • kurtosis(input: typing.Annotated[numpy.typing.ArrayLike, numpy.float64], period: typing.SupportsInt | typing.SupportsIndex) -> numpy.typing.NDArray[numpy.float64]
  • list_indicators() -> list — Return the list of indicator names registered in this build (both batch compute() and streaming update()/value on each).
  • macd(input: typing.Annotated[numpy.typing.ArrayLike, numpy.float64], fast: typing.SupportsInt | typing.SupportsIndex = 12, slow: typing.SupportsInt | typing.SupportsIndex = 26, signal: typing.SupportsInt | typing.SupportsIndex = 9) -> dict
  • merge(input_paths: collections.abc.Sequence[str], output_dir: str, output_name: str = 'merged', compression: str = 'none', sort: bool = True) -> dict
  • merge_dir(input_dir: str, output_dir: str) -> dict
  • obv(close: typing.Annotated[numpy.typing.ArrayLike, numpy.float64], volume: typing.Annotated[numpy.typing.ArrayLike, numpy.float64]) -> numpy.typing.NDArray[numpy.float64]
  • parkinson_vol(high: typing.Annotated[numpy.typing.ArrayLike, numpy.float64], low: typing.Annotated[numpy.typing.ArrayLike, numpy.float64], period: typing.SupportsInt | typing.SupportsIndex) -> numpy.typing.NDArray[numpy.float64]
  • permutation_test(group1: typing.Annotated[numpy.typing.ArrayLike, numpy.float64], group2: typing.Annotated[numpy.typing.ArrayLike, numpy.float64], num_permutations: typing.SupportsInt | typing.SupportsIndex = 10000) -> float — Two-sample permutation test, returns p-value
  • prices_to_double(raw: typing.Annotated[numpy.typing.ArrayLike, numpy.int64]) -> numpy.typing.NDArray[numpy.float64] — Convert raw int64 price array to float64 array (divides by PRICE_SCALE).
  • profit_factor(returns: typing.Annotated[numpy.typing.ArrayLike, numpy.float64]) -> float
  • quantities_to_double(raw: typing.Annotated[numpy.typing.ArrayLike, numpy.int64]) -> numpy.typing.NDArray[numpy.float64] — Convert raw int64 quantity array to float64 array (divides by QUANTITY_SCALE).
  • realized_vol(returns: collections.abc.Sequence[typing.SupportsFloat | typing.SupportsIndex], periods_per_year: typing.SupportsFloat | typing.SupportsIndex) -> float — Annualized realized vol from log returns: sample stdev * sqrt(periods_per_year).
  • recompress(input_path: str, output_path: str, compression: str = 'lz4') -> bool
  • rma(input: typing.Annotated[numpy.typing.ArrayLike, numpy.float64], period: typing.SupportsInt | typing.SupportsIndex) -> numpy.typing.NDArray[numpy.float64]
  • rogers_satchell_vol(open: typing.Annotated[numpy.typing.ArrayLike, numpy.float64], high: typing.Annotated[numpy.typing.ArrayLike, numpy.float64], low: typing.Annotated[numpy.typing.ArrayLike, numpy.float64], close: typing.Annotated[numpy.typing.ArrayLike, numpy.float64], period: typing.SupportsInt | typing.SupportsIndex) -> numpy.typing.NDArray[numpy.float64]
  • rolling_correlation(x: typing.Annotated[numpy.typing.ArrayLike, numpy.float64], y: typing.Annotated[numpy.typing.ArrayLike, numpy.float64], period: typing.SupportsInt | typing.SupportsIndex) -> numpy.typing.NDArray[numpy.float64]
  • rolling_hurst(prices: typing.Annotated[numpy.typing.ArrayLike, numpy.float64], window: typing.SupportsInt | typing.SupportsIndex = 1080) -> numpy.typing.NDArray[numpy.float64] — Rolling DFA-Hurst on price levels. For each bar i, computes Hurst of log-returns over the previous window returns. Output[i] = NaN for i ≤ window (insufficient history). Output length matches input.
  • rolling_zscore(input: typing.Annotated[numpy.typing.ArrayLike, numpy.float64], period: typing.SupportsInt | typing.SupportsIndex) -> numpy.typing.NDArray[numpy.float64]
  • rsi(input: typing.Annotated[numpy.typing.ArrayLike, numpy.float64], period: typing.SupportsInt | typing.SupportsIndex) -> numpy.typing.NDArray[numpy.float64]
  • second_order_greeks(option_type: OptionType, spot: typing.SupportsFloat | typing.SupportsIndex, strike: typing.SupportsFloat | typing.SupportsIndex, t: typing.SupportsFloat | typing.SupportsIndex, vol: typing.SupportsFloat | typing.SupportsIndex, rate: typing.SupportsFloat | typing.SupportsIndex = 0.0, carry: typing.SupportsFloat | typing.SupportsIndex = 0.0) -> dict — Second-order greeks dict(vanna, volga, charm) for vol traders. vanna = d(delta)/d(vol), volga = d(vega)/d(vol), charm = d(delta)/d(time) per year.
  • set_log_callback(callback: typing.Any) -> None — Install a Python callable as the global log sink. Pass None to detach. Callable receives (level: int, msg: str); level: 0=info, 1=warn, 2=error.
  • shannon_entropy(input: typing.Annotated[numpy.typing.ArrayLike, numpy.float64], period: typing.SupportsInt | typing.SupportsIndex, bins: typing.SupportsInt | typing.SupportsIndex = 10) -> numpy.typing.NDArray[numpy.float64]
  • skewness(input: typing.Annotated[numpy.typing.ArrayLike, numpy.float64], period: typing.SupportsInt | typing.SupportsIndex) -> numpy.typing.NDArray[numpy.float64]
  • slope(input: typing.Annotated[numpy.typing.ArrayLike, numpy.float64], length: typing.SupportsInt | typing.SupportsIndex = 1) -> numpy.typing.NDArray[numpy.float64]
  • sma(input: typing.Annotated[numpy.typing.ArrayLike, numpy.float64], period: typing.SupportsInt | typing.SupportsIndex) -> numpy.typing.NDArray[numpy.float64]
  • split(input_path: str, output_dir: str, mode: str = 'time', time_interval_ns: typing.SupportsInt | typing.SupportsIndex = 3600000000000, events_per_file: typing.SupportsInt | typing.SupportsIndex = 1000000) -> dict
  • stochastic(high: typing.Annotated[numpy.typing.ArrayLike, numpy.float64], low: typing.Annotated[numpy.typing.ArrayLike, numpy.float64], close: typing.Annotated[numpy.typing.ArrayLike, numpy.float64], k_period: typing.SupportsInt | typing.SupportsIndex = 14, d_period: typing.SupportsInt | typing.SupportsIndex = 3) -> dict
  • tema(input: typing.Annotated[numpy.typing.ArrayLike, numpy.float64], period: typing.SupportsInt | typing.SupportsIndex) -> numpy.typing.NDArray[numpy.float64]
  • trade_pnl(signal_long: typing.Annotated[numpy.typing.ArrayLike, numpy.int8], signal_short: typing.Annotated[numpy.typing.ArrayLike, numpy.int8], log_returns: typing.Annotated[numpy.typing.ArrayLike, numpy.float64]) -> numpy.typing.NDArray[numpy.float64]
  • validate(segment_path: str, verify_crc: bool = True, verify_timestamps: bool = True) -> dict
  • validate_dataset(data_dir: str) -> dict
  • vol_cone(prices: collections.abc.Sequence[typing.SupportsFloat | typing.SupportsIndex], horizons: collections.abc.Sequence[typing.SupportsInt | typing.SupportsIndex], periods_per_year: typing.SupportsFloat | typing.SupportsIndex) -> list — Realized-vol cone from a price series: for each horizon (in return periods) slide a window, annualize realized vol, and report a dict(horizon, min, p25, p50, p75, max, samples). periods_per_year is 252 (equity) or 365 (crypto).
  • volumes_to_double(raw: typing.Annotated[numpy.typing.ArrayLike, numpy.int64]) -> numpy.typing.NDArray[numpy.float64] — Convert raw int64 volume array to float64 array (divides by VOLUME_SCALE).
  • vwap(close: typing.Annotated[numpy.typing.ArrayLike, numpy.float64], volume: typing.Annotated[numpy.typing.ArrayLike, numpy.float64], window: typing.SupportsInt | typing.SupportsIndex = 96) -> numpy.typing.NDArray[numpy.float64]
  • whites_reality_check(returns: typing.Annotated[numpy.typing.ArrayLike, numpy.float64], num_bootstrap: typing.SupportsInt | typing.SupportsIndex = 10000, avg_block_size: typing.SupportsFloat | typing.SupportsIndex = 0.0, seed: typing.SupportsInt | typing.SupportsIndex = 42) -> dict — White's reality check (Stationary Bootstrap). Tests whether the
  • win_rate(trade_pnls: typing.Annotated[numpy.typing.ArrayLike, numpy.float64]) -> float

Classes

class ATR

Constructor

  • ATR(period: typing.SupportsInt | typing.SupportsIndex) -> None

Members

  • compute(self, arg0: typing.Annotated[numpy.typing.ArrayLike, numpy.float64], arg1: typing.Annotated[numpy.typing.ArrayLike, numpy.float64], arg2: typing.Annotated[numpy.typing.ArrayLike, numpy.float64]) -> numpy.typing.NDArray[numpy.float64]
  • reset(self) -> None
  • update(self, high: typing.SupportsFloat | typing.SupportsIndex, low: typing.SupportsFloat | typing.SupportsIndex, close: typing.SupportsFloat | typing.SupportsIndex) -> float | None
  • property count: int
  • property ready: bool
  • property value: float | None

class Account

Constructor

  • Account(account_id: typing.SupportsInt | typing.SupportsIndex = 0, equity: typing.SupportsFloat | typing.SupportsIndex = 0.0) -> None

Members

  • account_id(self) -> int
  • add_equity(self, delta: typing.SupportsFloat | typing.SupportsIndex) -> None
  • close_position(self, symbol: typing.SupportsInt | typing.SupportsIndex) -> None
  • cross_headroom(self, tier_fraction: typing.SupportsFloat | typing.SupportsIndex) -> float
  • equity(self) -> float
  • has_stale_marks(self, now_ns: typing.SupportsInt | typing.SupportsIndex, budget_ns: typing.SupportsInt | typing.SupportsIndex) -> bool
  • margin_mode(self) -> MarginMode
  • margin_notional(self) -> float
  • margin_unrealised_pnl(self) -> float
  • mark_for(self, symbol: typing.SupportsInt | typing.SupportsIndex) -> float
  • mark_ts_for(self, symbol: typing.SupportsInt | typing.SupportsIndex) -> int
  • open_position(self, symbol: typing.SupportsInt | typing.SupportsIndex, quantity: typing.SupportsFloat | typing.SupportsIndex, entry_price: typing.SupportsFloat | typing.SupportsIndex, isolated_equity: typing.SupportsFloat | typing.SupportsIndex = 0.0, contract_multiplier: typing.SupportsFloat | typing.SupportsIndex = 1.0, is_long_option: bool = False) -> None
  • position_count(self) -> int
  • record_fill(self, ts_ns: typing.SupportsInt | typing.SupportsIndex, notional: typing.SupportsFloat | typing.SupportsIndex, symbol: typing.SupportsInt | typing.SupportsIndex = 0) -> None
  • reset_rolling(self) -> None
  • rolling_notional_30d(self) -> float
  • rolling_notional_by_symbol_30d(self) -> list[tuple[int, float]]
  • set_equity(self, equity: typing.SupportsFloat | typing.SupportsIndex) -> None
  • set_margin_mode(self, mode: typing.Any) -> None
  • set_mark(self, symbol: typing.SupportsInt | typing.SupportsIndex, price: typing.SupportsFloat | typing.SupportsIndex, ts_ns: typing.SupportsInt | typing.SupportsIndex = 0) -> None
  • total_notional(self) -> float
  • total_unrealised_pnl(self) -> float

class AdlRanking

Members:

Constructor

  • AdlRanking(value: typing.SupportsInt | typing.SupportsIndex) -> None

Members

  • attr Binance: typing.ClassVar[AdlRanking]
  • attr Bybit: typing.ClassVar[AdlRanking]
  • attr PnlRatio: typing.ClassVar[AdlRanking]
  • attr PositionSize: typing.ClassVar[AdlRanking]
  • attr __members__: typing.ClassVar[dict[str, AdlRanking]]
  • property name: str
  • property value: int

class AggregatorEventFilter

Which event kinds an aggregator counts. Trades = TradeRecord only, BooksOnly = BookSnapshot + BookDelta only, Both = every event.

Constructor

  • AggregatorEventFilter(value: typing.SupportsInt | typing.SupportsIndex) -> None

Members

  • attr BooksOnly: typing.ClassVar[AggregatorEventFilter]
  • attr Both: typing.ClassVar[AggregatorEventFilter]
  • attr Trades: typing.ClassVar[AggregatorEventFilter]
  • attr __members__: typing.ClassVar[dict[str, AggregatorEventFilter]]
  • property name: str
  • property value: int

class AutoCorrelation

Constructor

  • AutoCorrelation(window: typing.SupportsInt | typing.SupportsIndex, lag: typing.SupportsInt | typing.SupportsIndex) -> None

Members

  • compute(self, arg0: typing.Annotated[numpy.typing.ArrayLike, numpy.float64]) -> numpy.typing.NDArray[numpy.float64]
  • reset(self) -> None
  • update(self, value: typing.SupportsFloat | typing.SupportsIndex) -> float | None
  • property count: int
  • property ready: bool
  • property value: float | None

class BacktestResult

Constructor

  • BacktestResult(initial_capital: typing.SupportsFloat | typing.SupportsIndex = 100000.0, fee_rate: typing.SupportsFloat | typing.SupportsIndex = 0.0001, use_percentage_fee: bool = True, fixed_fee_per_trade: typing.SupportsFloat | typing.SupportsIndex = 0.0, risk_free_rate: typing.SupportsFloat | typing.SupportsIndex = 0.0, annualization_factor: typing.SupportsFloat | typing.SupportsIndex = 252.0) -> None

Members

  • equity_curve(self) -> numpy.ndarray[typing.Any, numpy.dtype[numpy.void]]
  • ingest_executor(self, executor: SimulatedExecutor) -> None
  • record_fill(self, order_id: typing.SupportsInt | typing.SupportsIndex, symbol: typing.SupportsInt | typing.SupportsIndex, side: str, price: typing.SupportsFloat | typing.SupportsIndex, quantity: typing.SupportsFloat | typing.SupportsIndex, timestamp_ns: typing.SupportsInt | typing.SupportsIndex) -> None
  • stats(self) -> dict
  • trades(self) -> numpy.ndarray[typing.Any, numpy.dtype[numpy.void]]
  • write_equity_curve_csv(self, path: str) -> bool

class BacktestRunner

Constructor

  • BacktestRunner(registry: SymbolRegistry, fee_rate: typing.SupportsFloat | typing.SupportsIndex = 0.0004, initial_capital: typing.SupportsFloat | typing.SupportsIndex = 100000.0) -> None

Members

  • add_execution_listener(self, listener: ExecutionListener) -> None
  • equity_curve(self) -> typing.Any
  • run_bars(self, start_time_ns: typing.Annotated[numpy.typing.ArrayLike, numpy.int64], end_time_ns: typing.Annotated[numpy.typing.ArrayLike, numpy.int64], open: typing.Annotated[numpy.typing.ArrayLike, numpy.float64], high: typing.Annotated[numpy.typing.ArrayLike, numpy.float64], low: typing.Annotated[numpy.typing.ArrayLike, numpy.float64], close: typing.Annotated[numpy.typing.ArrayLike, numpy.float64], volume: typing.Annotated[numpy.typing.ArrayLike, numpy.float64], symbol: str = '', bar_type: typing.SupportsInt | typing.SupportsIndex = 0, bar_type_param: typing.SupportsInt | typing.SupportsIndex = 0) -> typing.Any
  • run_csv(self, path: str, symbol: str = '') -> typing.Any
  • run_ohlcv(self, ts: typing.Annotated[numpy.typing.ArrayLike, numpy.int64], close: typing.Annotated[numpy.typing.ArrayLike, numpy.float64], symbol: str = '') -> typing.Any
  • run_tape(self, path: str) -> typing.Any
  • run_tapes(self, paths: collections.abc.Sequence[str]) -> typing.Any
  • set_executor(self, executor: Executor) -> None
  • set_kill_switch(self, ks: KillSwitch) -> None
  • set_order_validator(self, ov: OrderValidator) -> None
  • set_pnl_tracker(self, tracker: PnLTracker) -> None
  • set_risk_manager(self, rm: RiskManager) -> None
  • set_strategy(self, strategy: Strategy) -> None
  • trades(self) -> typing.Any

class BarData

Constructor

  • BarData() -> None

Members

  • attr symbol_name: str
  • property bar_type: int
  • property bar_type: None
  • property bar_type_param: int
  • property bar_type_param: None
  • property buy_volume: float
  • property buy_volume: None
  • property close: float
  • property close: None
  • property close_reason: int
  • property close_reason: None
  • property end_time_ns: int
  • property end_time_ns: None
  • property high: float
  • property high: None
  • property low: float
  • property low: None
  • property open: float
  • property open: None
  • property start_time_ns: int
  • property start_time_ns: None
  • property symbol: int
  • property symbol: None
  • property volume: float
  • property volume: None

class BarDispatchRecorder

Constructor

  • BarDispatchRecorder() -> None

Members

  • add_time_interval_seconds(self, seconds: typing.SupportsInt | typing.SupportsIndex) -> int
  • count(self) -> int
  • finalize(self) -> None
  • on_trade(self, symbol: typing.SupportsInt | typing.SupportsIndex, price: typing.SupportsFloat | typing.SupportsIndex, qty: typing.SupportsFloat | typing.SupportsIndex, ts_ns: typing.SupportsInt | typing.SupportsIndex) -> None
  • param_at(self, index: typing.SupportsInt | typing.SupportsIndex) -> int
  • type_at(self, index: typing.SupportsInt | typing.SupportsIndex) -> int

class BinCountAggregator(_AggregatorHandle)

Time-bucketed event count. Each event floors to its bucket (floor(exchange_ts_ns / bucket_ns) * bucket_ns) and increments the (bucket, optional symbol, optional side) cell. Result is a flat structured numpy array of (bucket, symbol_id, side, count) rows.

Constructor

  • BinCountAggregator(bucket_ns: typing.SupportsInt | typing.SupportsIndex, by_side: bool = False, by_symbol: bool = False, event_filter: AggregatorEventFilter = ..., symbol_filter: collections.abc.Sequence[typing.SupportsInt | typing.SupportsIndex] = []) -> None

Members

  • result(self) -> numpy.ndarray[typing.Any, numpy.dtype[numpy.void]]

class BinaryLogRecorderHook

Constructor

  • BinaryLogRecorderHook(output_dir: str, max_segment_mb: typing.SupportsInt | typing.SupportsIndex = 256, exchange_id: typing.SupportsInt | typing.SupportsIndex = 0, compression: str = 'none', exchange_name: str = '', instrument_type: str = '') -> None

Members

  • add_symbol(self, symbol_id: typing.SupportsInt | typing.SupportsIndex, name: str, base: str = '', quote: str = '', price_precision: typing.SupportsInt | typing.SupportsIndex = 8, qty_precision: typing.SupportsInt | typing.SupportsIndex = 8) -> None
  • close(self) -> None
  • current_segment_path(self) -> str
  • flush(self) -> None
  • stats(self) -> dict

class Bollinger

Constructor

  • Bollinger(period: typing.SupportsInt | typing.SupportsIndex = 20, multiplier: typing.SupportsFloat | typing.SupportsIndex = 2.0) -> None

Members

  • compute(self, arg0: typing.Annotated[numpy.typing.ArrayLike, numpy.float64]) -> dict
  • reset(self) -> None
  • update(self, value: typing.SupportsFloat | typing.SupportsIndex) -> float | None
  • property count: int
  • property lower: float | None
  • property middle: float | None
  • property ready: bool
  • property upper: float | None
  • property value: float | None

class CCI

Constructor

  • CCI(period: typing.SupportsInt | typing.SupportsIndex = 20) -> None

Members

  • compute(self, arg0: typing.Annotated[numpy.typing.ArrayLike, numpy.float64], arg1: typing.Annotated[numpy.typing.ArrayLike, numpy.float64], arg2: typing.Annotated[numpy.typing.ArrayLike, numpy.float64]) -> numpy.typing.NDArray[numpy.float64]
  • reset(self) -> None
  • update(self, high: typing.SupportsFloat | typing.SupportsIndex, low: typing.SupportsFloat | typing.SupportsIndex, close: typing.SupportsFloat | typing.SupportsIndex) -> float | None
  • property count: int
  • property ready: bool
  • property value: float | None

class CompositeBookMatrix

Cross-exchange composite order book. Tracks best bid/ask across up to 4 exchanges per symbol.

Constructor

  • CompositeBookMatrix(staleness_threshold_ms: typing.SupportsInt | typing.SupportsIndex = 5000) -> None

Members

  • ask_for_exchange(self, symbol: typing.SupportsInt | typing.SupportsIndex, exchange: typing.SupportsInt | typing.SupportsIndex) -> typing.Any
  • best_ask(self, symbol: typing.SupportsInt | typing.SupportsIndex) -> typing.Any
  • best_bid(self, symbol: typing.SupportsInt | typing.SupportsIndex) -> typing.Any
  • bid_for_exchange(self, symbol: typing.SupportsInt | typing.SupportsIndex, exchange: typing.SupportsInt | typing.SupportsIndex) -> typing.Any
  • check_staleness(self, now_ns: typing.SupportsInt | typing.SupportsIndex) -> None
  • has_arbitrage_opportunity(self, symbol: typing.SupportsInt | typing.SupportsIndex) -> bool
  • mark_exchange_stale(self, exchange: typing.SupportsInt | typing.SupportsIndex) -> None
  • mark_stale(self, exchange: typing.SupportsInt | typing.SupportsIndex, symbol: typing.SupportsInt | typing.SupportsIndex) -> None
  • spread(self, symbol: typing.SupportsInt | typing.SupportsIndex) -> typing.Any
  • update_book(self, exchange: typing.SupportsInt | typing.SupportsIndex, symbol: typing.SupportsInt | typing.SupportsIndex, bid_prices: typing.Annotated[numpy.typing.ArrayLike, numpy.float64], bid_quantities: typing.Annotated[numpy.typing.ArrayLike, numpy.float64], ask_prices: typing.Annotated[numpy.typing.ArrayLike, numpy.float64], ask_quantities: typing.Annotated[numpy.typing.ArrayLike, numpy.float64], recv_ns: typing.SupportsInt | typing.SupportsIndex = 0) -> None

class ConstantLatency(LatencyModel)

Returns the same nanoseconds every call. Useful as a baseline.

Constructor

  • ConstantLatency(feed_ns: typing.SupportsInt | typing.SupportsIndex = 0, order_ns: typing.SupportsInt | typing.SupportsIndex = 0, fill_ns: typing.SupportsInt | typing.SupportsIndex = 0) -> None

class Correlation

Constructor

  • Correlation(period: typing.SupportsInt | typing.SupportsIndex) -> None

Members

  • compute(self, arg0: typing.Annotated[numpy.typing.ArrayLike, numpy.float64], arg1: typing.Annotated[numpy.typing.ArrayLike, numpy.float64]) -> numpy.typing.NDArray[numpy.float64]
  • reset(self) -> None
  • update(self, x: typing.SupportsFloat | typing.SupportsIndex, y: typing.SupportsFloat | typing.SupportsIndex) -> float | None
  • property count: int
  • property ready: bool
  • property value: float | None

class DEMA

Constructor

  • DEMA(period: typing.SupportsInt | typing.SupportsIndex) -> None

Members

  • compute(self, arg0: typing.Annotated[numpy.typing.ArrayLike, numpy.float64]) -> numpy.typing.NDArray[numpy.float64]
  • reset(self) -> None
  • update(self, value: typing.SupportsFloat | typing.SupportsIndex) -> float | None
  • property count: int
  • property ready: bool
  • property value: float | None

class DataReader

Constructor

  • DataReader(data_dir: str, from_ns: typing.Any = None, to_ns: typing.Any = None, symbols: typing.Any = None, reorder_window_ns: typing.Any = None) -> None

Members

  • count(self) -> int
  • read_bbo(self) -> numpy.ndarray[typing.Any, numpy.dtype[numpy.void]]
  • read_bbo_from(self, start_ts_ns: typing.SupportsInt | typing.SupportsIndex) -> numpy.ndarray[typing.Any, numpy.dtype[numpy.void]]
  • read_book_updates(self) -> tuple
  • read_book_updates_from(self, start_ts_ns: typing.SupportsInt | typing.SupportsIndex) -> tuple
  • read_option_quotes_from(self, start_ts_ns: typing.SupportsInt | typing.SupportsIndex) -> numpy.ndarray[typing.Any, numpy.dtype[numpy.void]]
  • read_trades(self) -> numpy.ndarray[typing.Any, numpy.dtype[numpy.void]]
  • read_trades_from(self, start_ts_ns: typing.SupportsInt | typing.SupportsIndex) -> numpy.ndarray[typing.Any, numpy.dtype[numpy.void]]
  • run(self, aggregators: list, n_threads: typing.SupportsInt | typing.SupportsIndex = 0, progress_callback: typing.Any = None, progress_interval_ms: typing.SupportsInt | typing.SupportsIndex = 1000) -> bool
  • segment_files(self) -> list
  • segments(self) -> list
  • stats(self) -> dict
  • summary(self) -> dict
  • symbols(self) -> set
  • time_range(self) -> typing.Any

class DataWriter

Constructor

  • DataWriter(output_dir: str, max_segment_mb: typing.SupportsInt | typing.SupportsIndex = 256, exchange_id: typing.SupportsInt | typing.SupportsIndex = 0, compression: str = 'none') -> None

Members

  • close(self) -> None
  • current_segment_path(self) -> str
  • flush(self) -> None
  • stats(self) -> dict
  • write_book(self, exchange_ts_ns: typing.SupportsInt | typing.SupportsIndex, recv_ts_ns: typing.SupportsInt | typing.SupportsIndex, seq: typing.SupportsInt | typing.SupportsIndex, symbol_id: typing.SupportsInt | typing.SupportsIndex, is_snapshot: bool, bids: typing.Annotated[numpy.typing.ArrayLike, ...], asks: typing.Annotated[numpy.typing.ArrayLike, ...]) -> bool
  • write_books(self, headers: typing.Annotated[numpy.typing.ArrayLike, ...], levels: typing.Annotated[numpy.typing.ArrayLike, ...]) -> int
  • write_option_quotes(self, exchange_ts_ns: typing.Annotated[numpy.typing.ArrayLike, numpy.int64], recv_ts_ns: typing.Annotated[numpy.typing.ArrayLike, numpy.int64], mark_prices: typing.Annotated[numpy.typing.ArrayLike, numpy.float64], index_prices: typing.Annotated[numpy.typing.ArrayLike, numpy.float64], ivs: typing.Annotated[numpy.typing.ArrayLike, numpy.float64], open_interest: typing.Annotated[numpy.typing.ArrayLike, numpy.float64], symbol_ids: typing.Annotated[numpy.typing.ArrayLike, numpy.uint32], bid_prices: typing.Any = None, ask_prices: typing.Any = None, underlying_prices: typing.Any = None, bid_sizes: typing.Any = None, ask_sizes: typing.Any = None, bid_ivs: typing.Any = None, ask_ivs: typing.Any = None) -> int
  • write_trade(self, exchange_ts_ns: typing.SupportsInt | typing.SupportsIndex, recv_ts_ns: typing.SupportsInt | typing.SupportsIndex, price: typing.SupportsFloat | typing.SupportsIndex, qty: typing.SupportsFloat | typing.SupportsIndex, trade_id: typing.SupportsInt | typing.SupportsIndex, symbol_id: typing.SupportsInt | typing.SupportsIndex, side: typing.SupportsInt | typing.SupportsIndex) -> bool
  • write_trades(self, exchange_ts_ns: typing.Annotated[numpy.typing.ArrayLike, numpy.int64], recv_ts_ns: typing.Annotated[numpy.typing.ArrayLike, numpy.int64], prices: typing.Annotated[numpy.typing.ArrayLike, numpy.float64], quantities: typing.Annotated[numpy.typing.ArrayLike, numpy.float64], trade_ids: typing.Annotated[numpy.typing.ArrayLike, numpy.uint64], symbol_ids: typing.Annotated[numpy.typing.ArrayLike, numpy.uint32], sides: typing.Annotated[numpy.typing.ArrayLike, numpy.uint8]) -> int

class DeltaBookEncoder

Encode a stream of L2 snapshots as anchor snapshots plus deltas. anchor_every=0 emits snapshots only; the existing tape format stores either type, so callers can safely persist the output.

Constructor

  • DeltaBookEncoder(anchor_every: typing.SupportsInt | typing.SupportsIndex = 100) -> None

Members

  • encode(self, symbol_id: typing.SupportsInt | typing.SupportsIndex, bids: list, asks: list) -> dict
  • reset(self, symbol_id: typing.SupportsInt | typing.SupportsIndex) -> None
  • reset_all(self) -> None

class DeltaBookReplayer

Reverse of DeltaBookEncoder. Maintains current book state per symbol; given a stream of (type, bids, asks) tuples returns the reconstructed full snapshot at each step.

Constructor

  • DeltaBookReplayer() -> None

Members

  • apply(self, type: typing.SupportsInt | typing.SupportsIndex, symbol_id: typing.SupportsInt | typing.SupportsIndex, bids: list, asks: list) -> dict
  • reset(self, symbol_id: typing.SupportsInt | typing.SupportsIndex) -> None
  • reset_all(self) -> None

class EMA

Constructor

  • EMA(period: typing.SupportsInt | typing.SupportsIndex) -> None

Members

  • compute(self, arg0: typing.Annotated[numpy.typing.ArrayLike, numpy.float64]) -> numpy.typing.NDArray[numpy.float64]
  • reset(self) -> None
  • update(self, value: typing.SupportsFloat | typing.SupportsIndex) -> float | None
  • property count: int
  • property ready: bool
  • property value: float | None

class EmpiricalLatency(LatencyModel)

Resample with replacement from observed values. Pass three lists of measured latencies (one per component).

Constructor

  • EmpiricalLatency(feed_samples: collections.abc.Sequence[typing.SupportsInt | typing.SupportsIndex] = [], order_samples: collections.abc.Sequence[typing.SupportsInt | typing.SupportsIndex] = [], fill_samples: collections.abc.Sequence[typing.SupportsInt | typing.SupportsIndex] = [], seed: typing.SupportsInt | typing.SupportsIndex = 0) -> None

class Engine

Constructor

  • Engine(initial_capital: typing.SupportsFloat | typing.SupportsIndex = 100000.0, fee_rate: typing.SupportsFloat | typing.SupportsIndex = 0.0001) -> None

Members

  • bar_count(self, symbol: str = '') -> int
  • close(self, symbol: str = '') -> numpy.typing.NDArray[numpy.float64]
  • high(self, symbol: str = '') -> numpy.typing.NDArray[numpy.float64]
  • load_csv(self, path: str, symbol: str = '') -> None
  • load_df(self, df: typing.Any, symbol: str = '') -> None
  • load_ohlcv(self, data: dict, symbol: str = '') -> None
  • low(self, symbol: str = '') -> numpy.typing.NDArray[numpy.float64]
  • open(self, symbol: str = '') -> numpy.typing.NDArray[numpy.float64]
  • resample(self, symbol: str, target: str, interval: str) -> None
  • run(self, signals: SignalBuilder, default_symbol: typing.SupportsInt | typing.SupportsIndex = 0) -> Stats
  • ts(self, symbol: str = '') -> numpy.typing.NDArray[numpy.float64]
  • volume(self, symbol: str = '') -> numpy.typing.NDArray[numpy.float64]
  • property symbols: list

class EventTypeStatsAggregator(_AggregatorHandle)

Per-symbol counters split by event kind (trade / book_snapshot / book_delta). Cheapest of the native aggregators; useful as the 'what's in this tape' overview.

Constructor

  • EventTypeStatsAggregator(event_filter: AggregatorEventFilter = ..., symbol_filter: collections.abc.Sequence[typing.SupportsInt | typing.SupportsIndex] = []) -> None

Members

  • result(self) -> numpy.ndarray[typing.Any, numpy.dtype[numpy.void]]

class ExchangeCapabilities

Constructor

  • ExchangeCapabilities() -> None

Members

  • attr close_position: bool
  • attr fok: bool
  • attr gtc: bool
  • attr gtd: bool
  • attr iceberg: bool
  • attr ioc: bool
  • attr oco: bool
  • attr post_only: bool
  • attr reduce_only: bool
  • attr stop_limit: bool
  • attr stop_market: bool
  • attr take_profit_limit: bool
  • attr take_profit_market: bool
  • attr trailing_stop: bool

class ExecutionListener

Constructor

  • ExecutionListener() -> None

Members

  • on_accepted(self, arg0: Order) -> None
  • on_canceled(self, arg0: Order) -> None
  • on_expired(self, arg0: Order) -> None
  • on_filled(self, arg0: Order) -> None
  • on_partially_filled(self, order: Order, fill_qty: typing.SupportsFloat | typing.SupportsIndex) -> None
  • on_pending_cancel(self, arg0: Order) -> None
  • on_pending_trigger(self, arg0: Order) -> None
  • on_rejected(self, order: Order, reason: str) -> None
  • on_replaced(self, old_order: Order, new_order: Order) -> None
  • on_submitted(self, arg0: Order) -> None
  • on_trailing_stop_updated(self, order: Order, new_trigger: typing.SupportsFloat | typing.SupportsIndex) -> None
  • on_triggered(self, arg0: Order) -> None

class Executor

Constructor

  • Executor() -> None

Members

  • cancel(self, order_id: typing.SupportsInt | typing.SupportsIndex) -> None
  • cancel_all(self, symbol: typing.SupportsInt | typing.SupportsIndex) -> None
  • capabilities(self) -> ExchangeCapabilities
  • on_start(self) -> None
  • on_stop(self) -> None
  • replace(self, old_order_id: typing.SupportsInt | typing.SupportsIndex, new_order: Order) -> None
  • submit(self, order: Order) -> None
  • submit_oco(self, order1: Order, order2: Order) -> None

class ExponentialLatency(LatencyModel)

Exponential per component, parameterised by mean. Heavy right tail by default.

Constructor

  • ExponentialLatency(feed_mean_ns: typing.SupportsFloat | typing.SupportsIndex = 0.0, order_mean_ns: typing.SupportsFloat | typing.SupportsIndex = 0.0, fill_mean_ns: typing.SupportsFloat | typing.SupportsIndex = 0.0, seed: typing.SupportsInt | typing.SupportsIndex = 0) -> None

class FeeSchedule

Constructor

  • FeeSchedule() -> None

Members

  • binance_um_futures() -> FeeSchedule
  • bybit_linear() -> FeeSchedule
  • deribit() -> FeeSchedule
  • okx_swap() -> FeeSchedule
  • add_tier(self, min_notional_30d: typing.SupportsFloat | typing.SupportsIndex, maker_bps: typing.SupportsFloat | typing.SupportsIndex, taker_bps: typing.SupportsFloat | typing.SupportsIndex) -> None
  • bind_account(self, account: Account) -> None
  • clear_account_binding(self) -> None
  • current_bps(self, now_ns: typing.SupportsInt | typing.SupportsIndex) -> tuple[float, float]
  • current_tier_index(self) -> int
  • fee_for(self, ts_ns: typing.SupportsInt | typing.SupportsIndex, notional: typing.SupportsFloat | typing.SupportsIndex, is_maker: bool) -> float
  • record_fill(self, ts_ns: typing.SupportsInt | typing.SupportsIndex, notional: typing.SupportsFloat | typing.SupportsIndex) -> None
  • reset_rolling(self) -> None
  • rolling_notional_30d(self) -> float
  • tier_count(self) -> int
  • tier_transition_ts_ns(self) -> list[int]
  • tiers(self) -> list[FeeTier]

class FeeTier

Members

  • property maker_bps: float
  • property min_notional_30d: float
  • property taker_bps: float

class FeedClockPolicy

Members:

Constructor

  • FeedClockPolicy(value: typing.SupportsInt | typing.SupportsIndex) -> None

Members

  • attr FIRE_ON_ANY: typing.ClassVar[FeedClockPolicy]
  • attr LEADER_FOLLOWER: typing.ClassVar[FeedClockPolicy]
  • attr WAIT_FOR_ALL: typing.ClassVar[FeedClockPolicy]
  • attr __members__: typing.ClassVar[dict[str, FeedClockPolicy]]
  • property name: str
  • property value: int

class FillLiquidity

Members:

Constructor

  • FillLiquidity(value: typing.SupportsInt | typing.SupportsIndex) -> None

Members

  • attr MAKER: typing.ClassVar[FillLiquidity]
  • attr TAKER: typing.ClassVar[FillLiquidity]
  • attr UNKNOWN: typing.ClassVar[FillLiquidity]
  • attr __members__: typing.ClassVar[dict[str, FillLiquidity]]
  • property name: str
  • property value: int

class FloxError(Exception)

class FootprintBar

Footprint bar for order flow analysis. Tracks bid/ask volume at each price level.

Constructor

  • FootprintBar(tick_size: typing.SupportsFloat | typing.SupportsIndex) -> None

Members

  • add_trade(self, price: typing.SupportsFloat | typing.SupportsIndex, quantity: typing.SupportsFloat | typing.SupportsIndex, is_buy: bool) -> None
  • add_trades(self, prices: typing.Annotated[numpy.typing.ArrayLike, numpy.float64], quantities: typing.Annotated[numpy.typing.ArrayLike, numpy.float64], is_buy: typing.Annotated[numpy.typing.ArrayLike, numpy.uint8]) -> None
  • clear(self) -> None
  • highest_buying_pressure(self) -> float
  • highest_selling_pressure(self) -> float
  • levels(self) -> list
  • num_levels(self) -> int
  • strongest_imbalance(self, threshold: typing.SupportsFloat | typing.SupportsIndex = 0.7) -> typing.Any
  • total_delta(self) -> float
  • total_volume(self) -> float

class FundingPayment

Members

  • property amount: float
  • property mark_price: float
  • property position_signed: float
  • property rate: float
  • property symbol: int
  • property timestamp_ns: int

class FundingSchedule

Constructor

  • FundingSchedule() -> None

Members

  • binance_um_futures() -> FundingSchedule
  • bitget_hourly() -> FundingSchedule
  • bybit_linear() -> FundingSchedule
  • constant(interval_ns: typing.SupportsInt | typing.SupportsIndex, rate: typing.SupportsFloat | typing.SupportsIndex) -> FundingSchedule
  • okx_swap() -> FundingSchedule
  • tape(events: collections.abc.Sequence[tuple[typing.SupportsInt | typing.SupportsIndex, typing.SupportsFloat | typing.SupportsIndex]]) -> FundingSchedule
  • tape_by_symbol(entries: collections.abc.Sequence[FundingTapeEntry]) -> FundingSchedule
  • constant_rate(self) -> float
  • interval_ns(self) -> int
  • last_tick_ns(self) -> int
  • load_tape(self, path: str) -> bool
  • per_symbol_tape(self) -> list[FundingTapeEntry]
  • reset(self) -> None
  • set_constant_rate(self, rate: typing.SupportsFloat | typing.SupportsIndex) -> None
  • settlement_timestamps(self) -> list[int]
  • tick(self, now_ns: typing.SupportsInt | typing.SupportsIndex, symbols: collections.abc.Sequence[typing.SupportsInt | typing.SupportsIndex], positions: collections.abc.Sequence[typing.SupportsFloat | typing.SupportsIndex], mark_prices: collections.abc.Sequence[typing.SupportsFloat | typing.SupportsIndex]) -> list[FundingPayment]

class FundingTapeEntry

Constructor

  • FundingTapeEntry() -> None

Members

  • property rate: float
  • property rate: None
  • property symbol: int
  • property symbol: None
  • property timestamp_ns: int
  • property timestamp_ns: None

class GaussianLatency(LatencyModel)

Independent normal samples per component, clamped to non-negative. Stddev <= 0 collapses the component to a deterministic mean.

Constructor

  • GaussianLatency(feed_mean_ns: typing.SupportsFloat | typing.SupportsIndex = 0.0, feed_stddev_ns: typing.SupportsFloat | typing.SupportsIndex = 0.0, order_mean_ns: typing.SupportsFloat | typing.SupportsIndex = 0.0, order_stddev_ns: typing.SupportsFloat | typing.SupportsIndex = 0.0, fill_mean_ns: typing.SupportsFloat | typing.SupportsIndex = 0.0, fill_stddev_ns: typing.SupportsFloat | typing.SupportsIndex = 0.0, seed: typing.SupportsInt | typing.SupportsIndex = 0) -> None

class GridSearch

Constructor

  • GridSearch() -> None

Members

  • add_axis(self, values: collections.abc.Sequence[typing.SupportsFloat | typing.SupportsIndex]) -> None
  • params_for_index(self, index: typing.SupportsInt | typing.SupportsIndex) -> list[float]
  • run(self) -> list
  • set_factory(self, factory: typing.Any) -> None
  • total(self) -> int

class IndicatorGraph

Constructor

  • IndicatorGraph() -> None

Members

  • add_node(self, name: str, deps: collections.abc.Sequence[str], fn: typing.Any) -> None
  • bar_count(self, symbol: typing.SupportsInt | typing.SupportsIndex) -> int
  • close(self, symbol: typing.SupportsInt | typing.SupportsIndex) -> numpy.typing.NDArray[numpy.float64]
  • current(self, symbol: typing.SupportsInt | typing.SupportsIndex, name: str) -> float
  • get(self, symbol: typing.SupportsInt | typing.SupportsIndex, name: str) -> typing.Any
  • high(self, symbol: typing.SupportsInt | typing.SupportsIndex) -> numpy.typing.NDArray[numpy.float64]
  • indicator(self, name: str, indicator: typing.Any, source: str = 'close') -> None
  • invalidate(self, symbol: typing.SupportsInt | typing.SupportsIndex) -> None
  • invalidate_all(self) -> None
  • low(self, symbol: typing.SupportsInt | typing.SupportsIndex) -> numpy.typing.NDArray[numpy.float64]
  • require(self, symbol: typing.SupportsInt | typing.SupportsIndex, name: str) -> numpy.typing.NDArray[numpy.float64]
  • reset(self, symbol: typing.SupportsInt | typing.SupportsIndex) -> None
  • reset_all(self) -> None
  • set_bars(self, symbol: typing.SupportsInt | typing.SupportsIndex, close: typing.Annotated[numpy.typing.ArrayLike, numpy.float64], high: typing.Annotated[numpy.typing.ArrayLike, numpy.float64] | None = None, low: typing.Annotated[numpy.typing.ArrayLike, numpy.float64] | None = None, volume: typing.Annotated[numpy.typing.ArrayLike, numpy.float64] | None = None) -> None
  • step(self, symbol: typing.SupportsInt | typing.SupportsIndex, close: typing.SupportsFloat | typing.SupportsIndex, high: typing.SupportsFloat | typing.SupportsIndex | None = None, low: typing.SupportsFloat | typing.SupportsIndex | None = None, volume: typing.SupportsFloat | typing.SupportsIndex | None = None) -> None
  • volume(self, symbol: typing.SupportsInt | typing.SupportsIndex) -> numpy.typing.NDArray[numpy.float64]

class KAMA

Constructor

  • KAMA(period: typing.SupportsInt | typing.SupportsIndex, fast: typing.SupportsInt | typing.SupportsIndex = 2, slow: typing.SupportsInt | typing.SupportsIndex = 30) -> None

Members

  • compute(self, arg0: typing.Annotated[numpy.typing.ArrayLike, numpy.float64]) -> numpy.typing.NDArray[numpy.float64]
  • reset(self) -> None
  • update(self, value: typing.SupportsFloat | typing.SupportsIndex) -> float | None
  • property count: int
  • property ready: bool
  • property value: float | None

class KillSwitch

Constructor

  • KillSwitch() -> None

Members

  • check(self, signal: Signal) -> bool

class Kurtosis

Constructor

  • Kurtosis(period: typing.SupportsInt | typing.SupportsIndex) -> None

Members

  • compute(self, arg0: typing.Annotated[numpy.typing.ArrayLike, numpy.float64]) -> numpy.typing.NDArray[numpy.float64]
  • reset(self) -> None
  • update(self, value: typing.SupportsFloat | typing.SupportsIndex) -> float | None
  • property count: int
  • property ready: bool
  • property value: float | None

class L3Book

Constructor

  • L3Book() -> None

Members

  • add_order(self, order_id: typing.SupportsInt | typing.SupportsIndex, price: typing.SupportsFloat | typing.SupportsIndex, quantity: typing.SupportsFloat | typing.SupportsIndex, side: str) -> str
  • ask_at_price(self, price: typing.SupportsFloat | typing.SupportsIndex) -> float
  • best_ask(self) -> typing.Any
  • best_bid(self) -> typing.Any
  • bid_at_price(self, price: typing.SupportsFloat | typing.SupportsIndex) -> float
  • build_from_snapshot(self, orders: list) -> None
  • export_snapshot(self) -> list
  • modify_order(self, order_id: typing.SupportsInt | typing.SupportsIndex, new_quantity: typing.SupportsFloat | typing.SupportsIndex) -> str
  • remove_order(self, order_id: typing.SupportsInt | typing.SupportsIndex) -> str

class LatencyDistribution

Constructor

  • LatencyDistribution() -> None

Members

  • constant(ns: typing.SupportsInt | typing.SupportsIndex) -> LatencyDistribution
  • empirical(samples_ns: collections.abc.Sequence[typing.SupportsInt | typing.SupportsIndex]) -> LatencyDistribution
  • lognormal(median_ns: typing.SupportsInt | typing.SupportsIndex, sigma: typing.SupportsFloat | typing.SupportsIndex) -> LatencyDistribution
  • uniform(lo_ns: typing.SupportsInt | typing.SupportsIndex, hi_ns: typing.SupportsInt | typing.SupportsIndex) -> LatencyDistribution
  • median_ns(self) -> int
  • set_burst_correlation(self, rho: typing.SupportsFloat | typing.SupportsIndex) -> None
  • property burst_correlation: float
  • property burst_correlation: None

class LatencyModel

Abstract sampler. Subclasses implement feed_delay / order_delay / fill_delay returning non-negative nanoseconds.

Constructor

  • LatencyModel() -> None

Members

  • feed_delay(self) -> int
  • fill_delay(self) -> int
  • order_delay(self) -> int
  • reset(self, seed: typing.SupportsInt | typing.SupportsIndex = 0) -> None
  • sample(self) -> LatencySample

class LatencySample

One draw from a LatencyModel covering feed, order, and fill in non-negative nanoseconds.

Constructor

  • LatencySample(feed_ns: typing.SupportsInt | typing.SupportsIndex = 0, order_ns: typing.SupportsInt | typing.SupportsIndex = 0, fill_ns: typing.SupportsInt | typing.SupportsIndex = 0) -> None

Members

  • to_dict(self) -> dict
  • property feed_ns: int
  • property feed_ns: None
  • property fill_ns: int
  • property fill_ns: None
  • property order_ns: int
  • property order_ns: None

class LegState

Members:

Constructor

  • LegState(value: typing.SupportsInt | typing.SupportsIndex) -> None

Members

  • attr CANCELLED: typing.ClassVar[LegState]
  • attr FAILED: typing.ClassVar[LegState]
  • attr FILLED: typing.ClassVar[LegState]
  • attr PARTIALLY_FILLED: typing.ClassVar[LegState]
  • attr PENDING: typing.ClassVar[LegState]
  • attr SUBMITTED: typing.ClassVar[LegState]
  • attr __members__: typing.ClassVar[dict[str, LegState]]
  • property name: str
  • property value: int

class LiquidationEngine

Constructor

  • LiquidationEngine() -> None

Members

  • binance_um_futures() -> LiquidationEngine
  • bybit_linear() -> LiquidationEngine
  • okx_swap() -> LiquidationEngine
  • account_count(self) -> int
  • add_tier(self, min_notional: typing.SupportsFloat | typing.SupportsIndex, mm_fraction: typing.SupportsFloat | typing.SupportsIndex) -> LiquidationEngine
  • adl_closeouts_count(self) -> int
  • adl_enabled(self) -> bool
  • adl_ranking(self) -> AdlRanking
  • attach_account(self, account: Account) -> None
  • cascade_sizes_per_tick(self) -> list[int]
  • close_position(self, account_id: typing.SupportsInt | typing.SupportsIndex, symbol: typing.SupportsInt | typing.SupportsIndex) -> None
  • deficits_paid_by_adl(self) -> list[float]
  • deficits_paid_by_fund(self) -> list[float]
  • detach_account(self, account_id: typing.SupportsInt | typing.SupportsIndex) -> None
  • fund_balance_history(self) -> list[float]
  • insurance_fund_balance(self) -> float
  • insurance_payments_count(self) -> int
  • liquidations_count(self) -> int
  • mark_impact_model(self) -> MarkImpactModel
  • mark_impact_weight(self) -> float
  • max_cascade_depth(self) -> int
  • on_mark(self, symbol: typing.SupportsInt | typing.SupportsIndex, mark_price: typing.SupportsFloat | typing.SupportsIndex) -> dict
  • on_marks(self, marks: collections.abc.Sequence[tuple[typing.SupportsInt | typing.SupportsIndex, typing.SupportsFloat | typing.SupportsIndex]], ts_ns: typing.SupportsInt | typing.SupportsIndex = 0) -> dict
  • open_position(self, account_id: typing.SupportsInt | typing.SupportsIndex, symbol: typing.SupportsInt | typing.SupportsIndex, quantity: typing.SupportsFloat | typing.SupportsIndex, entry_price: typing.SupportsFloat | typing.SupportsIndex, equity: typing.SupportsFloat | typing.SupportsIndex) -> None
  • position_count(self) -> int
  • reset_stats(self) -> None
  • set_adl_enabled(self, enabled: bool) -> None
  • set_adl_ranking(self, ranking: typing.Any) -> None
  • set_executor(self, executor: typing.Any) -> None
  • set_insurance_fund_capital(self, capital: typing.SupportsFloat | typing.SupportsIndex) -> None
  • set_liquidation_slippage_bps(self, bps: typing.SupportsFloat | typing.SupportsIndex) -> None
  • set_mark_impact_model(self, model: typing.Any, weight: typing.SupportsFloat | typing.SupportsIndex = 0.3) -> None
  • set_max_cascade_depth(self, depth: typing.SupportsInt | typing.SupportsIndex) -> None
  • ticks_to_first_adl(self) -> int

class LiveQueuePositionEstimator

Constructor

  • LiveQueuePositionEstimator() -> None

Members

  • on_level_update(self, symbol: typing.SupportsInt | typing.SupportsIndex, side: typing.SupportsInt | typing.SupportsIndex, price: typing.SupportsFloat | typing.SupportsIndex, new_qty: typing.SupportsFloat | typing.SupportsIndex, ts_ns: typing.SupportsInt | typing.SupportsIndex = 0) -> None
  • on_order_cancelled(self, order_id: typing.SupportsInt | typing.SupportsIndex, ts_ns: typing.SupportsInt | typing.SupportsIndex = 0) -> None
  • on_order_filled(self, order_id: typing.SupportsInt | typing.SupportsIndex, cumulative_fill: typing.SupportsFloat | typing.SupportsIndex, ts_ns: typing.SupportsInt | typing.SupportsIndex = 0) -> None
  • on_order_placed(self, symbol: typing.SupportsInt | typing.SupportsIndex, side: typing.SupportsInt | typing.SupportsIndex, price: typing.SupportsFloat | typing.SupportsIndex, order_id: typing.SupportsInt | typing.SupportsIndex, order_qty: typing.SupportsFloat | typing.SupportsIndex, level_qty_now: typing.SupportsFloat | typing.SupportsIndex, ts_ns: typing.SupportsInt | typing.SupportsIndex = 0) -> None
  • on_trade(self, symbol: typing.SupportsInt | typing.SupportsIndex, price: typing.SupportsFloat | typing.SupportsIndex, qty: typing.SupportsFloat | typing.SupportsIndex, ts_ns: typing.SupportsInt | typing.SupportsIndex = 0) -> None
  • on_trade_with_flag(self, symbol: typing.SupportsInt | typing.SupportsIndex, price: typing.SupportsFloat | typing.SupportsIndex, qty: typing.SupportsFloat | typing.SupportsIndex, ts_ns: typing.SupportsInt | typing.SupportsIndex = 0, is_hidden: bool = False) -> None
  • set_confidence_half_life_ns(self, half_life_ns: typing.SupportsInt | typing.SupportsIndex) -> None
  • set_hidden_order_policy(self, policy: str) -> None
  • set_shrink_attribution_factor(self, factor: typing.SupportsFloat | typing.SupportsIndex) -> None
  • snapshot(self, order_id: typing.SupportsInt | typing.SupportsIndex, now_ns: typing.SupportsInt | typing.SupportsIndex = 0) -> typing.Any
  • tracked_order_count(self) -> int

class MACD

Constructor

  • MACD(fast: typing.SupportsInt | typing.SupportsIndex = 12, slow: typing.SupportsInt | typing.SupportsIndex = 26, signal: typing.SupportsInt | typing.SupportsIndex = 9) -> None

Members

  • compute(self, arg0: typing.Annotated[numpy.typing.ArrayLike, numpy.float64]) -> dict
  • reset(self) -> None
  • update(self, value: typing.SupportsFloat | typing.SupportsIndex) -> float | None
  • property count: int
  • property histogram: float | None
  • property line: float | None
  • property ready: bool
  • property signal: float | None
  • property value: float | None

class MarginMode

Members:

Constructor

  • MarginMode(value: typing.SupportsInt | typing.SupportsIndex) -> None

Members

  • attr Cross: typing.ClassVar[MarginMode]
  • attr Isolated: typing.ClassVar[MarginMode]
  • attr __members__: typing.ClassVar[dict[str, MarginMode]]
  • property name: str
  • property value: int

class MarkImpactModel

Members:

Constructor

  • MarkImpactModel(value: typing.SupportsInt | typing.SupportsIndex) -> None

Members

  • attr BookAnchored: typing.ClassVar[MarkImpactModel]
  • attr BookOnly: typing.ClassVar[MarkImpactModel]
  • attr None_: typing.ClassVar[MarkImpactModel]
  • attr __members__: typing.ClassVar[dict[str, MarkImpactModel]]
  • property name: str
  • property value: int

class MarketDataRecorderHook

Constructor

  • MarketDataRecorderHook() -> None

Members

  • on_book_update(self, symbol: typing.SupportsInt | typing.SupportsIndex, is_snapshot: bool, bids: collections.abc.Sequence[tuple[typing.SupportsFloat | typing.SupportsIndex, typing.SupportsFloat | typing.SupportsIndex]], asks: collections.abc.Sequence[tuple[typing.SupportsFloat | typing.SupportsIndex, typing.SupportsFloat | typing.SupportsIndex]], ts_ns: typing.SupportsInt | typing.SupportsIndex) -> None
  • on_start(self) -> None
  • on_stop(self) -> None
  • on_trade(self, arg0: TradeData) -> None

class MarketProfile

Market Profile (TPO) aggregator. Tracks price activity across time periods.

Constructor

  • MarketProfile(tick_size: typing.SupportsFloat | typing.SupportsIndex, period_minutes: typing.SupportsInt | typing.SupportsIndex, session_start_ns: typing.SupportsInt | typing.SupportsIndex) -> None

Members

  • add_trade(self, timestamp_ns: typing.SupportsInt | typing.SupportsIndex, price: typing.SupportsFloat | typing.SupportsIndex, quantity: typing.SupportsFloat | typing.SupportsIndex, is_buy: bool) -> None
  • add_trades(self, timestamps_ns: typing.Annotated[numpy.typing.ArrayLike, numpy.int64], prices: typing.Annotated[numpy.typing.ArrayLike, numpy.float64], quantities: typing.Annotated[numpy.typing.ArrayLike, numpy.float64], is_buy: typing.Annotated[numpy.typing.ArrayLike, numpy.uint8]) -> None
  • clear(self) -> None
  • current_period(self) -> int
  • initial_balance_high(self) -> float
  • initial_balance_low(self) -> float
  • is_poor_high(self) -> bool
  • is_poor_low(self) -> bool
  • levels(self) -> list
  • num_levels(self) -> int
  • poc(self) -> float
  • single_prints(self) -> list
  • value_area_high(self) -> float
  • value_area_low(self) -> float

class MergedTapeReader

Constructor

  • MergedTapeReader(paths: collections.abc.Sequence[str], from_ns: typing.Any = None, to_ns: typing.Any = None, symbols: typing.Any = None) -> None

Members

  • per_tape_stats(self) -> list
  • read_books(self) -> tuple
  • read_trades(self) -> numpy.ndarray
  • run(self, aggregators: list) -> bool
  • stream_events(self, on_trade: typing.Any = None, on_book: typing.Any = None) -> None
  • summary(self) -> dict
  • symbol_table(self) -> list
  • time_range(self) -> tuple

class MultiFeedClock

Constructor

  • MultiFeedClock(symbols: collections.abc.Sequence[typing.SupportsInt | typing.SupportsIndex], policy: FeedClockPolicy = ..., timeout_ms: typing.SupportsInt | typing.SupportsIndex = 200, leader_symbol: typing.SupportsInt | typing.SupportsIndex = 0, staleness_budget_ms: typing.SupportsInt | typing.SupportsIndex = 200) -> None

Members

  • policy(self) -> FeedClockPolicy
  • reset(self) -> None
  • symbol_count(self) -> int
  • tick(self, ts_ns: typing.SupportsInt | typing.SupportsIndex, symbol_id: typing.SupportsInt | typing.SupportsIndex) -> dict

class OHLCBinAggregator(_AggregatorHandle)

Time-bucketed price OHLC over trade events. For each cell, records open (earliest ts), close (latest ts), high (max), and low (min) of trade.price_raw. Empty buckets produce no row; forward-fill on the caller side if a dense series is needed. Books are ignored.

Constructor

  • OHLCBinAggregator(bucket_ns: typing.SupportsInt | typing.SupportsIndex, by_symbol: bool = False, event_filter: AggregatorEventFilter = ..., symbol_filter: collections.abc.Sequence[typing.SupportsInt | typing.SupportsIndex] = []) -> None

Members

  • result(self) -> numpy.ndarray[typing.Any, numpy.dtype[numpy.void]]

class OptionType

Members:

Constructor

  • OptionType(value: typing.SupportsInt | typing.SupportsIndex) -> None

Members

  • attr CALL: typing.ClassVar[OptionType]
  • attr PUT: typing.ClassVar[OptionType]
  • attr __members__: typing.ClassVar[dict[str, OptionType]]
  • property name: str
  • property value: int

class Order

Constructor

  • Order() -> None

Members

  • attr close_position: bool
  • attr order_type: str
  • attr post_only: bool
  • attr reduce_only: bool
  • attr side: str
  • attr time_in_force: str
  • property client_order_id: int
  • property client_order_id: None
  • property created_at_ns: int
  • property created_at_ns: None
  • property exchange_ts_ns: int
  • property exchange_ts_ns: None
  • property filled_quantity: float
  • property filled_quantity: None
  • property id: int
  • property id: None
  • property order_tag: int
  • property order_tag: None
  • property price: float
  • property price: None
  • property quantity: float
  • property quantity: None
  • property strategy_id: int
  • property strategy_id: None
  • property symbol: int
  • property symbol: None
  • property trailing_offset: float
  • property trailing_offset: None
  • property trigger_price: float
  • property trigger_price: None

class OrderBook

Constructor

  • OrderBook(tick_size: typing.SupportsFloat | typing.SupportsIndex) -> None

Members

  • apply_delta(self, bid_prices: typing.Annotated[numpy.typing.ArrayLike, numpy.float64], bid_quantities: typing.Annotated[numpy.typing.ArrayLike, numpy.float64], ask_prices: typing.Annotated[numpy.typing.ArrayLike, numpy.float64], ask_quantities: typing.Annotated[numpy.typing.ArrayLike, numpy.float64]) -> None
  • apply_snapshot(self, bid_prices: typing.Annotated[numpy.typing.ArrayLike, numpy.float64], bid_quantities: typing.Annotated[numpy.typing.ArrayLike, numpy.float64], ask_prices: typing.Annotated[numpy.typing.ArrayLike, numpy.float64], ask_quantities: typing.Annotated[numpy.typing.ArrayLike, numpy.float64]) -> None
  • ask_at_price(self, price: typing.SupportsFloat | typing.SupportsIndex) -> float
  • best_ask(self) -> typing.Any
  • best_bid(self) -> typing.Any
  • bid_at_price(self, price: typing.SupportsFloat | typing.SupportsIndex) -> float
  • clear(self) -> None
  • consume_asks(self, quantity: typing.SupportsFloat | typing.SupportsIndex) -> tuple
  • consume_bids(self, quantity: typing.SupportsFloat | typing.SupportsIndex) -> tuple
  • get_asks(self, max_levels: typing.SupportsInt | typing.SupportsIndex = 20) -> numpy.typing.NDArray[numpy.float64]
  • get_bids(self, max_levels: typing.SupportsInt | typing.SupportsIndex = 20) -> numpy.typing.NDArray[numpy.float64]
  • is_crossed(self) -> bool
  • mid(self) -> typing.Any
  • spread(self) -> typing.Any

class OrderEventData

Members

  • attr fill_role: str
  • attr is_maker: bool
  • attr market_position: str
  • attr order_type: str
  • attr reject_reason: str
  • attr side: str
  • attr status: str
  • property accepted_at_ns: int
  • property accepted_at_ns: None
  • property canceled_at_ns: int
  • property canceled_at_ns: None
  • property distance_to_best_ticks: int
  • property distance_to_best_ticks: None
  • property exchange_ts_ns: int
  • property exchange_ts_ns: None
  • property expired_at_ns: int
  • property expired_at_ns: None
  • property fill_price: float
  • property fill_price: None
  • property fill_qty: float
  • property fill_qty: None
  • property first_fill_at_ns: int
  • property first_fill_at_ns: None
  • property last_fill_at_ns: int
  • property last_fill_at_ns: None
  • property order_id: int
  • property order_id: None
  • property queue_ahead: float
  • property queue_ahead: None
  • property queue_total: float
  • property queue_total: None
  • property rejected_at_ns: int
  • property rejected_at_ns: None
  • property submitted_at_ns: int
  • property submitted_at_ns: None
  • property symbol_id: int
  • property symbol_id: None
  • property triggered_at_ns: int
  • property triggered_at_ns: None

class OrderEventKind

Members:

Constructor

  • OrderEventKind(value: typing.SupportsInt | typing.SupportsIndex) -> None

Members

  • attr ACK: typing.ClassVar[OrderEventKind]
  • attr CANCEL: typing.ClassVar[OrderEventKind]
  • attr EXPIRE: typing.ClassVar[OrderEventKind]
  • attr MODIFY: typing.ClassVar[OrderEventKind]
  • attr REJECT: typing.ClassVar[OrderEventKind]
  • attr SUBMIT: typing.ClassVar[OrderEventKind]
  • attr __members__: typing.ClassVar[dict[str, OrderEventKind]]
  • property name: str
  • property value: int

class OrderGroup

Constructor

  • OrderGroup(parent_signal_id: typing.SupportsInt | typing.SupportsIndex = 0, policy: OrderGroupPolicy = ...) -> None

Members

  • add_limit_leg(self, symbol: typing.SupportsInt | typing.SupportsIndex, side: typing.SupportsInt | typing.SupportsIndex, price: typing.SupportsFloat | typing.SupportsIndex, qty: typing.SupportsFloat | typing.SupportsIndex) -> int
  • add_market_leg(self, symbol: typing.SupportsInt | typing.SupportsIndex, side: typing.SupportsInt | typing.SupportsIndex, qty: typing.SupportsFloat | typing.SupportsIndex) -> int
  • auto_dispatch(self, strategy: typing.Any) -> int
  • find_leg_by_order_id(self, order_id: typing.SupportsInt | typing.SupportsIndex) -> typing.Any
  • leg_count(self) -> int
  • leg_filled(self, leg_index: typing.SupportsInt | typing.SupportsIndex) -> float
  • leg_order_id(self, leg_index: typing.SupportsInt | typing.SupportsIndex) -> int
  • leg_state(self, leg_index: typing.SupportsInt | typing.SupportsIndex) -> LegState
  • mark_action_dispatched(self, leg_index: typing.SupportsInt | typing.SupportsIndex, kind: str) -> None
  • pair_latency_decision(self, leader_submit_ts_ns: typing.SupportsInt | typing.SupportsIndex, leader_ack_ts_ns: typing.SupportsInt | typing.SupportsIndex, ack_received: bool = False) -> str
  • parent_signal_id(self) -> int
  • policy(self) -> OrderGroupPolicy
  • precheck_submission(self, equity: typing.SupportsFloat | typing.SupportsIndex = 0.0, market_ref_prices: collections.abc.Sequence[typing.SupportsFloat | typing.SupportsIndex] = []) -> dict
  • recommended_actions(self) -> list
  • record_cancel(self, leg_index: typing.SupportsInt | typing.SupportsIndex) -> None
  • record_failure(self, leg_index: typing.SupportsInt | typing.SupportsIndex) -> None
  • record_fill(self, leg_index: typing.SupportsInt | typing.SupportsIndex, cumulative_qty: typing.SupportsFloat | typing.SupportsIndex) -> None
  • record_replace_accepted(self, leg_index: typing.SupportsInt | typing.SupportsIndex, new_order_id: typing.SupportsInt | typing.SupportsIndex) -> None
  • record_replace_rejected(self, leg_index: typing.SupportsInt | typing.SupportsIndex) -> None
  • record_submit(self, leg_index: typing.SupportsInt | typing.SupportsIndex, order_id: typing.SupportsInt | typing.SupportsIndex) -> None
  • set_pair_latency_budget_ns(self, budget_ns: typing.SupportsInt | typing.SupportsIndex) -> None
  • set_risk_limits(self, max_gross_notional: typing.SupportsFloat | typing.SupportsIndex = 0.0, max_concentration_pct: typing.SupportsFloat | typing.SupportsIndex = 0.0, max_leg_qty: typing.SupportsFloat | typing.SupportsIndex = 0.0) -> None
  • state(self) -> OrderGroupState

class OrderGroupPolicy

Members:

Constructor

  • OrderGroupPolicy(value: typing.SupportsInt | typing.SupportsIndex) -> None

Members

  • attr ALL_OR_NOTHING: typing.ClassVar[OrderGroupPolicy]
  • attr BEST_EFFORT: typing.ClassVar[OrderGroupPolicy]
  • attr ONE_SIDED: typing.ClassVar[OrderGroupPolicy]
  • attr __members__: typing.ClassVar[dict[str, OrderGroupPolicy]]
  • property name: str
  • property value: int

class OrderGroupState

Members:

Constructor

  • OrderGroupState(value: typing.SupportsInt | typing.SupportsIndex) -> None

Members

  • attr CANCELLED: typing.ClassVar[OrderGroupState]
  • attr FAILED: typing.ClassVar[OrderGroupState]
  • attr FILLED: typing.ClassVar[OrderGroupState]
  • attr PARTIALLY_FILLED: typing.ClassVar[OrderGroupState]
  • attr PENDING: typing.ClassVar[OrderGroupState]
  • attr REVERTING: typing.ClassVar[OrderGroupState]
  • attr SUBMITTED: typing.ClassVar[OrderGroupState]
  • attr __members__: typing.ClassVar[dict[str, OrderGroupState]]
  • property name: str
  • property value: int

class OrderJourneyTracer

Constructor

  • OrderJourneyTracer(max_orders: typing.SupportsInt | typing.SupportsIndex = 1000000, max_records_per_order: typing.SupportsInt | typing.SupportsIndex = 64, sample_rate: typing.SupportsFloat | typing.SupportsIndex = 1.0, sample_salt: typing.SupportsInt | typing.SupportsIndex = 11400714819323198485) -> None

Members

  • cancel_race_loss_rate(self) -> float
  • clear(self) -> None
  • journey(self, order_id: typing.SupportsInt | typing.SupportsIndex) -> numpy.ndarray[typing.Any, numpy.dtype[numpy.void]]
  • maker_fill_ratio(self) -> float
  • median_ack_latency_ns(self) -> float
  • median_time_to_first_fill_ns(self) -> float
  • order_count(self) -> int
  • record_count(self) -> int
  • result(self) -> numpy.ndarray[typing.Any, numpy.dtype[numpy.void]]

class OrderTracker

Constructor

  • OrderTracker() -> None

Members

  • active_count(self) -> int
  • get(self, order_id: typing.SupportsInt | typing.SupportsIndex) -> typing.Any
  • is_active(self, order_id: typing.SupportsInt | typing.SupportsIndex) -> bool
  • on_canceled(self, order_id: typing.SupportsInt | typing.SupportsIndex) -> bool
  • on_filled(self, order_id: typing.SupportsInt | typing.SupportsIndex, fill_quantity: typing.SupportsFloat | typing.SupportsIndex) -> bool
  • on_rejected(self, order_id: typing.SupportsInt | typing.SupportsIndex, reason: str) -> bool
  • on_submitted(self, order_id: typing.SupportsInt | typing.SupportsIndex, exchange_order_id: str, client_order_id: str = '') -> bool
  • prune_terminal(self) -> None
  • total_count(self) -> int

class OrderValidator

Constructor

  • OrderValidator() -> None

Members

  • validate(self, signal: Signal) -> bool

class ParkinsonVol

Constructor

  • ParkinsonVol(period: typing.SupportsInt | typing.SupportsIndex) -> None

Members

  • compute(self, arg0: typing.Annotated[numpy.typing.ArrayLike, numpy.float64], arg1: typing.Annotated[numpy.typing.ArrayLike, numpy.float64]) -> numpy.typing.NDArray[numpy.float64]
  • reset(self) -> None
  • update(self, high: typing.SupportsFloat | typing.SupportsIndex, low: typing.SupportsFloat | typing.SupportsIndex) -> float | None
  • property count: int
  • property ready: bool
  • property value: float | None

class Partitioner

Constructor

  • Partitioner(data_dir: str) -> None

Members

  • partition_by_calendar(self, unit: str, warmup_ns: typing.SupportsInt | typing.SupportsIndex = 0) -> list
  • partition_by_duration(self, duration_ns: typing.SupportsInt | typing.SupportsIndex, warmup_ns: typing.SupportsInt | typing.SupportsIndex = 0) -> list
  • partition_by_event_count(self, num_partitions: typing.SupportsInt | typing.SupportsIndex) -> list
  • partition_by_symbol(self, num_partitions: typing.SupportsInt | typing.SupportsIndex) -> list
  • partition_by_time(self, num_partitions: typing.SupportsInt | typing.SupportsIndex, warmup_ns: typing.SupportsInt | typing.SupportsIndex = 0) -> list
  • partition_per_symbol(self) -> list

class PeakAggregator(_AggregatorHandle)

Streaming top-N busiest fixed-width windows per scale. For each window_ns in the constructor list, finds the top_n time intervals that pack the most events into a window of that width. Peaks within 3*window_ns of a stronger one are deduped at finalize().

Constructor

  • PeakAggregator(window_ns_list: collections.abc.Sequence[typing.SupportsInt | typing.SupportsIndex], top_n: typing.SupportsInt | typing.SupportsIndex = 10, oversample_factor: typing.SupportsInt | typing.SupportsIndex = 100, event_filter: AggregatorEventFilter = ..., symbol_filter: collections.abc.Sequence[typing.SupportsInt | typing.SupportsIndex] = []) -> None

Members

  • result(self) -> dict

class PnLTracker

Constructor

  • PnLTracker() -> None

Members

  • on_signal(self, signal: Signal) -> None

class PositionGroupTracker

Constructor

  • PositionGroupTracker() -> None

Members

  • assign_to_group(self, position_id: typing.SupportsInt | typing.SupportsIndex, group_id: typing.SupportsInt | typing.SupportsIndex) -> bool
  • close_position(self, position_id: typing.SupportsInt | typing.SupportsIndex, exit_price: typing.SupportsFloat | typing.SupportsIndex) -> None
  • create_group(self, parent_id: typing.SupportsInt | typing.SupportsIndex = 0) -> int
  • get_position(self, position_id: typing.SupportsInt | typing.SupportsIndex) -> typing.Any
  • group_net_position(self, group_id: typing.SupportsInt | typing.SupportsIndex) -> float
  • group_realized_pnl(self, group_id: typing.SupportsInt | typing.SupportsIndex) -> float
  • group_unrealized_pnl(self, group_id: typing.SupportsInt | typing.SupportsIndex, current_price: typing.SupportsFloat | typing.SupportsIndex) -> float
  • net_position(self, symbol: typing.SupportsInt | typing.SupportsIndex) -> float
  • open_position(self, order_id: typing.SupportsInt | typing.SupportsIndex, symbol: typing.SupportsInt | typing.SupportsIndex, side: str, price: typing.SupportsFloat | typing.SupportsIndex, quantity: typing.SupportsFloat | typing.SupportsIndex) -> int
  • open_position_count(self, symbol: typing.Any = None) -> int
  • open_positions(self, symbol: typing.SupportsInt | typing.SupportsIndex) -> list
  • partial_close(self, position_id: typing.SupportsInt | typing.SupportsIndex, quantity: typing.SupportsFloat | typing.SupportsIndex, exit_price: typing.SupportsFloat | typing.SupportsIndex) -> None
  • prune_closed(self) -> None
  • realized_pnl(self, symbol: typing.SupportsInt | typing.SupportsIndex) -> float
  • total_realized_pnl(self) -> float

class PositionTracker

Constructor

  • PositionTracker(cost_basis: str = 'fifo') -> None

Members

  • avg_entry_price(self, symbol: typing.SupportsInt | typing.SupportsIndex) -> float
  • on_fill(self, symbol: typing.SupportsInt | typing.SupportsIndex, side: str, price: typing.SupportsFloat | typing.SupportsIndex, quantity: typing.SupportsFloat | typing.SupportsIndex) -> None
  • position(self, symbol: typing.SupportsInt | typing.SupportsIndex) -> float
  • realized_pnl(self, symbol: typing.SupportsInt | typing.SupportsIndex) -> float
  • total_realized_pnl(self) -> float

class QuantileAggregator(_AggregatorHandle)

Window-count distribution + quantile lookup. For each window_ns, observes the count of events inside a sliding window of that width at every event arrival, builds a histogram, and at finalize() resolves each requested quantile to the count threshold below which that fraction of observations lies.

Constructor

  • QuantileAggregator(window_ns_list: collections.abc.Sequence[typing.SupportsInt | typing.SupportsIndex], quantiles: collections.abc.Sequence[typing.SupportsFloat | typing.SupportsIndex], event_filter: AggregatorEventFilter = ..., symbol_filter: collections.abc.Sequence[typing.SupportsInt | typing.SupportsIndex] = []) -> None

Members

  • result(self) -> dict

class RMA

Constructor

  • RMA(period: typing.SupportsInt | typing.SupportsIndex) -> None

Members

  • compute(self, arg0: typing.Annotated[numpy.typing.ArrayLike, numpy.float64]) -> numpy.typing.NDArray[numpy.float64]
  • reset(self) -> None
  • update(self, value: typing.SupportsFloat | typing.SupportsIndex) -> float | None
  • property count: int
  • property ready: bool
  • property value: float | None

class RSI

Constructor

  • RSI(period: typing.SupportsInt | typing.SupportsIndex) -> None

Members

  • compute(self, arg0: typing.Annotated[numpy.typing.ArrayLike, numpy.float64]) -> numpy.typing.NDArray[numpy.float64]
  • reset(self) -> None
  • update(self, value: typing.SupportsFloat | typing.SupportsIndex) -> float | None
  • property count: int
  • property ready: bool
  • property value: float | None

class RateLimitEndpointFamily

Members:

Constructor

  • RateLimitEndpointFamily(value: typing.SupportsInt | typing.SupportsIndex) -> None

Members

  • attr Account: typing.ClassVar[RateLimitEndpointFamily]
  • attr MarketData: typing.ClassVar[RateLimitEndpointFamily]
  • attr Trading: typing.ClassVar[RateLimitEndpointFamily]
  • attr __members__: typing.ClassVar[dict[str, RateLimitEndpointFamily]]
  • property name: str
  • property value: int

class RateLimitPolicy

Constructor

  • RateLimitPolicy() -> None

Members

  • binance_um_futures() -> RateLimitPolicy
  • bybit_linear() -> RateLimitPolicy
  • deribit() -> RateLimitPolicy
  • okx_swap() -> RateLimitPolicy
  • add_bucket(self, name: str, window_ns: typing.SupportsInt | typing.SupportsIndex, capacity: typing.SupportsInt | typing.SupportsIndex, submit_weight: typing.SupportsInt | typing.SupportsIndex = 1, cancel_weight: typing.SupportsInt | typing.SupportsIndex = 1, replace_weight: typing.SupportsInt | typing.SupportsIndex = 2, family: RateLimitEndpointFamily = ..., query_weight: typing.SupportsInt | typing.SupportsIndex = 1) -> None
  • add_family_bucket(self, family: RateLimitEndpointFamily, name: str, window_ns: typing.SupportsInt | typing.SupportsIndex, capacity: typing.SupportsInt | typing.SupportsIndex, query_weight: typing.SupportsInt | typing.SupportsIndex = 1) -> None
  • ban_until_ns(self) -> int
  • bucket_count(self) -> int
  • bucket_states(self, now_ns: typing.SupportsInt | typing.SupportsIndex) -> list
  • consecutive_rejects(self) -> int
  • set_ban(self, after_consecutive_rejects: typing.SupportsInt | typing.SupportsIndex, ban_duration_ns: typing.SupportsInt | typing.SupportsIndex) -> None
  • try_consume(self, action: str, now_ns: typing.SupportsInt | typing.SupportsIndex) -> bool

class ReplayEvent

Constructor

  • ReplayEvent() -> None

Members

  • attr trade_is_buy: bool
  • attr type: str
  • property asks: list[tuple[float, float]]
  • property asks: None
  • property bids: list[tuple[float, float]]
  • property bids: None
  • property book_symbol: int
  • property book_symbol: None
  • property timestamp_ns: int
  • property timestamp_ns: None
  • property trade_price: float
  • property trade_price: None
  • property trade_quantity: float
  • property trade_quantity: None
  • property trade_symbol: int
  • property trade_symbol: None

class ReplaySource

Constructor

  • ReplaySource() -> None

Members

  • next(self) -> flox_py._flox_py.ReplayEvent | None
  • on_start(self) -> None
  • on_stop(self) -> None
  • seek_to(self, ts_ns: typing.SupportsInt | typing.SupportsIndex) -> bool

class RiskManager

Constructor

  • RiskManager() -> None

Members

  • allow(self, signal: Signal) -> bool

class RogersSatchellVol

Constructor

  • RogersSatchellVol(period: typing.SupportsInt | typing.SupportsIndex) -> None

Members

  • compute(self, arg0: typing.Annotated[numpy.typing.ArrayLike, numpy.float64], arg1: typing.Annotated[numpy.typing.ArrayLike, numpy.float64], arg2: typing.Annotated[numpy.typing.ArrayLike, numpy.float64], arg3: typing.Annotated[numpy.typing.ArrayLike, numpy.float64]) -> numpy.typing.NDArray[numpy.float64]
  • reset(self) -> None
  • update(self, open: typing.SupportsFloat | typing.SupportsIndex, high: typing.SupportsFloat | typing.SupportsIndex, low: typing.SupportsFloat | typing.SupportsIndex, close: typing.SupportsFloat | typing.SupportsIndex) -> float | None
  • property count: int
  • property ready: bool
  • property value: float | None

class RollingZScore

Constructor

  • RollingZScore(period: typing.SupportsInt | typing.SupportsIndex) -> None

Members

  • compute(self, arg0: typing.Annotated[numpy.typing.ArrayLike, numpy.float64]) -> numpy.typing.NDArray[numpy.float64]
  • reset(self) -> None
  • update(self, value: typing.SupportsFloat | typing.SupportsIndex) -> float | None
  • property count: int
  • property ready: bool
  • property value: float | None

class Runner

Constructor

  • Runner(registry: SymbolRegistry, on_signal: typing.Any, threaded: bool = False) -> None

Members

  • add_strategy(self, strategy: Strategy) -> None
  • attach_trace_recorder(self, recorder: typing.Any) -> None
  • on_bar(self, symbol: typing.Any, open: typing.SupportsFloat | typing.SupportsIndex, high: typing.SupportsFloat | typing.SupportsIndex, low: typing.SupportsFloat | typing.SupportsIndex, close: typing.SupportsFloat | typing.SupportsIndex, volume: typing.SupportsFloat | typing.SupportsIndex = 0.0, buy_volume: typing.SupportsFloat | typing.SupportsIndex = 0.0, start_time_ns: typing.SupportsInt | typing.SupportsIndex = 0, end_time_ns: typing.SupportsInt | typing.SupportsIndex = 0, bar_type: typing.SupportsInt | typing.SupportsIndex = 0, bar_type_param: typing.SupportsInt | typing.SupportsIndex = 0, close_reason: typing.SupportsInt | typing.SupportsIndex = 0) -> None
  • on_book_snapshot(self, symbol: typing.Any, bid_prices: collections.abc.Sequence[typing.SupportsFloat | typing.SupportsIndex], bid_qtys: collections.abc.Sequence[typing.SupportsFloat | typing.SupportsIndex], ask_prices: collections.abc.Sequence[typing.SupportsFloat | typing.SupportsIndex], ask_qtys: collections.abc.Sequence[typing.SupportsFloat | typing.SupportsIndex], ts_ns: typing.SupportsInt | typing.SupportsIndex = 0) -> None
  • on_trade(self, symbol: typing.Any, price: typing.SupportsFloat | typing.SupportsIndex, qty: typing.SupportsFloat | typing.SupportsIndex, is_buy: bool, ts_ns: typing.SupportsInt | typing.SupportsIndex = 0) -> None
  • replace_strategy(self, index: typing.SupportsInt | typing.SupportsIndex, strategy: Strategy) -> None
  • set_executor(self, executor: Executor) -> None
  • set_kill_switch(self, ks: KillSwitch) -> None
  • set_market_data_recorder(self, recorder: MarketDataRecorderHook) -> None
  • set_market_data_recorder(self, recorder: BinaryLogRecorderHook) -> None
  • set_order_validator(self, ov: OrderValidator) -> None
  • set_pnl_tracker(self, tracker: PnLTracker) -> None
  • set_risk_manager(self, rm: RiskManager) -> None
  • set_storage_sink(self, sink: StorageSink) -> None
  • set_trace_feed_ts_ns(self, feed_ts_ns: typing.SupportsInt | typing.SupportsIndex) -> None
  • start(self) -> None
  • stop(self) -> None
  • trace_fill(self, order_id: typing.SupportsInt | typing.SupportsIndex, fill_id: typing.SupportsInt | typing.SupportsIndex, price: typing.SupportsFloat | typing.SupportsIndex, qty: typing.SupportsFloat | typing.SupportsIndex, fee: typing.SupportsFloat | typing.SupportsIndex, symbol_id: typing.SupportsInt | typing.SupportsIndex, side: typing.SupportsInt | typing.SupportsIndex, liquidity: typing.SupportsInt | typing.SupportsIndex = 0) -> None
  • trace_order_event(self, order_id: typing.SupportsInt | typing.SupportsIndex, parent_signal_id: typing.SupportsInt | typing.SupportsIndex, symbol_id: typing.SupportsInt | typing.SupportsIndex, event_kind: typing.SupportsInt | typing.SupportsIndex, side: typing.SupportsInt | typing.SupportsIndex, order_type: typing.SupportsInt | typing.SupportsIndex, price: typing.SupportsFloat | typing.SupportsIndex, qty: typing.SupportsFloat | typing.SupportsIndex, flags: typing.SupportsInt | typing.SupportsIndex = 0) -> None

class SMA

Constructor

  • SMA(period: typing.SupportsInt | typing.SupportsIndex) -> None

Members

  • compute(self, arg0: typing.Annotated[numpy.typing.ArrayLike, numpy.float64]) -> numpy.typing.NDArray[numpy.float64]
  • reset(self) -> None
  • update(self, value: typing.SupportsFloat | typing.SupportsIndex) -> float | None
  • property count: int
  • property ready: bool
  • property value: float | None

class ShannonEntropy

Constructor

  • ShannonEntropy(period: typing.SupportsInt | typing.SupportsIndex, bins: typing.SupportsInt | typing.SupportsIndex = 10) -> None

Members

  • compute(self, arg0: typing.Annotated[numpy.typing.ArrayLike, numpy.float64]) -> numpy.typing.NDArray[numpy.float64]
  • reset(self) -> None
  • update(self, value: typing.SupportsFloat | typing.SupportsIndex) -> float | None
  • property count: int
  • property ready: bool
  • property value: float | None

class Signal

Constructor

  • Signal() -> None

Members

  • attr order_type: str
  • attr side: str
  • property new_price: float
  • property new_price: None
  • property new_quantity: float
  • property new_quantity: None
  • property order_id: int
  • property order_id: None
  • property price: float
  • property price: None
  • property quantity: float
  • property quantity: None
  • property symbol: int
  • property symbol: None
  • property trailing_bps: int
  • property trailing_bps: None
  • property trailing_offset: float
  • property trailing_offset: None
  • property trigger_price: float
  • property trigger_price: None

class SignalBuilder

Constructor

  • SignalBuilder() -> None

Members

  • buy(self, ts: typing.SupportsInt | typing.SupportsIndex, qty: typing.SupportsFloat | typing.SupportsIndex, symbol: str = '') -> None
  • clear(self) -> None
  • limit_buy(self, ts: typing.SupportsInt | typing.SupportsIndex, price: typing.SupportsFloat | typing.SupportsIndex, qty: typing.SupportsFloat | typing.SupportsIndex, symbol: str = '') -> None
  • limit_sell(self, ts: typing.SupportsInt | typing.SupportsIndex, price: typing.SupportsFloat | typing.SupportsIndex, qty: typing.SupportsFloat | typing.SupportsIndex, symbol: str = '') -> None
  • sell(self, ts: typing.SupportsInt | typing.SupportsIndex, qty: typing.SupportsFloat | typing.SupportsIndex, symbol: str = '') -> None

class SimulatedExecutor

Constructor

  • SimulatedExecutor() -> None

Members

  • advance_clock(self, timestamp_ns: typing.SupportsInt | typing.SupportsIndex) -> None
  • apply_latency_profile(self, name: str) -> None
  • bracket_state(self, bracket_id: typing.SupportsInt | typing.SupportsIndex) -> str
  • cancel_all(self, symbol: typing.SupportsInt | typing.SupportsIndex) -> None
  • cancel_bracket(self, bracket_id: typing.SupportsInt | typing.SupportsIndex) -> None
  • cancel_order(self, order_id: typing.SupportsInt | typing.SupportsIndex) -> None
  • clear_rate_limit_policy(self) -> None
  • fills(self) -> numpy.ndarray[typing.Any, numpy.dtype[numpy.void]]
  • fills_list(self) -> list
  • fok_mode(self) -> str
  • iceberg_hidden_remaining_raw(self, order_id: typing.SupportsInt | typing.SupportsIndex) -> int
  • on_bar(self, symbol: typing.SupportsInt | typing.SupportsIndex, close_price: typing.SupportsFloat | typing.SupportsIndex) -> None
  • on_best_levels(self, symbol: typing.SupportsInt | typing.SupportsIndex, bid_price: typing.SupportsFloat | typing.SupportsIndex, bid_qty: typing.SupportsFloat | typing.SupportsIndex, ask_price: typing.SupportsFloat | typing.SupportsIndex, ask_qty: typing.SupportsFloat | typing.SupportsIndex) -> None
  • on_book_snapshot(self, symbol: typing.SupportsInt | typing.SupportsIndex, bid_levels: collections.abc.Sequence[tuple[typing.SupportsFloat | typing.SupportsIndex, typing.SupportsFloat | typing.SupportsIndex]], ask_levels: collections.abc.Sequence[tuple[typing.SupportsFloat | typing.SupportsIndex, typing.SupportsFloat | typing.SupportsIndex]]) -> None
  • on_trade(self, symbol: typing.SupportsInt | typing.SupportsIndex, price: typing.SupportsFloat | typing.SupportsIndex, is_buy: bool) -> None
  • on_trade_qty(self, symbol: typing.SupportsInt | typing.SupportsIndex, price: typing.SupportsFloat | typing.SupportsIndex, quantity: typing.SupportsFloat | typing.SupportsIndex, is_buy: bool) -> None
  • set_bracket_child_arm_mode(self, mode: str) -> None
  • set_cancel_ack_latency(self, latency_ns: typing.SupportsInt | typing.SupportsIndex, jitter_ns: typing.SupportsInt | typing.SupportsIndex = 0) -> None
  • set_cancel_ack_latency_distribution(self, dist: LatencyDistribution) -> None
  • set_default_slippage(self, model: str, ticks: typing.SupportsInt | typing.SupportsIndex = 0, tick_size: typing.SupportsFloat | typing.SupportsIndex = 0.0, bps: typing.SupportsFloat | typing.SupportsIndex = 0.0, impact_coeff: typing.SupportsFloat | typing.SupportsIndex = 0.0) -> None
  • set_fok_mode(self, mode: str) -> None
  • set_iceberg_jitter_seed(self, seed: typing.SupportsInt | typing.SupportsIndex) -> None
  • set_iceberg_priority_mode(self, mode: str) -> None
  • set_iceberg_refresh_latency(self, latency_ns: typing.SupportsInt | typing.SupportsIndex) -> None
  • set_iceberg_size_randomisation_pct(self, pct: typing.SupportsFloat | typing.SupportsIndex) -> None
  • set_lmm_bonus_multiplier(self, multiplier: typing.SupportsFloat | typing.SupportsIndex) -> None
  • set_lmm_orders(self, ids: collections.abc.Sequence[typing.SupportsInt | typing.SupportsIndex]) -> None
  • set_order_priority_multiplier(self, order_id: typing.SupportsInt | typing.SupportsIndex, multiplier: typing.SupportsFloat | typing.SupportsIndex) -> None
  • set_queue_fifo_top_n(self, top_n: typing.SupportsInt | typing.SupportsIndex) -> None
  • set_queue_model(self, model: str, depth: typing.SupportsInt | typing.SupportsIndex = 1) -> None
  • set_queue_position_min_change_fraction(self, fraction: typing.SupportsFloat | typing.SupportsIndex) -> None
  • set_rate_limit_policy(self, policy: ...) -> None
  • set_replace_ack_latency(self, latency_ns: typing.SupportsInt | typing.SupportsIndex, jitter_ns: typing.SupportsInt | typing.SupportsIndex = 0) -> None
  • set_replace_ack_latency_distribution(self, dist: LatencyDistribution) -> None
  • set_stp_group_membership(self, account_id: typing.SupportsInt | typing.SupportsIndex, group_id: typing.SupportsInt | typing.SupportsIndex) -> None
  • set_stp_mode(self, mode: str) -> None
  • set_submit_ack_latency(self, latency_ns: typing.SupportsInt | typing.SupportsIndex, jitter_ns: typing.SupportsInt | typing.SupportsIndex = 0) -> None
  • set_submit_ack_latency_distribution(self, dist: LatencyDistribution) -> None
  • set_symbol_slippage(self, symbol: typing.SupportsInt | typing.SupportsIndex, model: str, ticks: typing.SupportsInt | typing.SupportsIndex = 0, tick_size: typing.SupportsFloat | typing.SupportsIndex = 0.0, bps: typing.SupportsFloat | typing.SupportsIndex = 0.0, impact_coeff: typing.SupportsFloat | typing.SupportsIndex = 0.0) -> None
  • set_top_priority_share(self, share: typing.SupportsFloat | typing.SupportsIndex) -> None
  • set_venue_availability(self, availability: ...) -> None
  • stp_group_for(self, account_id: typing.SupportsInt | typing.SupportsIndex) -> int
  • submit_bracket(self, bracket_id: typing.SupportsInt | typing.SupportsIndex, symbol: typing.SupportsInt | typing.SupportsIndex, entry_side: str, entry_type: str, entry_price: typing.SupportsFloat | typing.SupportsIndex, quantity: typing.SupportsFloat | typing.SupportsIndex, tp_side: str, tp_type: str, tp_price: typing.SupportsFloat | typing.SupportsIndex, stop_side: str, stop_type: str, stop_trigger_price: typing.SupportsFloat | typing.SupportsIndex) -> None
  • submit_iceberg(self, order_id: typing.SupportsInt | typing.SupportsIndex, side: str, price: typing.SupportsFloat | typing.SupportsIndex, total_quantity: typing.SupportsFloat | typing.SupportsIndex, visible_quantity: typing.SupportsFloat | typing.SupportsIndex, symbol: typing.SupportsInt | typing.SupportsIndex = 1) -> None
  • submit_order(self, id: typing.SupportsInt | typing.SupportsIndex, side: str, price: typing.SupportsFloat | typing.SupportsIndex, quantity: typing.SupportsFloat | typing.SupportsIndex, type: str = 'market', symbol: typing.SupportsInt | typing.SupportsIndex = 1, tif: str = 'gtc', reduce_only: bool = False, expires_at_ns: typing.SupportsInt | typing.SupportsIndex = 0, account_id: typing.SupportsInt | typing.SupportsIndex = 0) -> None
  • property fill_count: int

class Skewness

Constructor

  • Skewness(period: typing.SupportsInt | typing.SupportsIndex) -> None

Members

  • compute(self, arg0: typing.Annotated[numpy.typing.ArrayLike, numpy.float64]) -> numpy.typing.NDArray[numpy.float64]
  • reset(self) -> None
  • update(self, value: typing.SupportsFloat | typing.SupportsIndex) -> float | None
  • property count: int
  • property ready: bool
  • property value: float | None

class Slope

Constructor

  • Slope(length: typing.SupportsInt | typing.SupportsIndex) -> None

Members

  • compute(self, arg0: typing.Annotated[numpy.typing.ArrayLike, numpy.float64]) -> numpy.typing.NDArray[numpy.float64]
  • reset(self) -> None
  • update(self, value: typing.SupportsFloat | typing.SupportsIndex) -> float | None
  • property count: int
  • property ready: bool
  • property value: float | None

class Stats

Members

  • to_dict(self) -> dict
  • property avg_loss: float
  • property avg_win: float
  • property calmar: float
  • property final_capital: float
  • property gross_loss: float
  • property gross_profit: float
  • property initial_capital: float
  • property losing_trades: int
  • property max_drawdown: float
  • property max_drawdown_pct: float
  • property net_pnl: float
  • property profit_factor: float
  • property return_pct: float
  • property sharpe: float
  • property sortino: float
  • property total_fees: float
  • property total_pnl: float
  • property total_trades: int
  • property win_rate: float
  • property winning_trades: int

class Stochastic

Constructor

  • Stochastic(k_period: typing.SupportsInt | typing.SupportsIndex = 14, d_period: typing.SupportsInt | typing.SupportsIndex = 3) -> None

Members

  • compute(self, arg0: typing.Annotated[numpy.typing.ArrayLike, numpy.float64], arg1: typing.Annotated[numpy.typing.ArrayLike, numpy.float64], arg2: typing.Annotated[numpy.typing.ArrayLike, numpy.float64]) -> dict
  • reset(self) -> None
  • update(self, high: typing.SupportsFloat | typing.SupportsIndex, low: typing.SupportsFloat | typing.SupportsIndex, close: typing.SupportsFloat | typing.SupportsIndex) -> float | None
  • property count: int
  • property d: float | None
  • property k: float | None
  • property ready: bool
  • property value: float | None

class StorageSink

Constructor

  • StorageSink() -> None

Members

  • store(self, signal: Signal) -> None

class Strategy

Constructor

  • Strategy(symbols: list) -> None

Members

  • bar_ring_capacity(self) -> int
  • best_ask(self, symbol: str | None = None) -> float
  • best_bid(self, symbol: str | None = None) -> float
  • cancel_all_orders(self, symbol: str | None = None) -> None
  • cancel_order(self, order_id: typing.SupportsInt | typing.SupportsIndex) -> None
  • close_position(self, symbol: str | None = None) -> int
  • ctx(self, symbol: typing.SupportsInt | typing.SupportsIndex | None = None) -> SymbolContext
  • emit_cancel(self, order_id: typing.SupportsInt | typing.SupportsIndex) -> None
  • emit_cancel_all(self, symbol: typing.SupportsInt | typing.SupportsIndex) -> None
  • emit_close_position(self, symbol: typing.SupportsInt | typing.SupportsIndex) -> int
  • emit_limit_buy(self, symbol: typing.SupportsInt | typing.SupportsIndex, price: typing.SupportsFloat | typing.SupportsIndex, quantity: typing.SupportsFloat | typing.SupportsIndex) -> int
  • emit_limit_buy_tif(self, symbol: typing.SupportsInt | typing.SupportsIndex, price: typing.SupportsFloat | typing.SupportsIndex, quantity: typing.SupportsFloat | typing.SupportsIndex, tif: str = 'gtc') -> int
  • emit_limit_sell(self, symbol: typing.SupportsInt | typing.SupportsIndex, price: typing.SupportsFloat | typing.SupportsIndex, quantity: typing.SupportsFloat | typing.SupportsIndex) -> int
  • emit_limit_sell_tif(self, symbol: typing.SupportsInt | typing.SupportsIndex, price: typing.SupportsFloat | typing.SupportsIndex, quantity: typing.SupportsFloat | typing.SupportsIndex, tif: str = 'gtc') -> int
  • emit_market_buy(self, symbol: typing.SupportsInt | typing.SupportsIndex, quantity: typing.SupportsFloat | typing.SupportsIndex) -> int
  • emit_market_sell(self, symbol: typing.SupportsInt | typing.SupportsIndex, quantity: typing.SupportsFloat | typing.SupportsIndex) -> int
  • emit_modify(self, order_id: typing.SupportsInt | typing.SupportsIndex, new_price: typing.SupportsFloat | typing.SupportsIndex, new_quantity: typing.SupportsFloat | typing.SupportsIndex) -> None
  • emit_provide_liquidity(self, pool: typing.SupportsInt | typing.SupportsIndex, price_lower: typing.SupportsFloat | typing.SupportsIndex, price_upper: typing.SupportsFloat | typing.SupportsIndex, liquidity: typing.SupportsFloat | typing.SupportsIndex) -> int
  • emit_stop_limit(self, symbol: typing.SupportsInt | typing.SupportsIndex, side: str, trigger: typing.SupportsFloat | typing.SupportsIndex, limit_price: typing.SupportsFloat | typing.SupportsIndex, quantity: typing.SupportsFloat | typing.SupportsIndex) -> int
  • emit_stop_market(self, symbol: typing.SupportsInt | typing.SupportsIndex, side: str, trigger: typing.SupportsFloat | typing.SupportsIndex, quantity: typing.SupportsFloat | typing.SupportsIndex) -> int
  • emit_take_profit_limit(self, symbol: typing.SupportsInt | typing.SupportsIndex, side: str, trigger: typing.SupportsFloat | typing.SupportsIndex, limit_price: typing.SupportsFloat | typing.SupportsIndex, quantity: typing.SupportsFloat | typing.SupportsIndex) -> int
  • emit_take_profit_market(self, symbol: typing.SupportsInt | typing.SupportsIndex, side: str, trigger: typing.SupportsFloat | typing.SupportsIndex, quantity: typing.SupportsFloat | typing.SupportsIndex) -> int
  • emit_trailing_stop(self, symbol: typing.SupportsInt | typing.SupportsIndex, side: str, offset: typing.SupportsFloat | typing.SupportsIndex, quantity: typing.SupportsFloat | typing.SupportsIndex) -> int
  • emit_trailing_stop_percent(self, symbol: typing.SupportsInt | typing.SupportsIndex, side: str, callback_bps: typing.SupportsInt | typing.SupportsIndex, quantity: typing.SupportsFloat | typing.SupportsIndex) -> int
  • emit_withdraw_liquidity(self, pool: typing.SupportsInt | typing.SupportsIndex, liquidity: typing.SupportsFloat | typing.SupportsIndex) -> int
  • get_order_status(self, order_id: typing.SupportsInt | typing.SupportsIndex) -> int
  • last_closed_bar(self, symbol_id: typing.SupportsInt | typing.SupportsIndex, bar_type: typing.SupportsInt | typing.SupportsIndex = 0, param: typing.SupportsInt | typing.SupportsIndex = 0) -> dict | None
  • last_n_closed_bars(self, symbol_id: typing.SupportsInt | typing.SupportsIndex, bar_type: typing.SupportsInt | typing.SupportsIndex, param: typing.SupportsInt | typing.SupportsIndex, n: typing.SupportsInt | typing.SupportsIndex) -> list
  • last_price(self, symbol: str | None = None) -> float
  • limit_buy(self, price: typing.SupportsFloat | typing.SupportsIndex, qty: typing.SupportsFloat | typing.SupportsIndex, symbol: str | None = None, tif: str = 'gtc') -> int
  • limit_sell(self, price: typing.SupportsFloat | typing.SupportsIndex, qty: typing.SupportsFloat | typing.SupportsIndex, symbol: str | None = None, tif: str = 'gtc') -> int
  • market_buy(self, qty: typing.SupportsFloat | typing.SupportsIndex, symbol: str | None = None) -> int
  • market_sell(self, qty: typing.SupportsFloat | typing.SupportsIndex, symbol: str | None = None) -> int
  • mid_price(self, symbol: str | None = None) -> float
  • modify_order(self, order_id: typing.SupportsInt | typing.SupportsIndex, new_price: typing.SupportsFloat | typing.SupportsIndex, new_qty: typing.SupportsFloat | typing.SupportsIndex) -> None
  • on_bar(self, ctx: SymbolContext, bar: BarData) -> None
  • on_book_update(self, ctx: SymbolContext) -> None
  • on_fill(self, ctx: SymbolContext, event: OrderEventData) -> None
  • on_market_position_change(self, ctx: SymbolContext, event: OrderEventData) -> None
  • on_order_update(self, ctx: SymbolContext, event: OrderEventData) -> None
  • on_queue_position_change(self, ctx: SymbolContext, event: OrderEventData) -> None
  • on_start(self) -> None
  • on_stop(self) -> None
  • on_trade(self, ctx: SymbolContext, trade: TradeData) -> None
  • order_status(self, order_id: typing.SupportsInt | typing.SupportsIndex) -> int
  • pos(self, symbol: str | None = None) -> float
  • position(self, symbol: typing.SupportsInt | typing.SupportsIndex | None = None) -> float
  • set_bar_ring_capacity(self, n: typing.SupportsInt | typing.SupportsIndex) -> None
  • stop_limit(self, side: str, trigger: typing.SupportsFloat | typing.SupportsIndex, limit_price: typing.SupportsFloat | typing.SupportsIndex, qty: typing.SupportsFloat | typing.SupportsIndex, symbol: str | None = None) -> int
  • stop_market(self, side: str, trigger: typing.SupportsFloat | typing.SupportsIndex, qty: typing.SupportsFloat | typing.SupportsIndex, symbol: str | None = None) -> int
  • take_profit_limit(self, side: str, trigger: typing.SupportsFloat | typing.SupportsIndex, limit_price: typing.SupportsFloat | typing.SupportsIndex, qty: typing.SupportsFloat | typing.SupportsIndex, symbol: str | None = None) -> int
  • take_profit_market(self, side: str, trigger: typing.SupportsFloat | typing.SupportsIndex, qty: typing.SupportsFloat | typing.SupportsIndex, symbol: str | None = None) -> int
  • trailing_stop(self, side: str, offset: typing.SupportsFloat | typing.SupportsIndex, qty: typing.SupportsFloat | typing.SupportsIndex, symbol: str | None = None) -> int
  • trailing_stop_percent(self, side: str, callback_bps: typing.SupportsInt | typing.SupportsIndex, qty: typing.SupportsFloat | typing.SupportsIndex, symbol: str | None = None) -> int
  • property primary_symbol_name: str
  • property symbol_names: list[str]
  • property symbols: list[int]

class Symbol

Members

  • property exchange: str
  • property id: int
  • property name: str
  • property tick_size: float

class SymbolContext

Constructor

  • SymbolContext() -> None

Members

  • attr symbol: str
  • book_spread(self) -> float
  • is_flat(self) -> bool
  • is_long(self) -> bool
  • is_short(self) -> bool
  • property best_ask: float
  • property best_ask: None
  • property best_bid: float
  • property best_bid: None
  • property last_trade_price: float
  • property last_trade_price: None
  • property mid_price: float
  • property mid_price: None
  • property position: float
  • property position: None
  • property symbol_id: int
  • property symbol_id: None
  • property unrealized_pnl: float
  • property unrealized_pnl: None

class SymbolRegistry

Constructor

  • SymbolRegistry() -> None

Members

  • add_symbol(self, exchange: str, symbol: str, tick_size: typing.SupportsFloat | typing.SupportsIndex = 0.01) -> Symbol
  • symbol_count(self) -> int

class TEMA

Constructor

  • TEMA(period: typing.SupportsInt | typing.SupportsIndex) -> None

Members

  • compute(self, arg0: typing.Annotated[numpy.typing.ArrayLike, numpy.float64]) -> numpy.typing.NDArray[numpy.float64]
  • reset(self) -> None
  • update(self, value: typing.SupportsFloat | typing.SupportsIndex) -> float | None
  • property count: int
  • property ready: bool
  • property value: float | None

class TapeRef

Constructor

  • TapeRef(path: str, content_hash: str = '', first_event_ns: typing.SupportsInt | typing.SupportsIndex = 0, last_event_ns: typing.SupportsInt | typing.SupportsIndex = 0) -> None

Members

  • attr content_hash: str
  • attr path: str
  • property first_event_ns: int
  • property first_event_ns: None
  • property last_event_ns: int
  • property last_event_ns: None

class TraceReader

Constructor

  • TraceReader(path: str) -> None

Members

  • read_all_fills(self) -> list
  • read_all_order_events(self) -> list
  • read_all_signals(self) -> list
  • property run_ended_ns: int
  • property run_started_ns: int
  • property strategy_hash: str
  • property strategy_id: str
  • property tape_refs: list

class TraceRecorder

Constructor

  • TraceRecorder(path: str, strategy_id: str = '', strategy_hash: str = '', run_started_ns: typing.SupportsInt | typing.SupportsIndex = 0, tape_refs: collections.abc.Sequence[TapeRef] = []) -> None

Members

  • close(self) -> None
  • set_run_ended_ns(self, arg0: typing.SupportsInt | typing.SupportsIndex) -> None
  • write_fill(self, run_ts_ns: typing.SupportsInt | typing.SupportsIndex, feed_ts_ns: typing.SupportsInt | typing.SupportsIndex = 0, order_id: typing.SupportsInt | typing.SupportsIndex = 0, fill_id: typing.SupportsInt | typing.SupportsIndex = 0, price_raw: typing.SupportsInt | typing.SupportsIndex = 0, qty_raw: typing.SupportsInt | typing.SupportsIndex = 0, fee_raw: typing.SupportsInt | typing.SupportsIndex = 0, symbol_id: typing.SupportsInt | typing.SupportsIndex = 0, side: typing.SupportsInt | typing.SupportsIndex = 0, liquidity: FillLiquidity = ...) -> None
  • write_order_event(self, run_ts_ns: typing.SupportsInt | typing.SupportsIndex, feed_ts_ns: typing.SupportsInt | typing.SupportsIndex = 0, order_id: typing.SupportsInt | typing.SupportsIndex = 0, parent_signal_id: typing.SupportsInt | typing.SupportsIndex = 0, price_raw: typing.SupportsInt | typing.SupportsIndex = 0, qty_raw: typing.SupportsInt | typing.SupportsIndex = 0, symbol_id: typing.SupportsInt | typing.SupportsIndex = 0, event_kind: OrderEventKind = ..., side: typing.SupportsInt | typing.SupportsIndex = 0, order_type: typing.SupportsInt | typing.SupportsIndex = 0, flags: typing.SupportsInt | typing.SupportsIndex = 0, reason: str = '') -> None
  • write_signal(self, run_ts_ns: typing.SupportsInt | typing.SupportsIndex, feed_ts_ns: typing.SupportsInt | typing.SupportsIndex = 0, signal_id: typing.SupportsInt | typing.SupportsIndex = 0, flags: typing.SupportsInt | typing.SupportsIndex = 0, strength_raw: typing.SupportsInt | typing.SupportsIndex = 0, name: str = '', symbol_ids: collections.abc.Sequence[typing.SupportsInt | typing.SupportsIndex] = [], payload: bytes = b'') -> None

class TradeData

Constructor

  • TradeData() -> None

Members

  • attr is_buy: bool
  • attr side: str
  • attr symbol_name: str
  • property exchange_ts_ns: int
  • property exchange_ts_ns: None
  • property price: float
  • property price: None
  • property quantity: float
  • property quantity: None
  • property symbol: int
  • property symbol: None
  • property timestamp_ns: int
  • property timestamp_ns: None

class VenueAvailability

Constructor

  • VenueAvailability() -> None

Members

  • auto_random_outages(self, per_day: typing.SupportsFloat | typing.SupportsIndex, mean_duration_ns: typing.SupportsInt | typing.SupportsIndex, on_open_orders: str = 'cancel_all', seed: typing.SupportsInt | typing.SupportsIndex = 12648430) -> VenueAvailability
  • book_updates_allowed(self, now_ns: typing.SupportsInt | typing.SupportsIndex) -> bool
  • cancels_allowed(self, now_ns: typing.SupportsInt | typing.SupportsIndex) -> bool
  • consume_wrong_side_recovery_bps(self) -> float
  • is_up(self, now_ns: typing.SupportsInt | typing.SupportsIndex) -> bool
  • latency_multiplier(self, now_ns: typing.SupportsInt | typing.SupportsIndex) -> float
  • schedule_outage(self, start_ns: typing.SupportsInt | typing.SupportsIndex, duration_ns: typing.SupportsInt | typing.SupportsIndex, on_open_orders: str = 'cancel_all', gtc_ttl_ns: typing.SupportsInt | typing.SupportsIndex = 0) -> VenueAvailability
  • schedule_outage_ex(self, start_ns: typing.SupportsInt | typing.SupportsIndex, duration_ns: typing.SupportsInt | typing.SupportsIndex, outage_type: str = 'total', on_open_orders: str = 'cancel_all', gtc_ttl_ns: typing.SupportsInt | typing.SupportsIndex = 0, degradation_latency_multiplier: typing.SupportsFloat | typing.SupportsIndex = 1.0, wrong_side_recovery_bps: typing.SupportsFloat | typing.SupportsIndex = 0.0) -> VenueAvailability
  • submits_allowed(self, now_ns: typing.SupportsInt | typing.SupportsIndex) -> bool
  • trades_allowed(self, now_ns: typing.SupportsInt | typing.SupportsIndex) -> bool

class VenueExecutor

Executor handed out by VenueStack.executor(). Same simulated

Members

  • cancel_all(self, symbol: typing.SupportsInt | typing.SupportsIndex) -> None
  • cancel_order(self, order_id: typing.SupportsInt | typing.SupportsIndex) -> None
  • clear_rate_limit_policy(self) -> None
  • fills_list(self) -> list
  • on_bar(self, symbol: typing.SupportsInt | typing.SupportsIndex, close_price: typing.SupportsFloat | typing.SupportsIndex) -> None
  • on_trade(self, symbol: typing.SupportsInt | typing.SupportsIndex, price: typing.SupportsFloat | typing.SupportsIndex, is_buy: bool) -> None
  • on_trade_qty(self, symbol: typing.SupportsInt | typing.SupportsIndex, price: typing.SupportsFloat | typing.SupportsIndex, quantity: typing.SupportsFloat | typing.SupportsIndex, is_buy: bool) -> None
  • set_rate_limit_policy(self, policy: RateLimitPolicy) -> None
  • set_venue_availability(self, venue_availability: VenueAvailability) -> None
  • submit_order(self, id: typing.SupportsInt | typing.SupportsIndex, side: str, price: typing.SupportsFloat | typing.SupportsIndex, quantity: typing.SupportsFloat | typing.SupportsIndex, type: str = 'market', symbol: typing.SupportsInt | typing.SupportsIndex = 1, tif: str = 'gtc', reduce_only: bool = False, expires_at_ns: typing.SupportsInt | typing.SupportsIndex = 0, account_id: typing.SupportsInt | typing.SupportsIndex = 0) -> None
  • property fill_count: int

class VenueStack

Single-call venue-realistic backtest stack.

Members

  • binance_um_futures(account_id: typing.SupportsInt | typing.SupportsIndex, equity: typing.SupportsFloat | typing.SupportsIndex) -> VenueStack
  • bybit_linear(account_id: typing.SupportsInt | typing.SupportsIndex, equity: typing.SupportsFloat | typing.SupportsIndex) -> VenueStack
  • deribit(account_id: typing.SupportsInt | typing.SupportsIndex, equity: typing.SupportsFloat | typing.SupportsIndex) -> VenueStack
  • from_venue(name: str, account_id: typing.SupportsInt | typing.SupportsIndex, equity: typing.SupportsFloat | typing.SupportsIndex) -> VenueStack
  • okx_swap(account_id: typing.SupportsInt | typing.SupportsIndex, equity: typing.SupportsFloat | typing.SupportsIndex) -> VenueStack
  • account(self) -> Account
  • clock(self) -> ...
  • executor(self) -> VenueExecutor
  • fees(self) -> FeeSchedule
  • funding(self) -> FundingSchedule
  • liquidation(self) -> LiquidationEngine
  • venue(self) -> VenueAvailability
  • venue_name(self) -> str

class VolSurface

SVI implied-volatility surface: a term structure of calibrated slices that interpolates vol in total-variance space. Mark a backtest to this instead of a flat vol.

Constructor

  • VolSurface() -> None

Members

  • add_slice(self, t: typing.SupportsFloat | typing.SupportsIndex, a: typing.SupportsFloat | typing.SupportsIndex, b: typing.SupportsFloat | typing.SupportsIndex, rho: typing.SupportsFloat | typing.SupportsIndex, m: typing.SupportsFloat | typing.SupportsIndex, sigma: typing.SupportsFloat | typing.SupportsIndex) -> None
  • implied_vol(self, log_moneyness: typing.SupportsFloat | typing.SupportsIndex, t: typing.SupportsFloat | typing.SupportsIndex) -> float
  • is_calendar_free(self, k_lo: typing.SupportsFloat | typing.SupportsIndex = -1.5, k_hi: typing.SupportsFloat | typing.SupportsIndex = 1.5, samples: typing.SupportsInt | typing.SupportsIndex = 50) -> bool
  • slice_count(self) -> int
  • total_variance(self, log_moneyness: typing.SupportsFloat | typing.SupportsIndex, t: typing.SupportsFloat | typing.SupportsIndex) -> float

class VolumeBinAggregator(_AggregatorHandle)

Time-bucketed trade quantity sum. Same bucketing structure as BinCountAggregator but sums trade.qty_raw per cell instead of counting. Books are ignored (no scalar qty per book event).

Constructor

  • VolumeBinAggregator(bucket_ns: typing.SupportsInt | typing.SupportsIndex, by_side: bool = False, by_symbol: bool = False, event_filter: AggregatorEventFilter = ..., symbol_filter: collections.abc.Sequence[typing.SupportsInt | typing.SupportsIndex] = []) -> None

Members

  • result(self) -> numpy.ndarray[typing.Any, numpy.dtype[numpy.void]]

class VolumeProfile

Volume Profile aggregator. Tracks volume distribution across price levels.

Constructor

  • VolumeProfile(tick_size: typing.SupportsFloat | typing.SupportsIndex) -> None

Members

  • add_trade(self, price: typing.SupportsFloat | typing.SupportsIndex, quantity: typing.SupportsFloat | typing.SupportsIndex, is_buy: bool) -> None
  • add_trades(self, prices: typing.Annotated[numpy.typing.ArrayLike, numpy.float64], quantities: typing.Annotated[numpy.typing.ArrayLike, numpy.float64], is_buy: typing.Annotated[numpy.typing.ArrayLike, numpy.uint8]) -> None
  • clear(self) -> None
  • levels(self) -> list
  • num_levels(self) -> int
  • poc(self) -> float
  • total_delta(self) -> float
  • total_volume(self) -> float
  • value_area_high(self) -> float
  • value_area_low(self) -> float
  • volume_at(self, price: typing.SupportsFloat | typing.SupportsIndex) -> float

class WalkForwardRunner

Constructor

  • WalkForwardRunner(registry: ..., fee_rate: typing.SupportsFloat | typing.SupportsIndex = 0.0004, initial_capital: typing.SupportsFloat | typing.SupportsIndex = 10000.0, mode: str = 'anchored', train_size: typing.SupportsInt | typing.SupportsIndex = 0, test_size: typing.SupportsInt | typing.SupportsIndex = 0, step: typing.SupportsInt | typing.SupportsIndex = 0, min_train_size: typing.SupportsInt | typing.SupportsIndex = 0) -> None

Members

  • run_bars(self, start_time_ns: typing.Annotated[numpy.typing.ArrayLike, numpy.int64], end_time_ns: typing.Annotated[numpy.typing.ArrayLike, numpy.int64], open: typing.Annotated[numpy.typing.ArrayLike, numpy.float64], high: typing.Annotated[numpy.typing.ArrayLike, numpy.float64], low: typing.Annotated[numpy.typing.ArrayLike, numpy.float64], close: typing.Annotated[numpy.typing.ArrayLike, numpy.float64], volume: typing.Annotated[numpy.typing.ArrayLike, numpy.float64], symbol: str, bar_type: typing.SupportsInt | typing.SupportsIndex = 0, bar_type_param: typing.SupportsInt | typing.SupportsIndex = 0) -> list
  • run_csv(self, path: str, symbol: str) -> list
  • set_strategy_factory(self, factory: typing.Any) -> None

flox_py.targets

Module: flox_py.targets

Surface: 0 classes, 3 functions, 0 constants.

Functions

  • future_ctc_volatility(close: typing.Annotated[numpy.typing.ArrayLike, numpy.float64], horizon: typing.SupportsInt | typing.SupportsIndex) -> numpy.typing.NDArray[numpy.float64]
  • future_linear_slope(close: typing.Annotated[numpy.typing.ArrayLike, numpy.float64], horizon: typing.SupportsInt | typing.SupportsIndex) -> numpy.typing.NDArray[numpy.float64]
  • future_return(close: typing.Annotated[numpy.typing.ArrayLike, numpy.float64], horizon: typing.SupportsInt | typing.SupportsIndex) -> numpy.typing.NDArray[numpy.float64]