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 = 4ORDER_FLAG_POST_ONLY: int = 1ORDER_FLAG_REDUCE_ONLY: int = 2PARTIALLY_FILLED: OrderGroupState = ...PENDING: OrderGroupState = ...PRICE_SCALE: int = 100000000PnlRatio: AdlRanking = ...PositionSize: AdlRanking = ...QUANTITY_SCALE: int = 100000000QUEUE_FULL: int = 2QUEUE_NONE: int = 0QUEUE_TOB: int = 1REVERTING: OrderGroupState = ...SIGNAL_FLAG_ENTER: int = 1SIGNAL_FLAG_EXIT: int = 2SIGNAL_FLAG_REBALANCE: int = 4SLIPPAGE_FIXED_BPS: int = 2SLIPPAGE_FIXED_TICKS: int = 1SLIPPAGE_NONE: int = 0SLIPPAGE_VOLUME_IMPACT: int = 3SUBMITTED: OrderGroupState = ...StreamingIndicatorGraph = IndicatorGraphVOLUME_SCALE: int = 100000000WAIT_FOR_ALL: FeedClockPolicy = ...
Functions¶
adf(input: typing.Annotated[numpy.typing.ArrayLike, numpy.float64], max_lag: typing.SupportsInt | typing.SupportsIndex = 4, regression: str = 'c') -> dictadx(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) -> dictaggregate_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 barsaggregate_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 barsaggregate_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 barsaggregate_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 barsaggregate_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 barsaggregate_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 barsatr(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) -> dictbootstrap_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 coefficientcost_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) -> dictextract_symbols(input_path: str, output_path: str, symbols: collections.abc.Sequence[typing.SupportsInt | typing.SupportsIndex]) -> intextract_time_range(input_path: str, output_path: str, from_ns: typing.SupportsInt | typing.SupportsIndex, to_ns: typing.SupportsInt | typing.SupportsIndex) -> intforward_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. Ifscalesis 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 statisticskama(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) -> dictmerge(input_paths: collections.abc.Sequence[str], output_dir: str, output_name: str = 'merged', compression: str = 'none', sort: bool = True) -> dictmerge_dir(input_dir: str, output_dir: str) -> dictobv(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-valueprices_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]) -> floatquantities_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') -> boolrma(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 previouswindowreturns. 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) -> dictstochastic(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) -> dicttema(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) -> dictvalidate_dataset(data_dir: str) -> dictvol_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 thewin_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) -> Noneupdate(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) -> intadd_equity(self, delta: typing.SupportsFloat | typing.SupportsIndex) -> Noneclose_position(self, symbol: typing.SupportsInt | typing.SupportsIndex) -> Nonecross_headroom(self, tier_fraction: typing.SupportsFloat | typing.SupportsIndex) -> floatequity(self) -> floathas_stale_marks(self, now_ns: typing.SupportsInt | typing.SupportsIndex, budget_ns: typing.SupportsInt | typing.SupportsIndex) -> boolmargin_mode(self) -> MarginModemargin_notional(self) -> floatmargin_unrealised_pnl(self) -> floatmark_for(self, symbol: typing.SupportsInt | typing.SupportsIndex) -> floatmark_ts_for(self, symbol: typing.SupportsInt | typing.SupportsIndex) -> intopen_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) -> Noneposition_count(self) -> intrecord_fill(self, ts_ns: typing.SupportsInt | typing.SupportsIndex, notional: typing.SupportsFloat | typing.SupportsIndex, symbol: typing.SupportsInt | typing.SupportsIndex = 0) -> Nonereset_rolling(self) -> Nonerolling_notional_30d(self) -> floatrolling_notional_by_symbol_30d(self) -> list[tuple[int, float]]set_equity(self, equity: typing.SupportsFloat | typing.SupportsIndex) -> Noneset_margin_mode(self, mode: typing.Any) -> Noneset_mark(self, symbol: typing.SupportsInt | typing.SupportsIndex, price: typing.SupportsFloat | typing.SupportsIndex, ts_ns: typing.SupportsInt | typing.SupportsIndex = 0) -> Nonetotal_notional(self) -> floattotal_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) -> Noneupdate(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) -> Nonerecord_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) -> Nonestats(self) -> dicttrades(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) -> Noneequity_curve(self) -> typing.Anyrun_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.Anyrun_csv(self, path: str, symbol: str = '') -> typing.Anyrun_ohlcv(self, ts: typing.Annotated[numpy.typing.ArrayLike, numpy.int64], close: typing.Annotated[numpy.typing.ArrayLike, numpy.float64], symbol: str = '') -> typing.Anyrun_tape(self, path: str) -> typing.Anyrun_tapes(self, paths: collections.abc.Sequence[str]) -> typing.Anyset_executor(self, executor: Executor) -> Noneset_kill_switch(self, ks: KillSwitch) -> Noneset_order_validator(self, ov: OrderValidator) -> Noneset_pnl_tracker(self, tracker: PnLTracker) -> Noneset_risk_manager(self, rm: RiskManager) -> Noneset_strategy(self, strategy: Strategy) -> Nonetrades(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) -> intcount(self) -> intfinalize(self) -> Noneon_trade(self, symbol: typing.SupportsInt | typing.SupportsIndex, price: typing.SupportsFloat | typing.SupportsIndex, qty: typing.SupportsFloat | typing.SupportsIndex, ts_ns: typing.SupportsInt | typing.SupportsIndex) -> Noneparam_at(self, index: typing.SupportsInt | typing.SupportsIndex) -> inttype_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) -> Noneclose(self) -> Nonecurrent_segment_path(self) -> strflush(self) -> Nonestats(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]) -> dictreset(self) -> Noneupdate(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) -> Noneupdate(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.Anybest_ask(self, symbol: typing.SupportsInt | typing.SupportsIndex) -> typing.Anybest_bid(self, symbol: typing.SupportsInt | typing.SupportsIndex) -> typing.Anybid_for_exchange(self, symbol: typing.SupportsInt | typing.SupportsIndex, exchange: typing.SupportsInt | typing.SupportsIndex) -> typing.Anycheck_staleness(self, now_ns: typing.SupportsInt | typing.SupportsIndex) -> Nonehas_arbitrage_opportunity(self, symbol: typing.SupportsInt | typing.SupportsIndex) -> boolmark_exchange_stale(self, exchange: typing.SupportsInt | typing.SupportsIndex) -> Nonemark_stale(self, exchange: typing.SupportsInt | typing.SupportsIndex, symbol: typing.SupportsInt | typing.SupportsIndex) -> Nonespread(self, symbol: typing.SupportsInt | typing.SupportsIndex) -> typing.Anyupdate_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) -> Noneupdate(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) -> Noneupdate(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) -> intread_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) -> tupleread_book_updates_from(self, start_ts_ns: typing.SupportsInt | typing.SupportsIndex) -> tupleread_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) -> boolsegment_files(self) -> listsegments(self) -> liststats(self) -> dictsummary(self) -> dictsymbols(self) -> settime_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) -> Nonecurrent_segment_path(self) -> strflush(self) -> Nonestats(self) -> dictwrite_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, ...]) -> boolwrite_books(self, headers: typing.Annotated[numpy.typing.ArrayLike, ...], levels: typing.Annotated[numpy.typing.ArrayLike, ...]) -> intwrite_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) -> intwrite_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) -> boolwrite_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) -> dictreset(self, symbol_id: typing.SupportsInt | typing.SupportsIndex) -> Nonereset_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) -> dictreset(self, symbol_id: typing.SupportsInt | typing.SupportsIndex) -> Nonereset_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) -> Noneupdate(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 = '') -> intclose(self, symbol: str = '') -> numpy.typing.NDArray[numpy.float64]high(self, symbol: str = '') -> numpy.typing.NDArray[numpy.float64]load_csv(self, path: str, symbol: str = '') -> Noneload_df(self, df: typing.Any, symbol: str = '') -> Noneload_ohlcv(self, data: dict, symbol: str = '') -> Nonelow(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) -> Nonerun(self, signals: SignalBuilder, default_symbol: typing.SupportsInt | typing.SupportsIndex = 0) -> Statsts(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) -> Noneon_canceled(self, arg0: Order) -> Noneon_expired(self, arg0: Order) -> Noneon_filled(self, arg0: Order) -> Noneon_partially_filled(self, order: Order, fill_qty: typing.SupportsFloat | typing.SupportsIndex) -> Noneon_pending_cancel(self, arg0: Order) -> Noneon_pending_trigger(self, arg0: Order) -> Noneon_rejected(self, order: Order, reason: str) -> Noneon_replaced(self, old_order: Order, new_order: Order) -> Noneon_submitted(self, arg0: Order) -> Noneon_trailing_stop_updated(self, order: Order, new_trigger: typing.SupportsFloat | typing.SupportsIndex) -> Noneon_triggered(self, arg0: Order) -> None
class Executor¶
Constructor
Executor() -> None
Members
cancel(self, order_id: typing.SupportsInt | typing.SupportsIndex) -> Nonecancel_all(self, symbol: typing.SupportsInt | typing.SupportsIndex) -> Nonecapabilities(self) -> ExchangeCapabilitieson_start(self) -> Noneon_stop(self) -> Nonereplace(self, old_order_id: typing.SupportsInt | typing.SupportsIndex, new_order: Order) -> Nonesubmit(self, order: Order) -> Nonesubmit_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() -> FeeSchedulebybit_linear() -> FeeSchedulederibit() -> FeeScheduleokx_swap() -> FeeScheduleadd_tier(self, min_notional_30d: typing.SupportsFloat | typing.SupportsIndex, maker_bps: typing.SupportsFloat | typing.SupportsIndex, taker_bps: typing.SupportsFloat | typing.SupportsIndex) -> Nonebind_account(self, account: Account) -> Noneclear_account_binding(self) -> Nonecurrent_bps(self, now_ns: typing.SupportsInt | typing.SupportsIndex) -> tuple[float, float]current_tier_index(self) -> intfee_for(self, ts_ns: typing.SupportsInt | typing.SupportsIndex, notional: typing.SupportsFloat | typing.SupportsIndex, is_maker: bool) -> floatrecord_fill(self, ts_ns: typing.SupportsInt | typing.SupportsIndex, notional: typing.SupportsFloat | typing.SupportsIndex) -> Nonereset_rolling(self) -> Nonerolling_notional_30d(self) -> floattier_count(self) -> inttier_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) -> Noneadd_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]) -> Noneclear(self) -> Nonehighest_buying_pressure(self) -> floathighest_selling_pressure(self) -> floatlevels(self) -> listnum_levels(self) -> intstrongest_imbalance(self, threshold: typing.SupportsFloat | typing.SupportsIndex = 0.7) -> typing.Anytotal_delta(self) -> floattotal_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() -> FundingSchedulebitget_hourly() -> FundingSchedulebybit_linear() -> FundingScheduleconstant(interval_ns: typing.SupportsInt | typing.SupportsIndex, rate: typing.SupportsFloat | typing.SupportsIndex) -> FundingScheduleokx_swap() -> FundingScheduletape(events: collections.abc.Sequence[tuple[typing.SupportsInt | typing.SupportsIndex, typing.SupportsFloat | typing.SupportsIndex]]) -> FundingScheduletape_by_symbol(entries: collections.abc.Sequence[FundingTapeEntry]) -> FundingScheduleconstant_rate(self) -> floatinterval_ns(self) -> intlast_tick_ns(self) -> intload_tape(self, path: str) -> boolper_symbol_tape(self) -> list[FundingTapeEntry]reset(self) -> Noneset_constant_rate(self, rate: typing.SupportsFloat | typing.SupportsIndex) -> Nonesettlement_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]) -> Noneparams_for_index(self, index: typing.SupportsInt | typing.SupportsIndex) -> list[float]run(self) -> listset_factory(self, factory: typing.Any) -> Nonetotal(self) -> int
class IndicatorGraph¶
Constructor
IndicatorGraph() -> None
Members
add_node(self, name: str, deps: collections.abc.Sequence[str], fn: typing.Any) -> Nonebar_count(self, symbol: typing.SupportsInt | typing.SupportsIndex) -> intclose(self, symbol: typing.SupportsInt | typing.SupportsIndex) -> numpy.typing.NDArray[numpy.float64]current(self, symbol: typing.SupportsInt | typing.SupportsIndex, name: str) -> floatget(self, symbol: typing.SupportsInt | typing.SupportsIndex, name: str) -> typing.Anyhigh(self, symbol: typing.SupportsInt | typing.SupportsIndex) -> numpy.typing.NDArray[numpy.float64]indicator(self, name: str, indicator: typing.Any, source: str = 'close') -> Noneinvalidate(self, symbol: typing.SupportsInt | typing.SupportsIndex) -> Noneinvalidate_all(self) -> Nonelow(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) -> Nonereset_all(self) -> Noneset_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) -> Nonestep(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) -> Nonevolume(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) -> Noneupdate(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) -> Noneupdate(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) -> strask_at_price(self, price: typing.SupportsFloat | typing.SupportsIndex) -> floatbest_ask(self) -> typing.Anybest_bid(self) -> typing.Anybid_at_price(self, price: typing.SupportsFloat | typing.SupportsIndex) -> floatbuild_from_snapshot(self, orders: list) -> Noneexport_snapshot(self) -> listmodify_order(self, order_id: typing.SupportsInt | typing.SupportsIndex, new_quantity: typing.SupportsFloat | typing.SupportsIndex) -> strremove_order(self, order_id: typing.SupportsInt | typing.SupportsIndex) -> str
class LatencyDistribution¶
Constructor
LatencyDistribution() -> None
Members
constant(ns: typing.SupportsInt | typing.SupportsIndex) -> LatencyDistributionempirical(samples_ns: collections.abc.Sequence[typing.SupportsInt | typing.SupportsIndex]) -> LatencyDistributionlognormal(median_ns: typing.SupportsInt | typing.SupportsIndex, sigma: typing.SupportsFloat | typing.SupportsIndex) -> LatencyDistributionuniform(lo_ns: typing.SupportsInt | typing.SupportsIndex, hi_ns: typing.SupportsInt | typing.SupportsIndex) -> LatencyDistributionmedian_ns(self) -> intset_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) -> intfill_delay(self) -> intorder_delay(self) -> intreset(self, seed: typing.SupportsInt | typing.SupportsIndex = 0) -> Nonesample(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() -> LiquidationEnginebybit_linear() -> LiquidationEngineokx_swap() -> LiquidationEngineaccount_count(self) -> intadd_tier(self, min_notional: typing.SupportsFloat | typing.SupportsIndex, mm_fraction: typing.SupportsFloat | typing.SupportsIndex) -> LiquidationEngineadl_closeouts_count(self) -> intadl_enabled(self) -> booladl_ranking(self) -> AdlRankingattach_account(self, account: Account) -> Nonecascade_sizes_per_tick(self) -> list[int]close_position(self, account_id: typing.SupportsInt | typing.SupportsIndex, symbol: typing.SupportsInt | typing.SupportsIndex) -> Nonedeficits_paid_by_adl(self) -> list[float]deficits_paid_by_fund(self) -> list[float]detach_account(self, account_id: typing.SupportsInt | typing.SupportsIndex) -> Nonefund_balance_history(self) -> list[float]insurance_fund_balance(self) -> floatinsurance_payments_count(self) -> intliquidations_count(self) -> intmark_impact_model(self) -> MarkImpactModelmark_impact_weight(self) -> floatmax_cascade_depth(self) -> inton_mark(self, symbol: typing.SupportsInt | typing.SupportsIndex, mark_price: typing.SupportsFloat | typing.SupportsIndex) -> dicton_marks(self, marks: collections.abc.Sequence[tuple[typing.SupportsInt | typing.SupportsIndex, typing.SupportsFloat | typing.SupportsIndex]], ts_ns: typing.SupportsInt | typing.SupportsIndex = 0) -> dictopen_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) -> Noneposition_count(self) -> intreset_stats(self) -> Noneset_adl_enabled(self, enabled: bool) -> Noneset_adl_ranking(self, ranking: typing.Any) -> Noneset_executor(self, executor: typing.Any) -> Noneset_insurance_fund_capital(self, capital: typing.SupportsFloat | typing.SupportsIndex) -> Noneset_liquidation_slippage_bps(self, bps: typing.SupportsFloat | typing.SupportsIndex) -> Noneset_mark_impact_model(self, model: typing.Any, weight: typing.SupportsFloat | typing.SupportsIndex = 0.3) -> Noneset_max_cascade_depth(self, depth: typing.SupportsInt | typing.SupportsIndex) -> Noneticks_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) -> Noneon_order_cancelled(self, order_id: typing.SupportsInt | typing.SupportsIndex, ts_ns: typing.SupportsInt | typing.SupportsIndex = 0) -> Noneon_order_filled(self, order_id: typing.SupportsInt | typing.SupportsIndex, cumulative_fill: typing.SupportsFloat | typing.SupportsIndex, ts_ns: typing.SupportsInt | typing.SupportsIndex = 0) -> Noneon_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) -> Noneon_trade(self, symbol: typing.SupportsInt | typing.SupportsIndex, price: typing.SupportsFloat | typing.SupportsIndex, qty: typing.SupportsFloat | typing.SupportsIndex, ts_ns: typing.SupportsInt | typing.SupportsIndex = 0) -> Noneon_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) -> Noneset_confidence_half_life_ns(self, half_life_ns: typing.SupportsInt | typing.SupportsIndex) -> Noneset_hidden_order_policy(self, policy: str) -> Noneset_shrink_attribution_factor(self, factor: typing.SupportsFloat | typing.SupportsIndex) -> Nonesnapshot(self, order_id: typing.SupportsInt | typing.SupportsIndex, now_ns: typing.SupportsInt | typing.SupportsIndex = 0) -> typing.Anytracked_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]) -> dictreset(self) -> Noneupdate(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) -> Noneon_start(self) -> Noneon_stop(self) -> Noneon_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) -> Noneadd_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]) -> Noneclear(self) -> Nonecurrent_period(self) -> intinitial_balance_high(self) -> floatinitial_balance_low(self) -> floatis_poor_high(self) -> boolis_poor_low(self) -> boollevels(self) -> listnum_levels(self) -> intpoc(self) -> floatsingle_prints(self) -> listvalue_area_high(self) -> floatvalue_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) -> listread_books(self) -> tupleread_trades(self) -> numpy.ndarrayrun(self, aggregators: list) -> boolstream_events(self, on_trade: typing.Any = None, on_book: typing.Any = None) -> Nonesummary(self) -> dictsymbol_table(self) -> listtime_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) -> FeedClockPolicyreset(self) -> Nonesymbol_count(self) -> inttick(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]) -> Noneapply_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]) -> Noneask_at_price(self, price: typing.SupportsFloat | typing.SupportsIndex) -> floatbest_ask(self) -> typing.Anybest_bid(self) -> typing.Anybid_at_price(self, price: typing.SupportsFloat | typing.SupportsIndex) -> floatclear(self) -> Noneconsume_asks(self, quantity: typing.SupportsFloat | typing.SupportsIndex) -> tupleconsume_bids(self, quantity: typing.SupportsFloat | typing.SupportsIndex) -> tupleget_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) -> boolmid(self) -> typing.Anyspread(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) -> intadd_market_leg(self, symbol: typing.SupportsInt | typing.SupportsIndex, side: typing.SupportsInt | typing.SupportsIndex, qty: typing.SupportsFloat | typing.SupportsIndex) -> intauto_dispatch(self, strategy: typing.Any) -> intfind_leg_by_order_id(self, order_id: typing.SupportsInt | typing.SupportsIndex) -> typing.Anyleg_count(self) -> intleg_filled(self, leg_index: typing.SupportsInt | typing.SupportsIndex) -> floatleg_order_id(self, leg_index: typing.SupportsInt | typing.SupportsIndex) -> intleg_state(self, leg_index: typing.SupportsInt | typing.SupportsIndex) -> LegStatemark_action_dispatched(self, leg_index: typing.SupportsInt | typing.SupportsIndex, kind: str) -> Nonepair_latency_decision(self, leader_submit_ts_ns: typing.SupportsInt | typing.SupportsIndex, leader_ack_ts_ns: typing.SupportsInt | typing.SupportsIndex, ack_received: bool = False) -> strparent_signal_id(self) -> intpolicy(self) -> OrderGroupPolicyprecheck_submission(self, equity: typing.SupportsFloat | typing.SupportsIndex = 0.0, market_ref_prices: collections.abc.Sequence[typing.SupportsFloat | typing.SupportsIndex] = []) -> dictrecommended_actions(self) -> listrecord_cancel(self, leg_index: typing.SupportsInt | typing.SupportsIndex) -> Nonerecord_failure(self, leg_index: typing.SupportsInt | typing.SupportsIndex) -> Nonerecord_fill(self, leg_index: typing.SupportsInt | typing.SupportsIndex, cumulative_qty: typing.SupportsFloat | typing.SupportsIndex) -> Nonerecord_replace_accepted(self, leg_index: typing.SupportsInt | typing.SupportsIndex, new_order_id: typing.SupportsInt | typing.SupportsIndex) -> Nonerecord_replace_rejected(self, leg_index: typing.SupportsInt | typing.SupportsIndex) -> Nonerecord_submit(self, leg_index: typing.SupportsInt | typing.SupportsIndex, order_id: typing.SupportsInt | typing.SupportsIndex) -> Noneset_pair_latency_budget_ns(self, budget_ns: typing.SupportsInt | typing.SupportsIndex) -> Noneset_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) -> Nonestate(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) -> floatclear(self) -> Nonejourney(self, order_id: typing.SupportsInt | typing.SupportsIndex) -> numpy.ndarray[typing.Any, numpy.dtype[numpy.void]]maker_fill_ratio(self) -> floatmedian_ack_latency_ns(self) -> floatmedian_time_to_first_fill_ns(self) -> floatorder_count(self) -> intrecord_count(self) -> intresult(self) -> numpy.ndarray[typing.Any, numpy.dtype[numpy.void]]
class OrderTracker¶
Constructor
OrderTracker() -> None
Members
active_count(self) -> intget(self, order_id: typing.SupportsInt | typing.SupportsIndex) -> typing.Anyis_active(self, order_id: typing.SupportsInt | typing.SupportsIndex) -> boolon_canceled(self, order_id: typing.SupportsInt | typing.SupportsIndex) -> boolon_filled(self, order_id: typing.SupportsInt | typing.SupportsIndex, fill_quantity: typing.SupportsFloat | typing.SupportsIndex) -> boolon_rejected(self, order_id: typing.SupportsInt | typing.SupportsIndex, reason: str) -> boolon_submitted(self, order_id: typing.SupportsInt | typing.SupportsIndex, exchange_order_id: str, client_order_id: str = '') -> boolprune_terminal(self) -> Nonetotal_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) -> Noneupdate(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) -> listpartition_by_duration(self, duration_ns: typing.SupportsInt | typing.SupportsIndex, warmup_ns: typing.SupportsInt | typing.SupportsIndex = 0) -> listpartition_by_event_count(self, num_partitions: typing.SupportsInt | typing.SupportsIndex) -> listpartition_by_symbol(self, num_partitions: typing.SupportsInt | typing.SupportsIndex) -> listpartition_by_time(self, num_partitions: typing.SupportsInt | typing.SupportsIndex, warmup_ns: typing.SupportsInt | typing.SupportsIndex = 0) -> listpartition_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) -> boolclose_position(self, position_id: typing.SupportsInt | typing.SupportsIndex, exit_price: typing.SupportsFloat | typing.SupportsIndex) -> Nonecreate_group(self, parent_id: typing.SupportsInt | typing.SupportsIndex = 0) -> intget_position(self, position_id: typing.SupportsInt | typing.SupportsIndex) -> typing.Anygroup_net_position(self, group_id: typing.SupportsInt | typing.SupportsIndex) -> floatgroup_realized_pnl(self, group_id: typing.SupportsInt | typing.SupportsIndex) -> floatgroup_unrealized_pnl(self, group_id: typing.SupportsInt | typing.SupportsIndex, current_price: typing.SupportsFloat | typing.SupportsIndex) -> floatnet_position(self, symbol: typing.SupportsInt | typing.SupportsIndex) -> floatopen_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) -> intopen_position_count(self, symbol: typing.Any = None) -> intopen_positions(self, symbol: typing.SupportsInt | typing.SupportsIndex) -> listpartial_close(self, position_id: typing.SupportsInt | typing.SupportsIndex, quantity: typing.SupportsFloat | typing.SupportsIndex, exit_price: typing.SupportsFloat | typing.SupportsIndex) -> Noneprune_closed(self) -> Nonerealized_pnl(self, symbol: typing.SupportsInt | typing.SupportsIndex) -> floattotal_realized_pnl(self) -> float
class PositionTracker¶
Constructor
PositionTracker(cost_basis: str = 'fifo') -> None
Members
avg_entry_price(self, symbol: typing.SupportsInt | typing.SupportsIndex) -> floaton_fill(self, symbol: typing.SupportsInt | typing.SupportsIndex, side: str, price: typing.SupportsFloat | typing.SupportsIndex, quantity: typing.SupportsFloat | typing.SupportsIndex) -> Noneposition(self, symbol: typing.SupportsInt | typing.SupportsIndex) -> floatrealized_pnl(self, symbol: typing.SupportsInt | typing.SupportsIndex) -> floattotal_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) -> Noneupdate(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) -> Noneupdate(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() -> RateLimitPolicybybit_linear() -> RateLimitPolicyderibit() -> RateLimitPolicyokx_swap() -> RateLimitPolicyadd_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) -> Noneadd_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) -> Noneban_until_ns(self) -> intbucket_count(self) -> intbucket_states(self, now_ns: typing.SupportsInt | typing.SupportsIndex) -> listconsecutive_rejects(self) -> intset_ban(self, after_consecutive_rejects: typing.SupportsInt | typing.SupportsIndex, ban_duration_ns: typing.SupportsInt | typing.SupportsIndex) -> Nonetry_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 | Noneon_start(self) -> Noneon_stop(self) -> Noneseek_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) -> Noneupdate(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) -> Noneupdate(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) -> Noneattach_trace_recorder(self, recorder: typing.Any) -> Noneon_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) -> Noneon_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) -> Noneon_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) -> Nonereplace_strategy(self, index: typing.SupportsInt | typing.SupportsIndex, strategy: Strategy) -> Noneset_executor(self, executor: Executor) -> Noneset_kill_switch(self, ks: KillSwitch) -> Noneset_market_data_recorder(self, recorder: MarketDataRecorderHook) -> Noneset_market_data_recorder(self, recorder: BinaryLogRecorderHook) -> Noneset_order_validator(self, ov: OrderValidator) -> Noneset_pnl_tracker(self, tracker: PnLTracker) -> Noneset_risk_manager(self, rm: RiskManager) -> Noneset_storage_sink(self, sink: StorageSink) -> Noneset_trace_feed_ts_ns(self, feed_ts_ns: typing.SupportsInt | typing.SupportsIndex) -> Nonestart(self) -> Nonestop(self) -> Nonetrace_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) -> Nonetrace_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) -> Noneupdate(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) -> Noneupdate(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 = '') -> Noneclear(self) -> Nonelimit_buy(self, ts: typing.SupportsInt | typing.SupportsIndex, price: typing.SupportsFloat | typing.SupportsIndex, qty: typing.SupportsFloat | typing.SupportsIndex, symbol: str = '') -> Nonelimit_sell(self, ts: typing.SupportsInt | typing.SupportsIndex, price: typing.SupportsFloat | typing.SupportsIndex, qty: typing.SupportsFloat | typing.SupportsIndex, symbol: str = '') -> Nonesell(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) -> Noneapply_latency_profile(self, name: str) -> Nonebracket_state(self, bracket_id: typing.SupportsInt | typing.SupportsIndex) -> strcancel_all(self, symbol: typing.SupportsInt | typing.SupportsIndex) -> Nonecancel_bracket(self, bracket_id: typing.SupportsInt | typing.SupportsIndex) -> Nonecancel_order(self, order_id: typing.SupportsInt | typing.SupportsIndex) -> Noneclear_rate_limit_policy(self) -> Nonefills(self) -> numpy.ndarray[typing.Any, numpy.dtype[numpy.void]]fills_list(self) -> listfok_mode(self) -> striceberg_hidden_remaining_raw(self, order_id: typing.SupportsInt | typing.SupportsIndex) -> inton_bar(self, symbol: typing.SupportsInt | typing.SupportsIndex, close_price: typing.SupportsFloat | typing.SupportsIndex) -> Noneon_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) -> Noneon_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]]) -> Noneon_trade(self, symbol: typing.SupportsInt | typing.SupportsIndex, price: typing.SupportsFloat | typing.SupportsIndex, is_buy: bool) -> Noneon_trade_qty(self, symbol: typing.SupportsInt | typing.SupportsIndex, price: typing.SupportsFloat | typing.SupportsIndex, quantity: typing.SupportsFloat | typing.SupportsIndex, is_buy: bool) -> Noneset_bracket_child_arm_mode(self, mode: str) -> Noneset_cancel_ack_latency(self, latency_ns: typing.SupportsInt | typing.SupportsIndex, jitter_ns: typing.SupportsInt | typing.SupportsIndex = 0) -> Noneset_cancel_ack_latency_distribution(self, dist: LatencyDistribution) -> Noneset_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) -> Noneset_fok_mode(self, mode: str) -> Noneset_iceberg_jitter_seed(self, seed: typing.SupportsInt | typing.SupportsIndex) -> Noneset_iceberg_priority_mode(self, mode: str) -> Noneset_iceberg_refresh_latency(self, latency_ns: typing.SupportsInt | typing.SupportsIndex) -> Noneset_iceberg_size_randomisation_pct(self, pct: typing.SupportsFloat | typing.SupportsIndex) -> Noneset_lmm_bonus_multiplier(self, multiplier: typing.SupportsFloat | typing.SupportsIndex) -> Noneset_lmm_orders(self, ids: collections.abc.Sequence[typing.SupportsInt | typing.SupportsIndex]) -> Noneset_order_priority_multiplier(self, order_id: typing.SupportsInt | typing.SupportsIndex, multiplier: typing.SupportsFloat | typing.SupportsIndex) -> Noneset_queue_fifo_top_n(self, top_n: typing.SupportsInt | typing.SupportsIndex) -> Noneset_queue_model(self, model: str, depth: typing.SupportsInt | typing.SupportsIndex = 1) -> Noneset_queue_position_min_change_fraction(self, fraction: typing.SupportsFloat | typing.SupportsIndex) -> Noneset_rate_limit_policy(self, policy: ...) -> Noneset_replace_ack_latency(self, latency_ns: typing.SupportsInt | typing.SupportsIndex, jitter_ns: typing.SupportsInt | typing.SupportsIndex = 0) -> Noneset_replace_ack_latency_distribution(self, dist: LatencyDistribution) -> Noneset_stp_group_membership(self, account_id: typing.SupportsInt | typing.SupportsIndex, group_id: typing.SupportsInt | typing.SupportsIndex) -> Noneset_stp_mode(self, mode: str) -> Noneset_submit_ack_latency(self, latency_ns: typing.SupportsInt | typing.SupportsIndex, jitter_ns: typing.SupportsInt | typing.SupportsIndex = 0) -> Noneset_submit_ack_latency_distribution(self, dist: LatencyDistribution) -> Noneset_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) -> Noneset_top_priority_share(self, share: typing.SupportsFloat | typing.SupportsIndex) -> Noneset_venue_availability(self, availability: ...) -> Nonestp_group_for(self, account_id: typing.SupportsInt | typing.SupportsIndex) -> intsubmit_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) -> Nonesubmit_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) -> Nonesubmit_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) -> Noneupdate(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) -> Noneupdate(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]) -> dictreset(self) -> Noneupdate(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) -> intbest_ask(self, symbol: str | None = None) -> floatbest_bid(self, symbol: str | None = None) -> floatcancel_all_orders(self, symbol: str | None = None) -> Nonecancel_order(self, order_id: typing.SupportsInt | typing.SupportsIndex) -> Noneclose_position(self, symbol: str | None = None) -> intctx(self, symbol: typing.SupportsInt | typing.SupportsIndex | None = None) -> SymbolContextemit_cancel(self, order_id: typing.SupportsInt | typing.SupportsIndex) -> Noneemit_cancel_all(self, symbol: typing.SupportsInt | typing.SupportsIndex) -> Noneemit_close_position(self, symbol: typing.SupportsInt | typing.SupportsIndex) -> intemit_limit_buy(self, symbol: typing.SupportsInt | typing.SupportsIndex, price: typing.SupportsFloat | typing.SupportsIndex, quantity: typing.SupportsFloat | typing.SupportsIndex) -> intemit_limit_buy_tif(self, symbol: typing.SupportsInt | typing.SupportsIndex, price: typing.SupportsFloat | typing.SupportsIndex, quantity: typing.SupportsFloat | typing.SupportsIndex, tif: str = 'gtc') -> intemit_limit_sell(self, symbol: typing.SupportsInt | typing.SupportsIndex, price: typing.SupportsFloat | typing.SupportsIndex, quantity: typing.SupportsFloat | typing.SupportsIndex) -> intemit_limit_sell_tif(self, symbol: typing.SupportsInt | typing.SupportsIndex, price: typing.SupportsFloat | typing.SupportsIndex, quantity: typing.SupportsFloat | typing.SupportsIndex, tif: str = 'gtc') -> intemit_market_buy(self, symbol: typing.SupportsInt | typing.SupportsIndex, quantity: typing.SupportsFloat | typing.SupportsIndex) -> intemit_market_sell(self, symbol: typing.SupportsInt | typing.SupportsIndex, quantity: typing.SupportsFloat | typing.SupportsIndex) -> intemit_modify(self, order_id: typing.SupportsInt | typing.SupportsIndex, new_price: typing.SupportsFloat | typing.SupportsIndex, new_quantity: typing.SupportsFloat | typing.SupportsIndex) -> Noneemit_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) -> intemit_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) -> intemit_stop_market(self, symbol: typing.SupportsInt | typing.SupportsIndex, side: str, trigger: typing.SupportsFloat | typing.SupportsIndex, quantity: typing.SupportsFloat | typing.SupportsIndex) -> intemit_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) -> intemit_take_profit_market(self, symbol: typing.SupportsInt | typing.SupportsIndex, side: str, trigger: typing.SupportsFloat | typing.SupportsIndex, quantity: typing.SupportsFloat | typing.SupportsIndex) -> intemit_trailing_stop(self, symbol: typing.SupportsInt | typing.SupportsIndex, side: str, offset: typing.SupportsFloat | typing.SupportsIndex, quantity: typing.SupportsFloat | typing.SupportsIndex) -> intemit_trailing_stop_percent(self, symbol: typing.SupportsInt | typing.SupportsIndex, side: str, callback_bps: typing.SupportsInt | typing.SupportsIndex, quantity: typing.SupportsFloat | typing.SupportsIndex) -> intemit_withdraw_liquidity(self, pool: typing.SupportsInt | typing.SupportsIndex, liquidity: typing.SupportsFloat | typing.SupportsIndex) -> intget_order_status(self, order_id: typing.SupportsInt | typing.SupportsIndex) -> intlast_closed_bar(self, symbol_id: typing.SupportsInt | typing.SupportsIndex, bar_type: typing.SupportsInt | typing.SupportsIndex = 0, param: typing.SupportsInt | typing.SupportsIndex = 0) -> dict | Nonelast_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) -> listlast_price(self, symbol: str | None = None) -> floatlimit_buy(self, price: typing.SupportsFloat | typing.SupportsIndex, qty: typing.SupportsFloat | typing.SupportsIndex, symbol: str | None = None, tif: str = 'gtc') -> intlimit_sell(self, price: typing.SupportsFloat | typing.SupportsIndex, qty: typing.SupportsFloat | typing.SupportsIndex, symbol: str | None = None, tif: str = 'gtc') -> intmarket_buy(self, qty: typing.SupportsFloat | typing.SupportsIndex, symbol: str | None = None) -> intmarket_sell(self, qty: typing.SupportsFloat | typing.SupportsIndex, symbol: str | None = None) -> intmid_price(self, symbol: str | None = None) -> floatmodify_order(self, order_id: typing.SupportsInt | typing.SupportsIndex, new_price: typing.SupportsFloat | typing.SupportsIndex, new_qty: typing.SupportsFloat | typing.SupportsIndex) -> Noneon_bar(self, ctx: SymbolContext, bar: BarData) -> Noneon_book_update(self, ctx: SymbolContext) -> Noneon_fill(self, ctx: SymbolContext, event: OrderEventData) -> Noneon_market_position_change(self, ctx: SymbolContext, event: OrderEventData) -> Noneon_order_update(self, ctx: SymbolContext, event: OrderEventData) -> Noneon_queue_position_change(self, ctx: SymbolContext, event: OrderEventData) -> Noneon_start(self) -> Noneon_stop(self) -> Noneon_trade(self, ctx: SymbolContext, trade: TradeData) -> Noneorder_status(self, order_id: typing.SupportsInt | typing.SupportsIndex) -> intpos(self, symbol: str | None = None) -> floatposition(self, symbol: typing.SupportsInt | typing.SupportsIndex | None = None) -> floatset_bar_ring_capacity(self, n: typing.SupportsInt | typing.SupportsIndex) -> Nonestop_limit(self, side: str, trigger: typing.SupportsFloat | typing.SupportsIndex, limit_price: typing.SupportsFloat | typing.SupportsIndex, qty: typing.SupportsFloat | typing.SupportsIndex, symbol: str | None = None) -> intstop_market(self, side: str, trigger: typing.SupportsFloat | typing.SupportsIndex, qty: typing.SupportsFloat | typing.SupportsIndex, symbol: str | None = None) -> inttake_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) -> inttake_profit_market(self, side: str, trigger: typing.SupportsFloat | typing.SupportsIndex, qty: typing.SupportsFloat | typing.SupportsIndex, symbol: str | None = None) -> inttrailing_stop(self, side: str, offset: typing.SupportsFloat | typing.SupportsIndex, qty: typing.SupportsFloat | typing.SupportsIndex, symbol: str | None = None) -> inttrailing_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) -> floatis_flat(self) -> boolis_long(self) -> boolis_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) -> Symbolsymbol_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) -> Noneupdate(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) -> listread_all_order_events(self) -> listread_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) -> Noneset_run_ended_ns(self, arg0: typing.SupportsInt | typing.SupportsIndex) -> Nonewrite_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 = ...) -> Nonewrite_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 = '') -> Nonewrite_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) -> VenueAvailabilitybook_updates_allowed(self, now_ns: typing.SupportsInt | typing.SupportsIndex) -> boolcancels_allowed(self, now_ns: typing.SupportsInt | typing.SupportsIndex) -> boolconsume_wrong_side_recovery_bps(self) -> floatis_up(self, now_ns: typing.SupportsInt | typing.SupportsIndex) -> boollatency_multiplier(self, now_ns: typing.SupportsInt | typing.SupportsIndex) -> floatschedule_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) -> VenueAvailabilityschedule_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) -> VenueAvailabilitysubmits_allowed(self, now_ns: typing.SupportsInt | typing.SupportsIndex) -> booltrades_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) -> Nonecancel_order(self, order_id: typing.SupportsInt | typing.SupportsIndex) -> Noneclear_rate_limit_policy(self) -> Nonefills_list(self) -> liston_bar(self, symbol: typing.SupportsInt | typing.SupportsIndex, close_price: typing.SupportsFloat | typing.SupportsIndex) -> Noneon_trade(self, symbol: typing.SupportsInt | typing.SupportsIndex, price: typing.SupportsFloat | typing.SupportsIndex, is_buy: bool) -> Noneon_trade_qty(self, symbol: typing.SupportsInt | typing.SupportsIndex, price: typing.SupportsFloat | typing.SupportsIndex, quantity: typing.SupportsFloat | typing.SupportsIndex, is_buy: bool) -> Noneset_rate_limit_policy(self, policy: RateLimitPolicy) -> Noneset_venue_availability(self, venue_availability: VenueAvailability) -> Nonesubmit_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) -> VenueStackbybit_linear(account_id: typing.SupportsInt | typing.SupportsIndex, equity: typing.SupportsFloat | typing.SupportsIndex) -> VenueStackderibit(account_id: typing.SupportsInt | typing.SupportsIndex, equity: typing.SupportsFloat | typing.SupportsIndex) -> VenueStackfrom_venue(name: str, account_id: typing.SupportsInt | typing.SupportsIndex, equity: typing.SupportsFloat | typing.SupportsIndex) -> VenueStackokx_swap(account_id: typing.SupportsInt | typing.SupportsIndex, equity: typing.SupportsFloat | typing.SupportsIndex) -> VenueStackaccount(self) -> Accountclock(self) -> ...executor(self) -> VenueExecutorfees(self) -> FeeSchedulefunding(self) -> FundingScheduleliquidation(self) -> LiquidationEnginevenue(self) -> VenueAvailabilityvenue_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) -> Noneimplied_vol(self, log_moneyness: typing.SupportsFloat | typing.SupportsIndex, t: typing.SupportsFloat | typing.SupportsIndex) -> floatis_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) -> boolslice_count(self) -> inttotal_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) -> Noneadd_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]) -> Noneclear(self) -> Nonelevels(self) -> listnum_levels(self) -> intpoc(self) -> floattotal_delta(self) -> floattotal_volume(self) -> floatvalue_area_high(self) -> floatvalue_area_low(self) -> floatvolume_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) -> listrun_csv(self, path: str, symbol: str) -> listset_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]