SYMBOL INDEX (2830 symbols across 139 files) FILE: benchmarks/benchmark_large_pipeline.py class BenchResult (line 44) | class BenchResult: function parse_args (line 56) | def parse_args() -> argparse.Namespace: function _load_data (line 75) | def _load_data(): function _strategy (line 90) | def _strategy(schema, dte_min, dte_max, dte_exit): function _copy_data (line 103) | def _copy_data(stocks_data, options_data): function run_engine (line 115) | def run_engine( function run_legacy (line 165) | def run_legacy(stocks_data, options_data, args, runs) -> BenchResult: function print_result (line 204) | def print_result(r: BenchResult, indent: str = " ") -> None: function print_comparison (line 215) | def print_comparison(a: BenchResult, b: BenchResult) -> None: function main (line 231) | def main() -> None: FILE: benchmarks/benchmark_matrix.py class Scenario (line 26) | class Scenario: function parse_args (line 34) | def parse_args() -> argparse.Namespace: function parse_csv_list (line 47) | def parse_csv_list(s: str, cast): function normalize_weights (line 51) | def normalize_weights(symbols: list[str], raw_weights: str | None) -> li... function compute_metrics (line 63) | def compute_metrics(total_capital: pd.Series) -> tuple[float, float, flo... function slice_stocks_data (line 79) | def slice_stocks_data(stocks_file: str, start: pd.Timestamp, end: pd.Tim... function run_options_portfolio_backtester (line 88) | def run_options_portfolio_backtester( function run_bt (line 119) | def run_bt( function overlap_parity (line 166) | def overlap_parity(ob_eq: pd.Series, bt_eq: pd.Series | None) -> dict[st... function build_scenarios (line 182) | def build_scenarios(args: argparse.Namespace) -> list[Scenario]: function main (line 209) | def main() -> None: FILE: benchmarks/benchmark_rust_vs_python.py class BenchResult (line 46) | class BenchResult: function parse_args (line 55) | def parse_args() -> argparse.Namespace: function _stocks (line 64) | def _stocks(use_prod: bool = False): function _load_data (line 71) | def _load_data(use_prod: bool): function _buy_strategy (line 94) | def _buy_strategy(schema): function run_engine_python (line 107) | def run_engine_python(stocks_data, options_data, stocks, rebalance_freq,... function run_engine_rust (line 152) | def run_engine_rust(stocks_data, options_data, stocks, rebalance_freq, r... function run_legacy_python (line 196) | def run_legacy_python(stocks_data, options_data, stocks, rebalance_freq,... function run_bt_stock_only (line 233) | def run_bt_stock_only(stocks_file, symbols, weights, initial_capital, ru... function run_ob_stock_only (line 276) | def run_ob_stock_only(stocks_file, symbols, weights, initial_capital, ru... function print_result (line 309) | def print_result(r: BenchResult) -> None: function print_comparison (line 318) | def print_comparison(a: BenchResult, b: BenchResult) -> None: function main (line 330) | def main() -> None: FILE: benchmarks/benchmark_sweep.py function parse_args (line 46) | def parse_args(): function _load_data (line 55) | def _load_data(use_prod: bool): function _build_param_grid (line 78) | def _build_param_grid(n: int, underlying: str = "SPX") -> list[dict]: function _build_rust_config (line 109) | def _build_rust_config(stocks_data, options_data, stocks, underlying="SP... function run_rust_sweep (line 181) | def run_rust_sweep(opts_pl, stocks_pl, config, schema_mapping, param_gri... function run_python_sequential (line 197) | def run_python_sequential(stocks_data, options_data, stocks, param_grid,... function run_rust_single (line 256) | def run_rust_single(opts_pl, stocks_pl, config, schema_mapping, runs): function run_python_single (line 268) | def run_python_single(stocks_data, options_data, stocks, runs, underlyin... function main (line 308) | def main(): FILE: benchmarks/compare_with_bt.py class RunResult (line 29) | class RunResult: function parse_args (line 43) | def parse_args() -> argparse.Namespace: function normalize_weights (line 55) | def normalize_weights(symbols: list[str], raw_weights: str | None) -> li... function compute_metrics (line 67) | def compute_metrics(total_capital: pd.Series) -> tuple[float, float, flo... function run_options_portfolio_backtester (line 86) | def run_options_portfolio_backtester( function run_bt (line 127) | def run_bt( function print_result (line 178) | def print_result(r: RunResult) -> None: function print_overlap_parity (line 189) | def print_overlap_parity(a: RunResult, b: RunResult) -> None: function main (line 203) | def main() -> None: FILE: data/convert_optionsdx.py function make_optionroot (line 64) | def make_optionroot(expire_dates, option_type, strikes): function convert (line 76) | def convert(input_path, output_path): function main (line 113) | def main(): FILE: data/fetch_data.py function _download (line 47) | def _download(url, dest, force=False): function download_options_parquet (line 70) | def download_options_parquet(symbol, force=False): function download_underlying (line 87) | def download_underlying(symbol, force=False): function read_underlying_prices (line 132) | def read_underlying_prices(symbol, und_path, start, end): function underlying_to_tiingo (line 142) | def underlying_to_tiingo(symbol, und_path, start, end): function fetch_yfinance (line 171) | def fetch_yfinance(symbol, start, end): function fetch_options (line 213) | def fetch_options(symbols, start, end, output, force=False): function fetch_stocks (line 298) | def fetch_stocks(symbols, start, end, output, force=False): function align_dates (line 337) | def align_dates(stocks_path, options_path): function main (line 369) | def main(): FILE: data/fetch_signals.py function fetch_fred (line 36) | def fetch_fred(series_id: str) -> pd.Series: function main (line 50) | def main(): FILE: options_portfolio_backtester/analytics/charts.py function returns_chart (line 9) | def returns_chart(report: pd.DataFrame) -> alt.VConcatChart: function returns_histogram (line 46) | def returns_histogram(report: pd.DataFrame) -> alt.Chart: function monthly_returns_heatmap (line 54) | def monthly_returns_heatmap(report: pd.DataFrame) -> alt.Chart: function weights_chart (line 68) | def weights_chart(balance: pd.DataFrame, figsize: tuple[float, float] = ... FILE: options_portfolio_backtester/analytics/optimization.py class OptimizationResult (line 17) | class OptimizationResult: function grid_sweep (line 24) | def grid_sweep( function walk_forward (line 64) | def walk_forward( function rust_grid_sweep (line 110) | def rust_grid_sweep( FILE: options_portfolio_backtester/analytics/stats.py class PeriodStats (line 25) | class PeriodStats: class LookbackReturns (line 38) | class LookbackReturns: class BacktestStats (line 51) | class BacktestStats: method from_balance_range (line 94) | def from_balance_range( method from_balance (line 115) | def from_balance( method to_dataframe (line 184) | def to_dataframe(self) -> pd.DataFrame: method summary (line 252) | def summary(self) -> str: method lookback_table (line 275) | def lookback_table(self) -> pd.DataFrame: FILE: options_portfolio_backtester/analytics/summary.py function summary (line 11) | def summary(trade_log: pd.DataFrame, balance: pd.DataFrame) -> pd.io.for... FILE: options_portfolio_backtester/analytics/tearsheet.py class TearsheetReport (line 15) | class TearsheetReport: method to_dict (line 23) | def to_dict(self) -> dict[str, object]: method to_csv (line 31) | def to_csv(self, directory: str | Path) -> dict[str, Path]: method to_markdown (line 46) | def to_markdown(self) -> str: method to_html (line 62) | def to_html(self) -> str: function monthly_return_table (line 80) | def monthly_return_table(balance: pd.DataFrame) -> pd.DataFrame: function drawdown_series (line 93) | def drawdown_series(balance: pd.DataFrame) -> pd.Series: function build_tearsheet (line 103) | def build_tearsheet( FILE: options_portfolio_backtester/analytics/trade_log.py class Trade (line 15) | class Trade: method gross_pnl (line 33) | def gross_pnl(self) -> float: method net_pnl (line 38) | def net_pnl(self) -> float: method return_pct (line 43) | def return_pct(self) -> float: class TradeLog (line 51) | class TradeLog: method __init__ (line 54) | def __init__(self) -> None: method add_trade (line 57) | def add_trade(self, trade: Trade) -> None: method from_legacy_trade_log (line 61) | def from_legacy_trade_log(cls, trade_log: pd.DataFrame, method to_dataframe (line 106) | def to_dataframe(self) -> pd.DataFrame: method net_pnls (line 131) | def net_pnls(self) -> np.ndarray: method winners (line 135) | def winners(self) -> list[Trade]: method losers (line 139) | def losers(self) -> list[Trade]: method __len__ (line 142) | def __len__(self) -> int: FILE: options_portfolio_backtester/convexity/_utils.py function _to_ns (line 9) | def _to_ns(series: pd.Series) -> np.ndarray: FILE: options_portfolio_backtester/convexity/allocator.py function pick_cheapest (line 6) | def pick_cheapest(scores: dict[str, float]) -> str: function allocate_equal_weight (line 13) | def allocate_equal_weight(symbols: list[str], budget: float) -> dict[str... function allocate_inverse_vol (line 21) | def allocate_inverse_vol(vol_map: dict[str, float], budget: float) -> di... FILE: options_portfolio_backtester/convexity/backtest.py function _to_ns (line 16) | def _to_ns(series: pd.Series) -> np.ndarray: class BacktestResult (line 22) | class BacktestResult: function run_backtest (line 30) | def run_backtest( function run_unhedged (line 107) | def run_unhedged(stocks_data, config: BacktestConfig) -> pd.DataFrame: FILE: options_portfolio_backtester/convexity/config.py class InstrumentConfig (line 9) | class InstrumentConfig: class BacktestConfig (line 22) | class BacktestConfig: function default_config (line 34) | def default_config( FILE: options_portfolio_backtester/convexity/scoring.py function _to_ns (line 15) | def _to_ns(series: pd.Series) -> np.ndarray: function compute_convexity_scores (line 20) | def compute_convexity_scores( FILE: options_portfolio_backtester/convexity/viz.py function convexity_scores_chart (line 9) | def convexity_scores_chart(scores_df: pd.DataFrame) -> alt.Chart: function monthly_pnl_chart (line 24) | def monthly_pnl_chart(records: pd.DataFrame) -> alt.Chart: function cumulative_pnl_chart (line 44) | def cumulative_pnl_chart(results: dict[str, pd.DataFrame]) -> alt.Chart: FILE: options_portfolio_backtester/core/types.py class OptionType (line 19) | class OptionType(Enum): method __invert__ (line 23) | def __invert__(self) -> OptionType: class Direction (line 27) | class Direction(Enum): method price_column (line 33) | def price_column(self) -> str: method __invert__ (line 37) | def __invert__(self) -> Direction: class Signal (line 41) | class Signal(Enum): class Order (line 46) | class Order(Enum): method __invert__ (line 52) | def __invert__(self) -> Order: function get_order (line 58) | def get_order(direction: Direction, signal: Signal) -> Order: class Greeks (line 70) | class Greeks: method __add__ (line 80) | def __add__(self, other: Greeks) -> Greeks: method __mul__ (line 88) | def __mul__(self, scalar: float) -> Greeks: method __rmul__ (line 96) | def __rmul__(self, scalar: float) -> Greeks: method __neg__ (line 99) | def __neg__(self) -> Greeks: method as_dict (line 103) | def as_dict(self) -> dict[str, float]: class Fill (line 109) | class Fill: method direction_sign (line 122) | def direction_sign(self) -> int: method notional (line 126) | def notional(self) -> float: class OptionContract (line 133) | class OptionContract: FILE: options_portfolio_backtester/data/providers.py class TiingoData (line 14) | class TiingoData: method __init__ (line 16) | def __init__(self, file: str, schema: Schema | None = None, **params: ... method apply_filter (line 36) | def apply_filter(self, f: Filter) -> pd.DataFrame: method iter_dates (line 40) | def iter_dates(self) -> pd.core.groupby.DataFrameGroupBy: method iter_months (line 44) | def iter_months(self) -> pd.core.groupby.DataFrameGroupBy: method __getattr__ (line 54) | def __getattr__(self, attr: str) -> Any: method __getitem__ (line 67) | def __getitem__(self, item: Union[str, pd.Series]) -> Union[pd.DataFra... method __setitem__ (line 74) | def __setitem__(self, key: str, value: Any) -> None: method __len__ (line 79) | def __len__(self) -> int: method __repr__ (line 82) | def __repr__(self) -> str: method default_schema (line 86) | def default_schema() -> Schema: method sma (line 90) | def sma(self, periods: int) -> None: class HistoricalOptionsData (line 98) | class HistoricalOptionsData: method __init__ (line 100) | def __init__(self, file: str, schema: Schema | None = None, **params: ... method apply_filter (line 124) | def apply_filter(self, f: Filter) -> pd.DataFrame: method iter_dates (line 128) | def iter_dates(self) -> pd.core.groupby.DataFrameGroupBy: method iter_months (line 132) | def iter_months(self) -> pd.core.groupby.DataFrameGroupBy: method __getattr__ (line 142) | def __getattr__(self, attr: str) -> Any: method __getitem__ (line 155) | def __getitem__(self, item: Union[str, pd.Series]) -> Union[pd.DataFra... method __setitem__ (line 162) | def __setitem__(self, key: str, value: Any) -> None: method __len__ (line 167) | def __len__(self) -> int: method __repr__ (line 170) | def __repr__(self) -> str: method default_schema (line 174) | def default_schema() -> Schema: class DataProvider (line 195) | class DataProvider(ABC): method schema (line 200) | def schema(self) -> Schema: method data (line 205) | def data(self) -> pd.DataFrame: method start_date (line 210) | def start_date(self) -> pd.Timestamp: method end_date (line 215) | def end_date(self) -> pd.Timestamp: method apply_filter (line 219) | def apply_filter(self, f: Filter) -> pd.DataFrame: method iter_dates (line 223) | def iter_dates(self) -> Any: method iter_months (line 227) | def iter_months(self) -> Any: class OptionsDataProvider (line 231) | class OptionsDataProvider(DataProvider): class StocksDataProvider (line 236) | class StocksDataProvider(DataProvider): method sma (line 240) | def sma(self, periods: int) -> None: class CsvOptionsProvider (line 248) | class CsvOptionsProvider(OptionsDataProvider): method __init__ (line 251) | def __init__(self, file: str, schema: Schema | None = None, **params: ... method schema (line 255) | def schema(self) -> Schema: method data (line 259) | def data(self) -> pd.DataFrame: method start_date (line 263) | def start_date(self) -> pd.Timestamp: method end_date (line 267) | def end_date(self) -> pd.Timestamp: method apply_filter (line 270) | def apply_filter(self, f: Filter) -> pd.DataFrame: method iter_dates (line 273) | def iter_dates(self) -> Any: method iter_months (line 276) | def iter_months(self) -> Any: method __getitem__ (line 279) | def __getitem__(self, item: Any) -> Any: method __setitem__ (line 282) | def __setitem__(self, key: str, value: Any) -> None: method __len__ (line 285) | def __len__(self) -> int: method _data (line 289) | def _data(self) -> pd.DataFrame: class CsvStocksProvider (line 294) | class CsvStocksProvider(StocksDataProvider): method __init__ (line 297) | def __init__(self, file: str, schema: Schema | None = None, **params: ... method schema (line 301) | def schema(self) -> Schema: method data (line 305) | def data(self) -> pd.DataFrame: method start_date (line 309) | def start_date(self) -> pd.Timestamp: method end_date (line 313) | def end_date(self) -> pd.Timestamp: method apply_filter (line 316) | def apply_filter(self, f: Filter) -> pd.DataFrame: method iter_dates (line 319) | def iter_dates(self) -> Any: method iter_months (line 322) | def iter_months(self) -> Any: method sma (line 325) | def sma(self, periods: int) -> None: method __getitem__ (line 328) | def __getitem__(self, item: Any) -> Any: method __setitem__ (line 331) | def __setitem__(self, key: str, value: Any) -> None: method __len__ (line 334) | def __len__(self) -> int: method _data (line 338) | def _data(self) -> pd.DataFrame: FILE: options_portfolio_backtester/data/schema.py class Schema (line 8) | class Schema: method stocks (line 24) | def stocks() -> Schema: method options (line 30) | def options() -> Schema: method __init__ (line 35) | def __init__(self, mappings: dict[str, str]) -> None: method update (line 41) | def update(self, mappings: dict[str, str]) -> Schema: method __contains__ (line 46) | def __contains__(self, key: str) -> bool: method __getattr__ (line 50) | def __getattr__(self, key: str) -> Field: method __setitem__ (line 54) | def __setitem__(self, key: str, value: str) -> None: method __getitem__ (line 57) | def __getitem__(self, key: str) -> str: method __iter__ (line 61) | def __iter__(self) -> Iterator[tuple[str, str]]: method __repr__ (line 64) | def __repr__(self) -> str: method __eq__ (line 67) | def __eq__(self, other: object) -> bool: class Field (line 73) | class Field: method __init__ (line 78) | def __init__(self, name: str, mapping: str) -> None: method _create_filter (line 82) | def _create_filter(self, op: str, other: Union[Field, Any]) -> Filter: method _combine_fields (line 90) | def _combine_fields(self, op: str, other: Union[Field, int, float], in... method _format_query (line 103) | def _format_query(left: Any, op: str, right: Any, invert: bool = False... method __add__ (line 109) | def __add__(self, value: Union[Field, int, float]) -> Field: method __radd__ (line 112) | def __radd__(self, value: Union[Field, int, float]) -> Field: method __sub__ (line 115) | def __sub__(self, value: Union[Field, int, float]) -> Field: method __rsub__ (line 118) | def __rsub__(self, value: Union[Field, int, float]) -> Field: method __mul__ (line 121) | def __mul__(self, value: Union[Field, int, float]) -> Field: method __rmul__ (line 124) | def __rmul__(self, value: Union[Field, int, float]) -> Field: method __truediv__ (line 127) | def __truediv__(self, value: Union[Field, int, float]) -> Field: method __rtruediv__ (line 130) | def __rtruediv__(self, value: Union[Field, int, float]) -> Field: method __lt__ (line 133) | def __lt__(self, value: Union[Field, Any]) -> Filter: method __le__ (line 136) | def __le__(self, value: Union[Field, Any]) -> Filter: method __gt__ (line 139) | def __gt__(self, value: Union[Field, Any]) -> Filter: method __ge__ (line 142) | def __ge__(self, value: Union[Field, Any]) -> Filter: method __eq__ (line 145) | def __eq__(self, value: Union[Field, Any]) -> Filter: # type: ignore[... method __ne__ (line 150) | def __ne__(self, value: Union[Field, Any]) -> Filter: # type: ignore[... method __repr__ (line 153) | def __repr__(self) -> str: class Filter (line 157) | class Filter: method __init__ (line 162) | def __init__(self, query: str) -> None: method __and__ (line 165) | def __and__(self, other: Filter) -> Filter: method __or__ (line 171) | def __or__(self, other: Filter) -> Filter: method __invert__ (line 177) | def __invert__(self) -> Filter: method __call__ (line 181) | def __call__(self, data: 'pd.DataFrame') -> 'pd.Series': method __repr__ (line 185) | def __repr__(self) -> str: FILE: options_portfolio_backtester/engine/algo_adapters.py class EngineStepDecision (line 18) | class EngineStepDecision: class EnginePipelineContext (line 26) | class EnginePipelineContext: class EngineAlgo (line 40) | class EngineAlgo(Protocol): method __call__ (line 41) | def __call__(self, ctx: EnginePipelineContext) -> EngineStepDecision: class EngineRunMonthly (line 45) | class EngineRunMonthly: method __init__ (line 48) | def __init__(self) -> None: method reset (line 51) | def reset(self) -> None: method __call__ (line 54) | def __call__(self, ctx: EnginePipelineContext) -> EngineStepDecision: class BudgetPercent (line 62) | class BudgetPercent: method __init__ (line 65) | def __init__(self, pct: float) -> None: method __call__ (line 68) | def __call__(self, ctx: EnginePipelineContext) -> EngineStepDecision: class RangeFilter (line 73) | class RangeFilter: method __init__ (line 80) | def __init__(self, column: str, min_val: float, max_val: float) -> None: method __call__ (line 85) | def __call__(self, ctx: EnginePipelineContext) -> EngineStepDecision: function SelectByDelta (line 98) | def SelectByDelta(min_delta: float = -1.0, max_delta: float = 1.0, colum... function SelectByDTE (line 103) | def SelectByDTE(min_dte: int = 0, max_dte: int = 10_000, column: str = "... function IVRankFilter (line 108) | def IVRankFilter(min_rank: float = 0.0, max_rank: float = 1.0, column: s... class MaxGreekExposure (line 113) | class MaxGreekExposure: method __init__ (line 116) | def __init__( method __call__ (line 124) | def __call__(self, ctx: EnginePipelineContext) -> EngineStepDecision: class ExitOnThreshold (line 138) | class ExitOnThreshold: method __init__ (line 145) | def __init__(self, profit_pct: float = float("inf"), loss_pct: float =... method __call__ (line 156) | def __call__(self, ctx: EnginePipelineContext) -> EngineStepDecision: FILE: options_portfolio_backtester/engine/clock.py class TradingClock (line 10) | class TradingClock: method __init__ (line 16) | def __init__( method iter_dates (line 30) | def iter_dates(self) -> Generator[tuple[pd.Timestamp, pd.DataFrame, pd... method rebalance_dates (line 42) | def rebalance_dates(self, freq: int) -> pd.DatetimeIndex: method _monthly_iter (line 65) | def _monthly_iter(data: pd.DataFrame, date_col: str): method all_dates (line 74) | def all_dates(self) -> pd.DatetimeIndex: FILE: options_portfolio_backtester/engine/engine.py function _intrinsic_value (line 50) | def _intrinsic_value(option_type: str, strike: float, underlying_price: ... class _StrategySlot (line 62) | class _StrategySlot: class BacktestEngine (line 74) | class BacktestEngine: method __init__ (line 82) | def __init__( method stocks (line 127) | def stocks(self) -> list[Stock]: method stocks (line 131) | def stocks(self, stocks: list[Stock]) -> None: method options_strategy (line 136) | def options_strategy(self) -> Strategy | None: method options_strategy (line 140) | def options_strategy(self, strat: Strategy) -> None: method stocks_data (line 144) | def stocks_data(self) -> TiingoData | None: method stocks_data (line 148) | def stocks_data(self, data: TiingoData) -> None: method options_data (line 153) | def options_data(self) -> HistoricalOptionsData | None: method options_data (line 157) | def options_data(self, data: HistoricalOptionsData) -> None: method add_strategy (line 163) | def add_strategy( method _is_multi_strategy (line 195) | def _is_multi_strategy(self) -> bool: method run (line 200) | def run(self, rebalance_freq: int = 0, monthly: bool = False, method events_dataframe (line 255) | def events_dataframe(self) -> pd.DataFrame: method _translate_algos_to_config (line 271) | def _translate_algos_to_config(self) -> None: method _run_rust (line 344) | def _run_rust( method _run_rust_multi (line 523) | def _run_rust_multi( method _attach_run_metadata (line 697) | def _attach_run_metadata( method _build_run_metadata (line 712) | def _build_run_metadata( method _data_snapshot (line 741) | def _data_snapshot(self) -> dict[str, Any]: method _sha256_json (line 756) | def _sha256_json(payload: dict[str, Any]) -> str: method _git_sha (line 761) | def _git_sha() -> str: method _flat_trade_log_to_multiindex (line 775) | def _flat_trade_log_to_multiindex(self, flat_df: pd.DataFrame) -> pd.D... method _initialize_inventories (line 791) | def _initialize_inventories(self) -> None: method _current_options_capital (line 808) | def _current_options_capital(self, options, stocks): method _get_current_option_quotes (line 836) | def _get_current_option_quotes(self, options): method __repr__ (line 854) | def __repr__(self) -> str: FILE: options_portfolio_backtester/engine/multi_strategy.py class StrategyAllocation (line 16) | class StrategyAllocation: method __init__ (line 19) | def __init__( class MultiStrategyEngine (line 30) | class MultiStrategyEngine: method __init__ (line 37) | def __init__( method run (line 47) | def run(self, rebalance_freq: int = 0, monthly: bool = False, method _build_combined_balance (line 71) | def _build_combined_balance(self) -> None: FILE: options_portfolio_backtester/engine/pipeline.py class StepDecision (line 21) | class StepDecision: class PipelineContext (line 29) | class PipelineContext: class PipelineLogRow (line 44) | class PipelineLogRow: class Algo (line 51) | class Algo(Protocol): method __call__ (line 54) | def __call__(self, ctx: PipelineContext) -> StepDecision: class RunMonthly (line 62) | class RunMonthly: method __init__ (line 65) | def __init__(self) -> None: method reset (line 68) | def reset(self) -> None: method __call__ (line 71) | def __call__(self, ctx: PipelineContext) -> StepDecision: class RunWeekly (line 79) | class RunWeekly: method __init__ (line 82) | def __init__(self) -> None: method reset (line 85) | def reset(self) -> None: method __call__ (line 88) | def __call__(self, ctx: PipelineContext) -> StepDecision: class RunQuarterly (line 96) | class RunQuarterly: method __init__ (line 99) | def __init__(self) -> None: method reset (line 102) | def reset(self) -> None: method __call__ (line 105) | def __call__(self, ctx: PipelineContext) -> StepDecision: class RunYearly (line 113) | class RunYearly: method __init__ (line 116) | def __init__(self) -> None: method reset (line 119) | def reset(self) -> None: method __call__ (line 122) | def __call__(self, ctx: PipelineContext) -> StepDecision: class RunDaily (line 129) | class RunDaily: method __call__ (line 132) | def __call__(self, ctx: PipelineContext) -> StepDecision: class RunOnce (line 136) | class RunOnce: method __init__ (line 139) | def __init__(self) -> None: method reset (line 142) | def reset(self) -> None: method __call__ (line 145) | def __call__(self, ctx: PipelineContext) -> StepDecision: class RunOnDate (line 152) | class RunOnDate: method __init__ (line 155) | def __init__(self, dates: Sequence[str | pd.Timestamp]) -> None: method __call__ (line 158) | def __call__(self, ctx: PipelineContext) -> StepDecision: class RunAfterDate (line 164) | class RunAfterDate: method __init__ (line 167) | def __init__(self, date: str | pd.Timestamp) -> None: method __call__ (line 170) | def __call__(self, ctx: PipelineContext) -> StepDecision: class RunEveryNPeriods (line 176) | class RunEveryNPeriods: method __init__ (line 179) | def __init__(self, n: int) -> None: method reset (line 183) | def reset(self) -> None: method __call__ (line 186) | def __call__(self, ctx: PipelineContext) -> StepDecision: class RunAfterDays (line 193) | class RunAfterDays: method __init__ (line 196) | def __init__(self, n: int) -> None: method reset (line 200) | def reset(self) -> None: method __call__ (line 203) | def __call__(self, ctx: PipelineContext) -> StepDecision: class RunIfOutOfBounds (line 210) | class RunIfOutOfBounds: method __init__ (line 218) | def __init__(self, tolerance: float = 0.05) -> None: method reset (line 222) | def reset(self) -> None: method __call__ (line 225) | def __call__(self, ctx: PipelineContext) -> StepDecision: method update_target (line 245) | def update_target(self, weights: dict[str, float]) -> None: class Or (line 250) | class Or: method __init__ (line 253) | def __init__(self, *algos: Algo) -> None: method reset (line 256) | def reset(self) -> None: method __call__ (line 261) | def __call__(self, ctx: PipelineContext) -> StepDecision: class Not (line 269) | class Not: method __init__ (line 272) | def __init__(self, algo: Algo) -> None: method reset (line 275) | def reset(self) -> None: method __call__ (line 279) | def __call__(self, ctx: PipelineContext) -> StepDecision: class SelectThese (line 290) | class SelectThese: method __init__ (line 293) | def __init__(self, symbols: list[str]) -> None: method __call__ (line 296) | def __call__(self, ctx: PipelineContext) -> StepDecision: class SelectAll (line 304) | class SelectAll: method __call__ (line 307) | def __call__(self, ctx: PipelineContext) -> StepDecision: class SelectHasData (line 315) | class SelectHasData: method __init__ (line 318) | def __init__(self, min_days: int = 1) -> None: method __call__ (line 321) | def __call__(self, ctx: PipelineContext) -> StepDecision: class SelectMomentum (line 336) | class SelectMomentum: method __init__ (line 339) | def __init__(self, n: int, lookback: int = 252, sort_descending: bool ... method __call__ (line 344) | def __call__(self, ctx: PipelineContext) -> StepDecision: class SelectN (line 368) | class SelectN: method __init__ (line 371) | def __init__(self, n: int) -> None: method __call__ (line 374) | def __call__(self, ctx: PipelineContext) -> StepDecision: class SelectRandomly (line 381) | class SelectRandomly: method __init__ (line 384) | def __init__(self, n: int, seed: int | None = None) -> None: method __call__ (line 388) | def __call__(self, ctx: PipelineContext) -> StepDecision: class SelectActive (line 399) | class SelectActive: method __call__ (line 402) | def __call__(self, ctx: PipelineContext) -> StepDecision: class SelectRegex (line 414) | class SelectRegex: method __init__ (line 417) | def __init__(self, pattern: str) -> None: method __call__ (line 420) | def __call__(self, ctx: PipelineContext) -> StepDecision: class SelectWhere (line 429) | class SelectWhere: method __init__ (line 432) | def __init__(self, fn: Callable[[str, PipelineContext], bool]) -> None: method __call__ (line 435) | def __call__(self, ctx: PipelineContext) -> StepDecision: class WeighSpecified (line 449) | class WeighSpecified: method __init__ (line 452) | def __init__(self, weights: dict[str, float]) -> None: method __call__ (line 455) | def __call__(self, ctx: PipelineContext) -> StepDecision: class WeighEqually (line 466) | class WeighEqually: method __call__ (line 469) | def __call__(self, ctx: PipelineContext) -> StepDecision: class WeighRandomly (line 477) | class WeighRandomly: method __init__ (line 483) | def __init__(self, seed: int | None = None) -> None: method __call__ (line 486) | def __call__(self, ctx: PipelineContext) -> StepDecision: class WeighTarget (line 494) | class WeighTarget: method __init__ (line 501) | def __init__(self, weights_df: pd.DataFrame) -> None: method __call__ (line 504) | def __call__(self, ctx: PipelineContext) -> StepDecision: class WeighInvVol (line 525) | class WeighInvVol: method __init__ (line 532) | def __init__(self, lookback: int = 252) -> None: method __call__ (line 535) | def __call__(self, ctx: PipelineContext) -> StepDecision: class WeighMeanVar (line 559) | class WeighMeanVar: method __init__ (line 566) | def __init__(self, lookback: int = 252, risk_free_rate: float = 0.0) -... method __call__ (line 570) | def __call__(self, ctx: PipelineContext) -> StepDecision: class WeighERC (line 614) | class WeighERC: method __init__ (line 621) | def __init__(self, lookback: int = 252, max_iter: int = 100) -> None: method __call__ (line 625) | def __call__(self, ctx: PipelineContext) -> StepDecision: class TargetVol (line 659) | class TargetVol: method __init__ (line 666) | def __init__(self, target: float = 0.10, lookback: int = 252) -> None: method __call__ (line 670) | def __call__(self, ctx: PipelineContext) -> StepDecision: class LimitWeights (line 697) | class LimitWeights: method __init__ (line 700) | def __init__(self, limit: float = 0.25) -> None: method __call__ (line 703) | def __call__(self, ctx: PipelineContext) -> StepDecision: class LimitDeltas (line 725) | class LimitDeltas: method __init__ (line 733) | def __init__(self, limit: float = 0.10) -> None: method __call__ (line 736) | def __call__(self, ctx: PipelineContext) -> StepDecision: class ScaleWeights (line 771) | class ScaleWeights: method __init__ (line 778) | def __init__(self, scale: float) -> None: method __call__ (line 781) | def __call__(self, ctx: PipelineContext) -> StepDecision: class CapitalFlow (line 792) | class CapitalFlow: method __init__ (line 799) | def __init__(self, flows: dict[str | pd.Timestamp, float] | Callable[[... method __call__ (line 806) | def __call__(self, ctx: PipelineContext) -> StepDecision: class MaxDrawdownGuard (line 818) | class MaxDrawdownGuard: method __init__ (line 821) | def __init__(self, max_drawdown_pct: float) -> None: method reset (line 825) | def reset(self) -> None: method __call__ (line 828) | def __call__(self, ctx: PipelineContext) -> StepDecision: class HedgeRisks (line 838) | class HedgeRisks: method __init__ (line 851) | def __init__( method __call__ (line 861) | def __call__(self, ctx: PipelineContext) -> StepDecision: class Margin (line 914) | class Margin: method __init__ (line 922) | def __init__( method reset (line 933) | def reset(self) -> None: method __call__ (line 936) | def __call__(self, ctx: PipelineContext) -> StepDecision: class CouponPayingPosition (line 963) | class CouponPayingPosition: method __init__ (line 977) | def __init__( method reset (line 993) | def reset(self) -> None: method __call__ (line 996) | def __call__(self, ctx: PipelineContext) -> StepDecision: class ReplayTransactions (line 1026) | class ReplayTransactions: method __init__ (line 1034) | def __init__(self, blotter: pd.DataFrame) -> None: method __call__ (line 1042) | def __call__(self, ctx: PipelineContext) -> StepDecision: class CloseDead (line 1074) | class CloseDead: method __call__ (line 1080) | def __call__(self, ctx: PipelineContext) -> StepDecision: class ClosePositionsAfterDates (line 1092) | class ClosePositionsAfterDates: method __init__ (line 1098) | def __init__(self, schedule: dict[str, str | pd.Timestamp]) -> None: method __call__ (line 1101) | def __call__(self, ctx: PipelineContext) -> StepDecision: class Require (line 1112) | class Require: method __init__ (line 1120) | def __init__(self, algo: Algo) -> None: method reset (line 1123) | def reset(self) -> None: method __call__ (line 1127) | def __call__(self, ctx: PipelineContext) -> StepDecision: class Rebalance (line 1138) | class Rebalance: method __call__ (line 1144) | def __call__(self, ctx: PipelineContext) -> StepDecision: class RebalanceOverTime (line 1164) | class RebalanceOverTime: method __init__ (line 1171) | def __init__(self, n: int = 5) -> None: method reset (line 1176) | def reset(self) -> None: method __call__ (line 1180) | def __call__(self, ctx: PipelineContext) -> StepDecision: class AlgoPipelineBacktester (line 1233) | class AlgoPipelineBacktester: method __init__ (line 1236) | def __init__( method run (line 1247) | def run(self) -> pd.DataFrame: method set_date_range (line 1320) | def set_date_range(self, start=None, end=None): method logs_dataframe (line 1325) | def logs_dataframe(self) -> pd.DataFrame: class RandomBenchmarkResult (line 1341) | class RandomBenchmarkResult: method mean_random (line 1349) | def mean_random(self) -> float: method std_random (line 1353) | def std_random(self) -> float: function benchmark_random (line 1357) | def benchmark_random( FILE: options_portfolio_backtester/engine/strategy_tree.py class StrategyTreeNode (line 13) | class StrategyTreeNode: method __post_init__ (line 22) | def __post_init__(self) -> None: method is_leaf (line 29) | def is_leaf(self) -> bool: method to_dot (line 32) | def to_dot(self) -> str: method _dot_recursive (line 43) | def _dot_recursive(self, lines: list[str], parent_id: str | None) -> N... class StrategyTreeEngine (line 56) | class StrategyTreeEngine: method __init__ (line 59) | def __init__(self, root: StrategyTreeNode, initial_capital: int = 1_00... method to_dot (line 64) | def to_dot(self) -> str: method _leaf_shares (line 68) | def _leaf_shares(self, node: StrategyTreeNode, parent_share: float) ->... method run (line 84) | def run(self, rebalance_freq: int = 0, monthly: bool = False, sma_days... FILE: options_portfolio_backtester/execution/cost_model.py class TransactionCostModel (line 12) | class TransactionCostModel(ABC): method option_cost (line 16) | def option_cost(self, price: float, quantity: int, shares_per_contract... method stock_cost (line 21) | def stock_cost(self, price: float, quantity: float) -> float: class NoCosts (line 26) | class NoCosts(TransactionCostModel): method option_cost (line 29) | def option_cost(self, price: float, quantity: int, shares_per_contract... method stock_cost (line 32) | def stock_cost(self, price: float, quantity: float) -> float: method to_rust_config (line 35) | def to_rust_config(self) -> dict: class PerContractCommission (line 39) | class PerContractCommission(TransactionCostModel): method __init__ (line 42) | def __init__(self, rate: float = 0.65, stock_rate: float = 0.005) -> N... method option_cost (line 46) | def option_cost(self, price: float, quantity: int, shares_per_contract... method stock_cost (line 49) | def stock_cost(self, price: float, quantity: float) -> float: method to_rust_config (line 52) | def to_rust_config(self) -> dict: class TieredCommission (line 56) | class TieredCommission(TransactionCostModel): method __init__ (line 63) | def __init__(self, tiers: list[tuple[int, float]] | None = None, method option_cost (line 73) | def option_cost(self, price: float, quantity: int, shares_per_contract... method stock_cost (line 76) | def stock_cost(self, price: float, quantity: float) -> float: method to_rust_config (line 79) | def to_rust_config(self) -> dict: class SpreadSlippage (line 87) | class SpreadSlippage(TransactionCostModel): method __init__ (line 94) | def __init__(self, pct: float = 0.5) -> None: method option_cost (line 98) | def option_cost(self, price: float, quantity: int, shares_per_contract... method stock_cost (line 103) | def stock_cost(self, price: float, quantity: float) -> float: method slippage (line 106) | def slippage(self, bid: float, ask: float, quantity: int, shares_per_c... FILE: options_portfolio_backtester/execution/fill_model.py class FillModel (line 13) | class FillModel(ABC): method get_fill_price (line 17) | def get_fill_price(self, row: pd.Series, direction: Direction) -> float: class MarketAtBidAsk (line 22) | class MarketAtBidAsk(FillModel): method get_fill_price (line 25) | def get_fill_price(self, row: pd.Series, direction: Direction) -> float: method to_rust_config (line 28) | def to_rust_config(self) -> dict: class MidPrice (line 32) | class MidPrice(FillModel): method get_fill_price (line 35) | def get_fill_price(self, row: pd.Series, direction: Direction) -> float: method to_rust_config (line 40) | def to_rust_config(self) -> dict: class VolumeAwareFill (line 44) | class VolumeAwareFill(FillModel): method __init__ (line 51) | def __init__(self, full_volume_threshold: int = 100) -> None: method get_fill_price (line 54) | def get_fill_price(self, row: pd.Series, direction: Direction) -> float: method to_rust_config (line 62) | def to_rust_config(self) -> dict: FILE: options_portfolio_backtester/execution/signal_selector.py class SignalSelector (line 14) | class SignalSelector(ABC): method column_requirements (line 18) | def column_requirements(self) -> list[str]: method select (line 23) | def select(self, candidates: pd.DataFrame) -> pd.Series: class FirstMatch (line 35) | class FirstMatch(SignalSelector): method select (line 38) | def select(self, candidates: pd.DataFrame) -> pd.Series: method to_rust_config (line 41) | def to_rust_config(self) -> dict: class NearestDelta (line 45) | class NearestDelta(SignalSelector): method __init__ (line 51) | def __init__(self, target_delta: float = -0.30, delta_column: str = "d... method column_requirements (line 56) | def column_requirements(self) -> list[str]: method select (line 59) | def select(self, candidates: pd.DataFrame) -> pd.Series: method to_rust_config (line 66) | def to_rust_config(self) -> dict: class MaxOpenInterest (line 70) | class MaxOpenInterest(SignalSelector): method __init__ (line 76) | def __init__(self, oi_column: str = "openinterest") -> None: method column_requirements (line 80) | def column_requirements(self) -> list[str]: method select (line 83) | def select(self, candidates: pd.DataFrame) -> pd.Series: method to_rust_config (line 90) | def to_rust_config(self) -> dict: FILE: options_portfolio_backtester/execution/sizer.py class PositionSizer (line 8) | class PositionSizer(ABC): method size (line 12) | def size(self, cost_per_contract: float, available_capital: float, class CapitalBased (line 24) | class CapitalBased(PositionSizer): method size (line 30) | def size(self, cost_per_contract: float, available_capital: float, class FixedQuantity (line 37) | class FixedQuantity(PositionSizer): method __init__ (line 40) | def __init__(self, quantity: int = 1) -> None: method size (line 43) | def size(self, cost_per_contract: float, available_capital: float, class FixedDollar (line 50) | class FixedDollar(PositionSizer): method __init__ (line 53) | def __init__(self, amount: float = 10_000.0) -> None: method size (line 56) | def size(self, cost_per_contract: float, available_capital: float, class PercentOfPortfolio (line 64) | class PercentOfPortfolio(PositionSizer): method __init__ (line 67) | def __init__(self, pct: float = 0.01) -> None: method size (line 71) | def size(self, cost_per_contract: float, available_capital: float, FILE: options_portfolio_backtester/portfolio/greeks.py function aggregate_greeks (line 9) | def aggregate_greeks( FILE: options_portfolio_backtester/portfolio/portfolio.py class StockHolding (line 18) | class StockHolding: class Portfolio (line 25) | class Portfolio: method __init__ (line 32) | def __init__(self, initial_cash: float = 0.0) -> None: method next_position_id (line 38) | def next_position_id(self) -> int: method add_option_position (line 45) | def add_option_position(self, pos: OptionPosition) -> None: method remove_option_position (line 48) | def remove_option_position(self, position_id: int) -> OptionPosition |... method options_value (line 51) | def options_value(self, current_prices: dict[int, dict[str, float]], method set_stock_holding (line 67) | def set_stock_holding(self, symbol: str, quantity: float, method clear_stock_holdings (line 73) | def clear_stock_holdings(self) -> None: method stocks_value (line 76) | def stocks_value(self, current_prices: dict[str, float]) -> float: method total_value (line 86) | def total_value(self, stock_prices: dict[str, float], method portfolio_greeks (line 94) | def portfolio_greeks(self, FILE: options_portfolio_backtester/portfolio/position.py class PositionLeg (line 14) | class PositionLeg: method exit_order (line 27) | def exit_order(self) -> Order: method current_value (line 30) | def current_value(self, current_price: float, quantity: int, class OptionPosition (line 42) | class OptionPosition: method add_leg (line 53) | def add_leg(self, leg: PositionLeg) -> None: method current_value (line 56) | def current_value(self, current_prices: dict[str, float], method greeks (line 70) | def greeks(self, leg_greeks: dict[str, Greeks]) -> Greeks: FILE: options_portfolio_backtester/portfolio/risk.py class RiskConstraint (line 12) | class RiskConstraint(ABC): method check (line 16) | def check(self, current_greeks: Greeks, proposed_greeks: Greeks, method describe (line 22) | def describe(self) -> str: function _greeks_list (line 27) | def _greeks_list(g: Greeks) -> list[float]: class MaxDelta (line 31) | class MaxDelta(RiskConstraint): method __init__ (line 34) | def __init__(self, limit: float = 100.0) -> None: method check (line 37) | def check(self, current_greeks: Greeks, proposed_greeks: Greeks, method describe (line 45) | def describe(self) -> str: method to_rust_config (line 48) | def to_rust_config(self) -> dict: class MaxVega (line 52) | class MaxVega(RiskConstraint): method __init__ (line 55) | def __init__(self, limit: float = 50.0) -> None: method check (line 58) | def check(self, current_greeks: Greeks, proposed_greeks: Greeks, method describe (line 66) | def describe(self) -> str: method to_rust_config (line 69) | def to_rust_config(self) -> dict: class MaxDrawdown (line 73) | class MaxDrawdown(RiskConstraint): method __init__ (line 76) | def __init__(self, max_dd_pct: float = 0.20) -> None: method check (line 79) | def check(self, current_greeks: Greeks, proposed_greeks: Greeks, method describe (line 87) | def describe(self) -> str: method to_rust_config (line 90) | def to_rust_config(self) -> dict: class RiskManager (line 94) | class RiskManager: method __init__ (line 97) | def __init__(self, constraints: list[RiskConstraint] | None = None) ->... method add_constraint (line 100) | def add_constraint(self, constraint: RiskConstraint) -> None: method is_allowed (line 103) | def is_allowed(self, current_greeks: Greeks, proposed_greeks: Greeks, FILE: options_portfolio_backtester/strategy/presets.py function strangle (line 15) | def strangle( function iron_condor (line 56) | def iron_condor( function covered_call (line 114) | def covered_call( function cash_secured_put (line 143) | def cash_secured_put( function collar (line 172) | def collar( function butterfly (line 214) | def butterfly( class Strangle (line 263) | class Strangle(Strategy): method __init__ (line 266) | def __init__( FILE: options_portfolio_backtester/strategy/strategy.py class Strategy (line 20) | class Strategy: method __init__ (line 27) | def __init__( method add_leg (line 42) | def add_leg(self, leg: "StrategyLeg") -> "Strategy": method add_legs (line 48) | def add_legs(self, legs: list["StrategyLeg"]) -> "Strategy": method remove_leg (line 53) | def remove_leg(self, leg_number: int) -> "Strategy": method clear_legs (line 57) | def clear_legs(self) -> "Strategy": method add_exit_thresholds (line 61) | def add_exit_thresholds(self, profit_pct: float = math.inf, method filter_thresholds (line 67) | def filter_thresholds(self, entry_cost: pd.Series, method __repr__ (line 73) | def __repr__(self) -> str: FILE: options_portfolio_backtester/strategy/strategy_leg.py class StrategyLeg (line 19) | class StrategyLeg: method __init__ (line 26) | def __init__( method entry_filter (line 47) | def entry_filter(self) -> "Filter": method entry_filter (line 51) | def entry_filter(self, flt: "Filter") -> None: method exit_filter (line 55) | def exit_filter(self) -> "Filter": method exit_filter (line 59) | def exit_filter(self, flt: "Filter") -> None: method _base_entry_filter (line 62) | def _base_entry_filter(self) -> "Filter": method _base_exit_filter (line 67) | def _base_exit_filter(self) -> "Filter": method __repr__ (line 70) | def __repr__(self) -> str: FILE: rust/ob_core/benches/hot_paths.rs function make_options_df (line 11) | fn make_options_df(n: usize) -> DataFrame { function bench_inventory_join (line 36) | fn bench_inventory_join(c: &mut Criterion) { function bench_filter_compile_and_apply (line 78) | fn bench_filter_compile_and_apply(c: &mut Criterion) { function bench_filter_compile (line 94) | fn bench_filter_compile(c: &mut Criterion) { function bench_entry_computation (line 106) | fn bench_entry_computation(c: &mut Criterion) { function bench_exit_mask (line 130) | fn bench_exit_mask(c: &mut Criterion) { function bench_stats_computation (line 152) | fn bench_stats_computation(c: &mut Criterion) { function bench_entry_qty (line 167) | fn bench_entry_qty(c: &mut Criterion) { FILE: rust/ob_core/src/backtest.rs type BacktestConfig (line 30) | pub struct BacktestConfig { type BacktestResult (line 71) | pub struct BacktestResult { type StrategySlotConfig (line 80) | pub struct StrategySlotConfig { type Position (line 90) | struct Position { type StockHolding (line 103) | struct StockHolding { type TradeRow (line 110) | struct TradeRow { type LegTradeData (line 117) | struct LegTradeData { type BalanceDay (line 128) | struct BalanceDay { function ns_to_datestring (line 144) | fn ns_to_datestring(ns: i64) -> String { function parse_datestring_to_ns (line 153) | fn parse_datestring_to_ns(s: &str) -> Option { function extract_date_ns (line 164) | fn extract_date_ns(col: &Column, idx: usize) -> i64 { function column_value_to_string (line 188) | fn column_value_to_string(col: &Column, idx: usize) -> String { type DayOptions (line 215) | struct DayOptions { method new (line 222) | fn new(df: DataFrame, contract_col: &str) -> Self { method get_f64 (line 238) | fn get_f64(&self, contract: &str, field: &str) -> Option { method get_str (line 252) | fn get_str(&self, contract: &str, field: &str) -> Option { method height (line 259) | fn height(&self) -> usize { type DayStocks (line 265) | struct DayStocks { method get_price (line 270) | fn get_price(&self, symbol: &str) -> Option { type PartitionedData (line 276) | pub struct PartitionedData { type SchemaMapping (line 285) | pub struct SchemaMapping { function run_backtest (line 301) | pub fn run_backtest( type PrecompiledFilters (line 313) | pub struct PrecompiledFilters { method from_config (line 320) | pub fn from_config(config: &BacktestConfig) -> Self { function run_backtest_prepartitioned (line 332) | pub fn run_backtest_prepartitioned( function run_backtest_with_filters (line 342) | pub fn run_backtest_with_filters( function run_multi_strategy (line 610) | pub fn run_multi_strategy( function compute_balance_period_multi (line 878) | fn compute_balance_period_multi( function prepartition_data (line 951) | pub fn prepartition_data( function execute_exits (line 1059) | fn execute_exits( function liquidate_all_positions (line 1172) | fn liquidate_all_positions( function execute_entries (line 1237) | fn execute_entries( function compute_balance_period (line 1486) | fn compute_balance_period( function compute_sma_map (line 1566) | fn compute_sma_map( function build_result (line 1606) | fn build_result( function intrinsic_value (line 1726) | fn intrinsic_value(opt_type: &str, strike: f64, underlying_price: f64) -... function compute_position_exit_cost (line 1735) | fn compute_position_exit_cost(pos: &Position, day_opts: &DayOptions, spc... function compute_stock_capital (line 1752) | fn compute_stock_capital(holdings: &[StockHolding], day_stocks: Option<&... function compute_options_capital (line 1762) | fn compute_options_capital( function compute_portfolio_greeks_from_market (line 1773) | fn compute_portfolio_greeks_from_market( function buy_stocks (line 1798) | fn buy_stocks( function compute_daily_returns (line 1834) | fn compute_daily_returns(totals: &[f64]) -> Vec { function daily_returns_basic (line 1844) | fn daily_returns_basic() { function daily_returns_empty (line 1853) | fn daily_returns_empty() { function ns_to_datestring_epoch (line 1859) | fn ns_to_datestring_epoch() { function ns_roundtrip (line 1864) | fn ns_roundtrip() { function intrinsic_value_put_itm (line 1871) | fn intrinsic_value_put_itm() { function intrinsic_value_put_otm (line 1877) | fn intrinsic_value_put_otm() { function intrinsic_value_call_itm (line 1883) | fn intrinsic_value_call_itm() { function intrinsic_value_call_otm (line 1889) | fn intrinsic_value_call_otm() { function intrinsic_value_atm (line 1895) | fn intrinsic_value_atm() { function exit_cost_uses_intrinsic_when_missing (line 1902) | fn exit_cost_uses_intrinsic_when_missing() { FILE: rust/ob_core/src/balance.rs type LegInventory (line 13) | pub struct LegInventory { type StockInventory (line 23) | pub struct StockInventory { function compute_balance (line 35) | pub fn compute_balance( function compute_stock_values (line 150) | fn compute_stock_values( function compute_balance_empty_legs (line 191) | fn compute_balance_empty_legs() { FILE: rust/ob_core/src/convexity_backtest.rs type Position (line 12) | struct Position { type MonthRecord (line 19) | pub struct MonthRecord { type BacktestResult (line 33) | pub struct BacktestResult { function ns_to_year_month (line 39) | fn ns_to_year_month(ns: i64) -> (i32, u32) { function monthly_rebalance_dates (line 46) | fn monthly_rebalance_dates(stock_dates_ns: &[i64]) -> Vec { function lower_bound (line 67) | fn lower_bound(arr: &[i64], target: i64) -> usize { function find_date_range (line 72) | fn find_date_range(dates_ns: &[i64], target: i64) -> (usize, usize) { function stock_price_on (line 85) | fn stock_price_on(stock_dates_ns: &[i64], stock_prices: &[f64], target_n... function close_position (line 97) | fn close_position( function run_backtest (line 128) | pub fn run_backtest( function make_ts (line 319) | fn make_ts(year: i32, month: u32, day: u32) -> i64 { function test_monthly_rebalance_dates (line 329) | fn test_monthly_rebalance_dates() { function test_stock_price_on_exact (line 346) | fn test_stock_price_on_exact() { function test_stock_price_on_before (line 353) | fn test_stock_price_on_before() { function test_run_backtest_no_options (line 360) | fn test_run_backtest_no_options() { FILE: rust/ob_core/src/convexity_scoring.rs type DailyScore (line 3) | pub struct DailyScore { function find_target_put (line 19) | pub fn find_target_put( function convexity_ratio (line 53) | pub fn convexity_ratio(strike: f64, underlying: f64, ask: f64, tail_drop... function compute_daily_scores (line 67) | pub fn compute_daily_scores( function test_convexity_ratio_basic (line 136) | fn test_convexity_ratio_basic() { function test_convexity_ratio_otm_after_crash (line 144) | fn test_convexity_ratio_otm_after_crash() { function test_find_target_put (line 151) | fn test_find_target_put() { function test_find_target_put_dte_filter (line 161) | fn test_find_target_put_dte_filter() { function test_find_target_put_skips_zero_ask (line 171) | fn test_find_target_put_skips_zero_ask() { function test_compute_daily_scores (line 181) | fn test_compute_daily_scores() { FILE: rust/ob_core/src/cost_model.rs type CostModel (line 6) | pub enum CostModel { method option_cost (line 20) | pub fn option_cost(&self, _price: f64, quantity: f64, _spc: i64) -> f64 { method stock_cost (line 54) | pub fn stock_cost(&self, _price: f64, quantity: f64) -> f64 { function no_costs (line 69) | fn no_costs() { function per_contract (line 76) | fn per_contract() { function tiered_within_first_tier (line 84) | fn tiered_within_first_tier() { function tiered_spanning_tiers (line 94) | fn tiered_spanning_tiers() { function tiered_beyond_all (line 105) | fn tiered_beyond_all() { function tiered_stock_cost (line 116) | fn tiered_stock_cost() { FILE: rust/ob_core/src/entries.rs function compute_leg_entries (line 21) | pub fn compute_leg_entries( function compute_entry_qty (line 80) | pub fn compute_entry_qty(total_costs: &Series, allocation: f64) -> Polar... function sample_options (line 93) | fn sample_options() -> DataFrame { function compute_entries_excludes_held (line 108) | fn compute_entries_excludes_held() { function compute_qty (line 131) | fn compute_qty() { FILE: rust/ob_core/src/exits.rs function threshold_exit_mask (line 15) | pub fn threshold_exit_mask( function combine_masks_or (line 58) | pub fn combine_masks_or(masks: &[BooleanChunked]) -> BooleanChunked { function threshold_profit_exit (line 74) | fn threshold_profit_exit() { function threshold_loss_exit (line 84) | fn threshold_loss_exit() { function combine_masks (line 94) | fn combine_masks() { FILE: rust/ob_core/src/fill_model.rs type FillModel (line 6) | pub enum FillModel { method fill_price (line 21) | pub fn fill_price(&self, bid: f64, ask: f64, volume: Option, is_b... function market_at_bid_ask_buy (line 50) | fn market_at_bid_ask_buy() { function market_at_bid_ask_sell (line 56) | fn market_at_bid_ask_sell() { function mid_price (line 62) | fn mid_price() { function volume_aware_full_volume (line 69) | fn volume_aware_full_volume() { function volume_aware_zero_volume (line 77) | fn volume_aware_zero_volume() { function volume_aware_half_volume (line 86) | fn volume_aware_half_volume() { function volume_aware_no_volume_data (line 97) | fn volume_aware_no_volume_data() { FILE: rust/ob_core/src/filter.rs type FilterError (line 16) | pub enum FilterError { type Value (line 25) | pub enum Value { type CmpOp (line 34) | pub enum CmpOp { type ArithOp (line 45) | pub enum ArithOp { type FilterExpr (line 54) | pub enum FilterExpr { type Token (line 66) | enum Token { function tokenize (line 88) | fn tokenize(input: &str) -> Result, FilterError> { type Parser (line 198) | struct Parser { method new (line 204) | fn new(tokens: Vec) -> Self { method peek (line 208) | fn peek(&self) -> Option<&Token> { method advance (line 212) | fn advance(&mut self) -> Option { method expect (line 218) | fn expect(&mut self, expected: &Token) -> Result<(), FilterError> { method parse_expr (line 227) | fn parse_expr(&mut self) -> Result { method parse_or (line 232) | fn parse_or(&mut self) -> Result { method parse_and (line 243) | fn parse_and(&mut self) -> Result { method parse_unary (line 254) | fn parse_unary(&mut self) -> Result { method parse_primary (line 264) | fn parse_primary(&mut self) -> Result { method parse_comparison (line 276) | fn parse_comparison(&mut self) -> Result { method parse_value_expr (line 307) | fn parse_value_expr(&mut self) -> Result { method try_parse_arith (line 336) | fn try_parse_arith(&mut self) -> Option<(ArithOp, Value)> { method parse_cmp_op (line 354) | fn parse_cmp_op(&mut self) -> Result { method value_expr_to_value (line 366) | fn value_expr_to_value(&self, ve: ValueExpr) -> Result CmpOp { function parse (line 395) | pub fn parse(query: &str) -> Result { function to_polars_expr (line 409) | pub fn to_polars_expr(filter: &FilterExpr) -> Expr { function value_to_lit (line 440) | fn value_to_lit(value: &Value) -> Expr { function apply_cmp (line 450) | fn apply_cmp(left: Expr, op: CmpOp, right: Expr) -> Expr { type CompiledFilter (line 462) | pub struct CompiledFilter { method new (line 468) | pub fn new(query: &str) -> Result { method apply (line 474) | pub fn apply(&self, df: &DataFrame) -> PolarsResult { method eval_row (line 486) | pub fn eval_row(&self, df: &DataFrame, row_idx: usize) -> bool { function read_f64 (line 493) | fn read_f64(col: &Column, row: usize) -> Option { function read_str (line 508) | fn read_str<'a>(col: &'a Column, row: usize) -> Option<&'a str> { function cmp_f64 (line 514) | fn cmp_f64(lhs: f64, op: CmpOp, rhs: f64) -> bool { function resolve_f64 (line 527) | fn resolve_f64(val: &Value, df: &DataFrame, row: usize) -> Option { function eval_expr_row (line 537) | fn eval_expr_row(expr: &FilterExpr, df: &DataFrame, row: usize) -> bool { function parse_simple_eq (line 599) | fn parse_simple_eq() { function parse_simple_gte (line 608) | fn parse_simple_gte() { function parse_and (line 617) | fn parse_and() { function parse_col_arith (line 635) | fn parse_col_arith() { function parse_chained_and (line 650) | fn parse_chained_and() { function compiled_filter_apply (line 660) | fn compiled_filter_apply() { function compiled_filter_dte_range (line 673) | fn compiled_filter_dte_range() { function parse_scientific_notation (line 686) | fn parse_scientific_notation() { function parse_scientific_notation_positive_exp (line 698) | fn parse_scientific_notation_positive_exp() { function parse_scientific_notation_no_sign (line 710) | fn parse_scientific_notation_no_sign() { function compiled_filter_scientific_notation (line 721) | fn compiled_filter_scientific_notation() { function parse_negative_float_literal (line 732) | fn parse_negative_float_literal() { function parse_negative_int_literal (line 741) | fn parse_negative_int_literal() { function parse_negative_delta_range (line 750) | fn parse_negative_delta_range() { function compiled_filter_negative_delta (line 769) | fn compiled_filter_negative_delta() { function eval_row_simple_eq (line 782) | fn eval_row_simple_eq() { function eval_row_and_filter (line 795) | fn eval_row_and_filter() { function eval_row_col_arith (line 808) | fn eval_row_col_arith() { function eval_row_negative_delta (line 822) | fn eval_row_negative_delta() { function eval_row_matches_apply (line 836) | fn eval_row_matches_apply() { FILE: rust/ob_core/src/inventory.rs function join_inventory_to_market (line 16) | pub fn join_inventory_to_market( function aggregate_by_type (line 124) | pub fn aggregate_by_type( function sample_options (line 153) | fn sample_options() -> DataFrame { function join_computes_values (line 164) | fn join_computes_values() { function aggregate_splits_calls_puts (line 192) | fn aggregate_splits_calls_puts() { FILE: rust/ob_core/src/risk.rs type RiskConstraint (line 8) | pub enum RiskConstraint { method check (line 21) | pub fn check( function check_all (line 49) | pub fn check_all( function max_delta_allows (line 64) | fn max_delta_allows() { function max_delta_rejects (line 72) | fn max_delta_rejects() { function max_delta_negative (line 80) | fn max_delta_negative() { function max_vega_allows (line 88) | fn max_vega_allows() { function max_vega_rejects (line 96) | fn max_vega_rejects() { function max_drawdown_allows (line 104) | fn max_drawdown_allows() { function max_drawdown_rejects (line 112) | fn max_drawdown_rejects() { function max_drawdown_zero_peak (line 120) | fn max_drawdown_zero_peak() { function check_all_passes (line 127) | fn check_all_passes() { function check_all_fails_one (line 138) | fn check_all_fails_one() { function check_all_empty_passes (line 150) | fn check_all_empty_passes() { FILE: rust/ob_core/src/signal_selector.rs type SignalSelector (line 8) | pub enum SignalSelector { method column_requirements (line 20) | pub fn column_requirements(&self) -> Vec<&str> { method select_index (line 30) | pub fn select_index(&self, candidates: &DataFrame) -> usize { function sample_candidates (line 109) | fn sample_candidates() -> DataFrame { function first_match (line 119) | fn first_match() { function nearest_delta (line 126) | fn nearest_delta() { function nearest_delta_between (line 136) | fn nearest_delta_between() { function max_open_interest (line 147) | fn max_open_interest() { function missing_column_falls_back (line 156) | fn missing_column_falls_back() { function column_requirements_check (line 166) | fn column_requirements_check() { FILE: rust/ob_core/src/stats.rs constant TRADING_DAYS_PER_YEAR (line 7) | const TRADING_DAYS_PER_YEAR: f64 = 252.0; constant MONTHS_PER_YEAR (line 8) | const MONTHS_PER_YEAR: f64 = 12.0; type PeriodStats (line 16) | pub struct PeriodStats { type LookbackReturns (line 29) | pub struct LookbackReturns { type FullStats (line 42) | pub struct FullStats { type Stats (line 89) | pub struct Stats { function compute_stats (line 107) | pub fn compute_stats( function compute_full_stats (line 155) | pub fn compute_full_stats( function cum_return (line 253) | fn cum_return(returns: &[f64]) -> f64 { function annualize (line 257) | fn annualize(total_return: f64, years: f64) -> f64 { function mean (line 265) | fn mean(values: &[f64]) -> f64 { function std_dev (line 272) | fn std_dev(values: &[f64]) -> f64 { function skewness (line 282) | fn skewness(values: &[f64]) -> f64 { function kurtosis_excess (line 299) | fn kurtosis_excess(values: &[f64]) -> f64 { function sharpe (line 317) | fn sharpe(returns: &[f64], risk_free_rate: f64, periods_per_year: f64) -... function sortino (line 330) | fn sortino(returns: &[f64], risk_free_rate: f64, periods_per_year: f64) ... function percentile (line 347) | fn percentile(values: &[f64], pct: f64) -> f64 { type DrawdownResult (line 366) | struct DrawdownResult { function compute_drawdown_full (line 373) | fn compute_drawdown_full(daily_returns: &[f64]) -> DrawdownResult { function compute_period_stats (line 437) | fn compute_period_stats(returns: &[f64], risk_free_rate: f64, periods_pe... type ResampleFreq (line 456) | enum ResampleFreq { function resample_returns (line 462) | fn resample_returns( function period_key (line 505) | fn period_key(ts_ns: i64, freq: ResampleFreq) -> (i32, u32) { function days_to_ymd (line 517) | fn days_to_ymd(days: i32) -> (i32, u32, u32) { function compute_lookback (line 534) | fn compute_lookback(total_capital: &[f64], timestamps_ns: &[i64]) -> Loo... function ymd_to_ns (line 583) | fn ymd_to_ns(year: i32, month: u32, day: u32) -> i64 { function subtract_months_ns (line 595) | fn subtract_months_ns(ts_ns: i64, months: u32) -> i64 { function compute_turnover (line 609) | fn compute_turnover(stock_weights: &[f64], n_stocks: usize) -> f64 { function compute_herfindahl (line 632) | fn compute_herfindahl(stock_weights: &[f64], n_stocks: usize) -> f64 { type TradeStatsResult (line 656) | struct TradeStatsResult { function compute_trade_stats (line 669) | fn compute_trade_stats(pnls: &[f64]) -> TradeStatsResult { function stats_empty (line 750) | fn stats_empty() { function stats_simple_returns (line 756) | fn stats_simple_returns() { function drawdown_calculation (line 764) | fn drawdown_calculation() { function profit_factor_calculation (line 771) | fn profit_factor_calculation() { function full_stats_empty (line 780) | fn full_stats_empty() { function full_stats_basic (line 787) | fn full_stats_basic() { function full_stats_drawdown_avg (line 807) | fn full_stats_drawdown_avg() { function full_stats_trade_pnls (line 826) | fn full_stats_trade_pnls() { function full_stats_turnover (line 840) | fn full_stats_turnover() { function full_stats_herfindahl (line 853) | fn full_stats_herfindahl() { function percentile_basic (line 861) | fn percentile_basic() { function days_to_ymd_epoch (line 872) | fn days_to_ymd_epoch() { function days_to_ymd_known_date (line 878) | fn days_to_ymd_known_date() { function ymd_roundtrip (line 885) | fn ymd_roundtrip() { function lookback_basic (line 893) | fn lookback_basic() { function monthly_resample (line 912) | fn monthly_resample() { FILE: rust/ob_core/src/types.rs type Direction (line 4) | pub enum Direction { method sign (line 11) | pub fn sign(self) -> f64 { method price_column (line 19) | pub fn price_column(self) -> &'static str { method invert (line 27) | pub fn invert(self) -> Direction { type OptionType (line 36) | pub enum OptionType { method as_str (line 42) | pub fn as_str(self) -> &'static str { type LegConfig (line 52) | pub struct LegConfig { type Greeks (line 68) | pub struct Greeks { method new (line 76) | pub fn new(delta: f64, gamma: f64, theta: f64, vega: f64) -> Self { method scale (line 80) | pub fn scale(self, s: f64) -> Self { type Output (line 91) | type Output = Self; method add (line 92) | fn add(self, rhs: Self) -> Self { method add_assign (line 103) | fn add_assign(&mut self, rhs: Self) { type BalanceRow (line 113) | pub struct BalanceRow { function direction_sign (line 128) | fn direction_sign() { function direction_invert (line 134) | fn direction_invert() { function greeks_add (line 140) | fn greeks_add() { function greeks_scale (line 149) | fn greeks_scale() { FILE: rust/ob_python/src/arrow_bridge.rs function py_to_polars (line 10) | pub fn py_to_polars(py_df: PyDataFrame) -> DataFrame { function polars_to_py (line 15) | pub fn polars_to_py(df: DataFrame) -> PyDataFrame { FILE: rust/ob_python/src/lib.rs function _ob_rust (line 15) | fn _ob_rust(m: &Bound<'_, PyModule>) -> PyResult<()> { FILE: rust/ob_python/src/py_backtest.rs function parse_schema (line 17) | pub fn parse_schema(schema: &Bound<'_, PyDict>) -> PyResult) -> PyResult { function parse_fill_model (line 67) | pub fn parse_fill_model(d: &Bound<'_, PyDict>) -> PyResult { function parse_signal_selector (line 88) | pub fn parse_signal_selector(d: &Bound<'_, PyDict>) -> PyResult) -> PyResult) -> PyResult) -> PyResult { function parse_slot_config (line 379) | fn parse_slot_config(d: &Bound<'_, PyDict>) -> PyResult, key: &str, default: &str) -> PyRes... function get_f64 (line 484) | pub fn get_f64(d: &Bound<'_, PyDict>, key: &str, default: f64) -> PyResu... function get_i64 (line 487) | pub fn get_i64(d: &Bound<'_, PyDict>, key: &str, default: i64) -> PyResu... FILE: rust/ob_python/src/py_balance.rs function update_balance (line 21) | pub fn update_balance( FILE: rust/ob_python/src/py_convexity.rs function compute_daily_scores (line 13) | pub fn compute_daily_scores<'py>( function run_convexity_backtest (line 67) | pub fn run_convexity_backtest<'py>( FILE: rust/ob_python/src/py_entries.rs function compute_entries (line 23) | pub fn compute_entries( FILE: rust/ob_python/src/py_execution.rs function rust_option_cost (line 23) | pub fn rust_option_cost( function rust_stock_cost (line 47) | pub fn rust_stock_cost( function rust_fill_price (line 78) | pub fn rust_fill_price( function rust_nearest_delta_index (line 107) | pub fn rust_nearest_delta_index(values: Vec, target: f64) -> usize { function rust_max_value_index (line 130) | pub fn rust_max_value_index(values: Vec) -> usize { function rust_risk_check (line 160) | pub fn rust_risk_check( FILE: rust/ob_python/src/py_exits.rs function compute_exit_mask (line 11) | pub fn compute_exit_mask( FILE: rust/ob_python/src/py_filter.rs type CompiledFilter (line 12) | pub struct CompiledFilter { method new (line 19) | fn new(query: &str) -> PyResult { method apply (line 25) | fn apply(&self, data: PyDataFrame) -> PyResult { method __repr__ (line 34) | fn __repr__(&self) -> String { function compile_filter (line 41) | pub fn compile_filter(query: &str) -> PyResult { function apply_filter (line 47) | pub fn apply_filter(query: &str, data: PyDataFrame) -> PyResult, key: &str, val: Option... FILE: rust/ob_python/src/py_sweep.rs type SweepOverrides (line 28) | struct SweepOverrides { type SweepResult (line 46) | struct SweepResult { function merge_config (line 55) | fn merge_config(base: &BacktestConfig, overrides: &SweepOverrides) -> Ba... function run_single_sweep (line 112) | fn run_single_sweep( function parse_opt_f64 (line 154) | fn parse_opt_f64(dict: &Bound<'_, PyDict>, key: &str) -> PyResult) -> PyResult { function parallel_sweep (line 275) | pub fn parallel_sweep( FILE: tests/analytics/test_analytics_pbt.py function _make_balance (line 27) | def _make_balance(returns, initial=100_000.0): class TestStatsInvariantsPBT (line 43) | class TestStatsInvariantsPBT: method test_max_drawdown_non_negative (line 46) | def test_max_drawdown_non_negative(self, returns, cap): method test_max_drawdown_at_most_one (line 53) | def test_max_drawdown_at_most_one(self, returns, cap): method test_volatility_non_negative (line 60) | def test_volatility_non_negative(self, returns, cap): method test_total_return_matches_endpoints (line 67) | def test_total_return_matches_endpoints(self, returns, cap): method test_all_positive_returns_positive_total (line 76) | def test_all_positive_returns_positive_total(self, returns, cap): method test_all_negative_returns_negative_total (line 83) | def test_all_negative_returns_negative_total(self, returns, cap): method test_all_positive_zero_drawdown (line 90) | def test_all_positive_zero_drawdown(self, returns, cap): method test_max_drawdown_duration_non_negative (line 98) | def test_max_drawdown_duration_non_negative(self, returns, cap): method test_calmar_sign_matches_return (line 105) | def test_calmar_sign_matches_return(self, returns, cap): class TestStatsEmptyEdgePBT (line 116) | class TestStatsEmptyEdgePBT: method test_empty_balance (line 117) | def test_empty_balance(self): method test_single_row (line 124) | def test_single_row(self, cap): class TestTradeStatsPBT (line 135) | class TestTradeStatsPBT: method test_wins_plus_losses_equals_total (line 138) | def test_wins_plus_losses_equals_total(self, pnls): method test_total_trades_matches_input (line 146) | def test_total_trades_matches_input(self, pnls): method test_all_winners (line 155) | def test_all_winners(self, pnls): method test_all_losers (line 166) | def test_all_losers(self, pnls): method test_largest_win_gte_avg_win (line 176) | def test_largest_win_gte_avg_win(self, pnls): method test_largest_loss_lte_avg_loss (line 185) | def test_largest_loss_lte_avg_loss(self, pnls): method test_profit_factor_non_negative (line 194) | def test_profit_factor_non_negative(self, pnls): class TestSharpePBT (line 206) | class TestSharpePBT: method test_finite (line 209) | def test_finite(self, returns, rf): method test_higher_rf_lower_sharpe (line 216) | def test_higher_rf_lower_sharpe(self, returns): method test_fewer_than_two_returns_zero (line 224) | def test_fewer_than_two_returns_zero(self): class TestSortinoPBT (line 231) | class TestSortinoPBT: method test_finite (line 234) | def test_finite(self, returns, rf): method test_all_positive_returns_zero_sortino (line 241) | def test_all_positive_returns_zero_sortino(self, returns): class TestPeriodStatsPBT (line 253) | class TestPeriodStatsPBT: method test_best_gte_worst (line 256) | def test_best_gte_worst(self, returns, rf): method test_vol_non_negative (line 263) | def test_vol_non_negative(self, returns, rf): method test_mean_between_best_and_worst (line 270) | def test_mean_between_best_and_worst(self, returns, rf): class TestLookbackPBT (line 281) | class TestLookbackPBT: method test_mtd_always_computed (line 284) | def test_mtd_always_computed(self, returns, cap): method test_ytd_always_computed (line 291) | def test_ytd_always_computed(self, returns, cap): method test_all_positive_lookbacks_positive (line 298) | def test_all_positive_lookbacks_positive(self, returns, cap): class TestTurnoverHerfindahlPBT (line 316) | class TestTurnoverHerfindahlPBT: method test_turnover_non_negative (line 319) | def test_turnover_non_negative(self, returns, cap): method test_herfindahl_non_negative (line 326) | def test_herfindahl_non_negative(self, returns, cap): method test_no_stock_cols_zero_turnover (line 331) | def test_no_stock_cols_zero_turnover(self): class TestBalanceRangePBT (line 343) | class TestBalanceRangePBT: method test_range_subset_shorter (line 346) | def test_range_subset_shorter(self, returns, cap): class TestOutputFormattingPBT (line 364) | class TestOutputFormattingPBT: method test_to_dataframe_not_empty (line 367) | def test_to_dataframe_not_empty(self, returns, cap): method test_summary_not_empty (line 376) | def test_summary_not_empty(self, returns, cap): FILE: tests/analytics/test_charts.py function _make_balance (line 17) | def _make_balance() -> pd.DataFrame: function test_weights_chart_returns_fig_ax (line 28) | def test_weights_chart_returns_fig_ax(): function test_weights_chart_no_positions (line 36) | def test_weights_chart_no_positions(): function test_weights_chart_single_symbol (line 47) | def test_weights_chart_single_symbol(): function _make_balance_report (line 61) | def _make_balance_report(days=90): function test_returns_chart_returns_vconcat (line 76) | def test_returns_chart_returns_vconcat(): function test_returns_chart_has_two_panels (line 83) | def test_returns_chart_has_two_panels(): function test_returns_chart_serializes_to_dict (line 90) | def test_returns_chart_serializes_to_dict(): function test_returns_histogram_returns_chart (line 99) | def test_returns_histogram_returns_chart(): function test_returns_histogram_serializes (line 106) | def test_returns_histogram_serializes(): function test_monthly_returns_heatmap_returns_chart (line 114) | def test_monthly_returns_heatmap_returns_chart(): function test_monthly_returns_heatmap_serializes (line 121) | def test_monthly_returns_heatmap_serializes(): function test_returns_chart_has_interval_and_point_params (line 129) | def test_returns_chart_has_interval_and_point_params(): function test_returns_chart_data_included (line 142) | def test_returns_chart_data_included(): FILE: tests/analytics/test_optimization.py function _dummy_run_fn (line 12) | def _dummy_run_fn(param_a=1, param_b=2): function _failing_run_fn (line 24) | def _failing_run_fn(param_a=1): function _dummy_wf_fn (line 31) | def _dummy_wf_fn(start_date, end_date): class TestOptimizationResult (line 43) | class TestOptimizationResult: method test_fields (line 44) | def test_fields(self): class TestGridSweep (line 52) | class TestGridSweep: method test_returns_results_for_all_combos (line 53) | def test_returns_results_for_all_combos(self): method test_sorted_by_sharpe_descending (line 61) | def test_sorted_by_sharpe_descending(self): method test_single_combo (line 70) | def test_single_combo(self): method test_failing_fn_skipped (line 78) | def test_failing_fn_skipped(self): class TestWalkForward (line 88) | class TestWalkForward: method test_returns_splits (line 89) | def test_returns_splits(self): method test_single_split (line 97) | def test_single_split(self): method test_failing_wf_fn_skipped (line 102) | def test_failing_wf_fn_skipped(self): method test_custom_in_sample_pct (line 118) | def test_custom_in_sample_pct(self): FILE: tests/analytics/test_stats.py function _make_balance (line 12) | def _make_balance(returns: list[float], initial: float = 100_000.0) -> p... class TestProfitFactor (line 23) | class TestProfitFactor: method test_profit_factor_dollar_ratio (line 26) | def test_profit_factor_dollar_ratio(self): method test_profit_factor_not_count_ratio (line 35) | def test_profit_factor_not_count_ratio(self): method test_profit_factor_no_losses (line 44) | def test_profit_factor_no_losses(self): method test_profit_factor_no_wins (line 50) | def test_profit_factor_no_wins(self): class TestReturnMetrics (line 57) | class TestReturnMetrics: method test_total_return (line 58) | def test_total_return(self): method test_zero_return (line 64) | def test_zero_return(self): method test_sharpe_positive (line 69) | def test_sharpe_positive(self): class TestDrawdown (line 78) | class TestDrawdown: method test_max_drawdown (line 79) | def test_max_drawdown(self): method test_no_drawdown (line 86) | def test_no_drawdown(self): method test_drawdown_duration (line 92) | def test_drawdown_duration(self): class TestTradeStats (line 100) | class TestTradeStats: method test_wins_losses_count (line 101) | def test_wins_losses_count(self): method test_win_pct (line 109) | def test_win_pct(self): method test_empty_balance (line 115) | def test_empty_balance(self): method test_no_trade_pnls (line 121) | def test_no_trade_pnls(self): class TestToDataframe (line 128) | class TestToDataframe: method test_shape (line 129) | def test_shape(self): method test_summary_string (line 137) | def test_summary_string(self): class TestPeriodStats (line 145) | class TestPeriodStats: method test_daily_stats_computed (line 146) | def test_daily_stats_computed(self): method test_monthly_stats_computed (line 157) | def test_monthly_stats_computed(self): method test_yearly_stats_computed (line 166) | def test_yearly_stats_computed(self): method test_skew_kurtosis_with_enough_data (line 175) | def test_skew_kurtosis_with_enough_data(self): method test_skew_kurtosis_not_computed_with_few_points (line 183) | def test_skew_kurtosis_not_computed_with_few_points(self): class TestAvgDrawdown (line 190) | class TestAvgDrawdown: method test_avg_drawdown_depth (line 191) | def test_avg_drawdown_depth(self): method test_avg_drawdown_duration (line 198) | def test_avg_drawdown_duration(self): class TestLookbackReturns (line 206) | class TestLookbackReturns: method test_mtd_and_ytd (line 207) | def test_mtd_and_ytd(self): method test_one_year_return (line 215) | def test_one_year_return(self): method test_lookback_table (line 222) | def test_lookback_table(self): method test_short_series_lookback_equals_total (line 231) | def test_short_series_lookback_equals_total(self): class TestTurnover (line 240) | class TestTurnover: method test_turnover_zero_for_no_stocks (line 241) | def test_turnover_zero_for_no_stocks(self): method test_turnover_computed_with_stocks (line 246) | def test_turnover_computed_with_stocks(self): class TestHerfindahl (line 261) | class TestHerfindahl: method test_single_stock_hhi_is_one (line 262) | def test_single_stock_hhi_is_one(self): method test_two_equal_stocks_hhi (line 273) | def test_two_equal_stocks_hhi(self): class TestFromBalanceRange (line 288) | class TestFromBalanceRange: method test_slice_start (line 289) | def test_slice_start(self): method test_slice_end (line 297) | def test_slice_end(self): method test_slice_both (line 305) | def test_slice_both(self): method test_empty_balance (line 313) | def test_empty_balance(self): method test_no_slice (line 318) | def test_no_slice(self): FILE: tests/analytics/test_stats_python_path.py function _make_balance (line 14) | def _make_balance(returns, initial=100_000.0, start="2020-01-01"): function _make_balance_with_stocks (line 24) | def _make_balance_with_stocks(returns, initial=100_000.0, start="2020-01... class TestFromBalanceReturnMetrics (line 35) | class TestFromBalanceReturnMetrics: method test_total_return (line 36) | def test_total_return(self): method test_annualized_return (line 43) | def test_annualized_return(self): method test_volatility (line 49) | def test_volatility(self): method test_sharpe_and_sortino (line 55) | def test_sharpe_and_sortino(self): class TestFromBalanceDrawdown (line 64) | class TestFromBalanceDrawdown: method test_drawdown_with_losses (line 65) | def test_drawdown_with_losses(self): method test_avg_drawdown (line 72) | def test_avg_drawdown(self): method test_calmar_ratio (line 79) | def test_calmar_ratio(self): method test_no_drawdown (line 85) | def test_no_drawdown(self): class TestFromBalanceTailRatio (line 93) | class TestFromBalanceTailRatio: method test_tail_ratio_enough_data (line 94) | def test_tail_ratio_enough_data(self): method test_tail_ratio_insufficient_data (line 101) | def test_tail_ratio_insufficient_data(self): class TestFromBalancePeriodStats (line 108) | class TestFromBalancePeriodStats: method test_daily_stats (line 109) | def test_daily_stats(self): method test_skew_kurtosis_need_8_returns (line 119) | def test_skew_kurtosis_need_8_returns(self): method test_skew_kurtosis_with_enough_data (line 126) | def test_skew_kurtosis_with_enough_data(self): class TestFromBalanceLookback (line 135) | class TestFromBalanceLookback: method test_lookback_mtd_ytd (line 136) | def test_lookback_mtd_ytd(self): method test_lookback_trailing_periods (line 143) | def test_lookback_trailing_periods(self): class TestFromBalanceTurnoverHerfindahl (line 153) | class TestFromBalanceTurnoverHerfindahl: method test_turnover_with_stocks (line 154) | def test_turnover_with_stocks(self): method test_herfindahl_with_stocks (line 160) | def test_herfindahl_with_stocks(self): method test_turnover_no_stocks (line 166) | def test_turnover_no_stocks(self): method test_herfindahl_no_stocks (line 172) | def test_herfindahl_no_stocks(self): class TestFromBalanceTradeStats (line 179) | class TestFromBalanceTradeStats: method test_trade_stats_full (line 180) | def test_trade_stats_full(self): method test_trade_stats_all_wins (line 195) | def test_trade_stats_all_wins(self): method test_trade_stats_all_losses (line 202) | def test_trade_stats_all_losses(self): method test_trade_stats_none (line 211) | def test_trade_stats_none(self): class TestSummaryText (line 218) | class TestSummaryText: method test_summary_minimal (line 219) | def test_summary_minimal(self): method test_summary_with_turnover (line 226) | def test_summary_with_turnover(self): class TestLookbackTable (line 234) | class TestLookbackTable: method test_lookback_table_nonempty (line 235) | def test_lookback_table_nonempty(self): method test_lookback_table_empty_when_no_data (line 243) | def test_lookback_table_empty_when_no_data(self): class TestToDataframe (line 249) | class TestToDataframe: method test_has_expected_rows (line 250) | def test_has_expected_rows(self): class TestFromBalanceSharpe (line 260) | class TestFromBalanceSharpe: method test_positive_returns_with_variance (line 261) | def test_positive_returns_with_variance(self): method test_all_positive_sortino_zero (line 268) | def test_all_positive_sortino_zero(self): method test_mixed_returns_sortino_nonzero (line 275) | def test_mixed_returns_sortino_nonzero(self): class TestFromBalanceDispatch (line 282) | class TestFromBalanceDispatch: method test_from_balance_empty (line 285) | def test_from_balance_empty(self): method test_from_balance_basic (line 290) | def test_from_balance_basic(self): method test_from_balance_with_trade_pnls (line 297) | def test_from_balance_with_trade_pnls(self): class TestFromBalanceRange (line 305) | class TestFromBalanceRange: method test_empty_balance (line 308) | def test_empty_balance(self): method test_full_range (line 313) | def test_full_range(self): method test_with_start (line 319) | def test_with_start(self): method test_with_end (line 326) | def test_with_end(self): method test_with_start_and_end (line 332) | def test_with_start_and_end(self): method test_out_of_range_returns_empty (line 338) | def test_out_of_range_returns_empty(self): FILE: tests/analytics/test_summary.py function _make_trade_log_and_balance (line 10) | def _make_trade_log_and_balance(): class TestSummary (line 49) | class TestSummary: method test_returns_styler (line 50) | def test_returns_styler(self): method test_summary_has_expected_rows (line 55) | def test_summary_has_expected_rows(self): method test_total_trades_count (line 64) | def test_total_trades_count(self): method test_win_metrics (line 71) | def test_win_metrics(self): method test_summary_with_missing_exit (line 79) | def test_summary_with_missing_exit(self): FILE: tests/analytics/test_tearsheet.py function _balance (line 16) | def _balance(periods: int = 40) -> pd.DataFrame: function test_build_tearsheet_has_expected_artifacts (line 30) | def test_build_tearsheet_has_expected_artifacts(): function test_build_tearsheet_no_trades (line 39) | def test_build_tearsheet_no_trades(): function test_build_tearsheet_with_risk_free_rate (line 44) | def test_build_tearsheet_with_risk_free_rate(): function test_tearsheet_to_dict_shape (line 53) | def test_tearsheet_to_dict_shape(): function test_tearsheet_exports (line 66) | def test_tearsheet_exports(tmp_path: Path): function test_csv_creates_directories (line 76) | def test_csv_creates_directories(tmp_path: Path): function test_html_contains_tables (line 84) | def test_html_contains_tables(): function test_tearsheet_markdown_fallback_without_tabulate (line 95) | def test_tearsheet_markdown_fallback_without_tabulate(): function test_monthly_return_table_has_year_month_structure (line 108) | def test_monthly_return_table_has_year_month_structure(): function test_monthly_return_table_empty_balance (line 116) | def test_monthly_return_table_empty_balance(): function test_monthly_return_table_no_pct_change (line 121) | def test_monthly_return_table_no_pct_change(): function test_drawdown_series_shape (line 130) | def test_drawdown_series_shape(): function test_drawdown_series_peak_at_start (line 137) | def test_drawdown_series_peak_at_start(): function test_drawdown_series_empty (line 145) | def test_drawdown_series_empty(): function test_drawdown_series_no_total_capital (line 151) | def test_drawdown_series_no_total_capital(): function test_build_tearsheet_single_day (line 161) | def test_build_tearsheet_single_day(): function test_build_tearsheet_flat_returns (line 171) | def test_build_tearsheet_flat_returns(): FILE: tests/analytics/test_trade_log.py function _make_trade (line 10) | def _make_trade(pnl_sign: float = 1.0) -> Trade: class TestTrade (line 27) | class TestTrade: method test_gross_pnl (line 28) | def test_gross_pnl(self): method test_gross_pnl_loss (line 33) | def test_gross_pnl_loss(self): method test_net_pnl_with_commission (line 38) | def test_net_pnl_with_commission(self): method test_return_pct (line 49) | def test_return_pct(self): class TestTradeLog (line 55) | class TestTradeLog: method test_add_and_len (line 56) | def test_add_and_len(self): method test_winners_losers (line 62) | def test_winners_losers(self): method test_net_pnls (line 70) | def test_net_pnls(self): method test_to_dataframe (line 79) | def test_to_dataframe(self): method test_empty_to_dataframe (line 87) | def test_empty_to_dataframe(self): method test_from_legacy_empty (line 92) | def test_from_legacy_empty(self): method test_from_legacy_trade_log (line 96) | def test_from_legacy_trade_log(self): method test_return_pct_zero_entry (line 132) | def test_return_pct_zero_entry(self): FILE: tests/bench/_test_helpers.py function _stocks_from_tuples (line 50) | def _stocks_from_tuples(tuples): function ivy_stocks (line 55) | def ivy_stocks(): function generated_stocks (line 59) | def generated_stocks(): function prod_spy_stocks (line 63) | def prod_spy_stocks(): function slice_stocks (line 67) | def slice_stocks(slice_id): function load_small_stocks (line 73) | def load_small_stocks(): function load_small_options (line 80) | def load_small_options(): function load_large_stocks (line 94) | def load_large_stocks(): function load_large_options (line 99) | def load_large_options(): function load_generated_stocks (line 104) | def load_generated_stocks(): function load_generated_options (line 109) | def load_generated_options(): function load_prod_stocks (line 114) | def load_prod_stocks(): function load_prod_options (line 119) | def load_prod_options(): function slice_data_exists (line 124) | def slice_data_exists(slice_id): function load_slice_stocks (line 131) | def load_slice_stocks(slice_id): function load_slice_options (line 136) | def load_slice_options(slice_id): function buy_put_strategy (line 145) | def buy_put_strategy(schema, underlying="SPX", dte_min=60, dte_max=None, function buy_call_strategy (line 163) | def buy_call_strategy(schema, underlying="SPX", dte_min=60, dte_exit=30): function sell_put_strategy (line 177) | def sell_put_strategy(schema, underlying="SPX", dte_min=60, dte_exit=30): function sell_call_strategy (line 191) | def sell_call_strategy(schema, underlying="SPX", dte_min=60, dte_exit=30): function strangle_strategy (line 205) | def strangle_strategy(schema, underlying="SPX", dte_min=60, dte_exit=30): function straddle_strategy (line 221) | def straddle_strategy(schema, underlying="SPX", dte_min=60, dte_exit=30): function buy_put_spread_strategy (line 237) | def buy_put_spread_strategy(schema, underlying="SPX", dte_min=60, dte_ex... function sell_call_spread_strategy (line 253) | def sell_call_spread_strategy(schema, underlying="SPX", dte_min=60, dte_... function two_leg_strategy (line 269) | def two_leg_strategy(schema, dir1, type1, dir2, type2, function make_cost_model (line 306) | def make_cost_model(name): function make_fill_model (line 319) | def make_fill_model(name): function make_signal_selector (line 332) | def make_signal_selector(name): function _make_engine (line 347) | def _make_engine(alloc, capital, stocks, stocks_data, options_data, function run_backtest (line 366) | def run_backtest(alloc=None, capital=None, strategy_fn=None, function assert_invariants (line 386) | def assert_invariants(eng, min_trades=0, label="", allow_negative_capita... FILE: tests/bench/extract_prod_slices.py function _convert_options (line 72) | def _convert_options(opts: pd.DataFrame, symbol: str, function _convert_underlying (line 107) | def _convert_underlying(und: pd.DataFrame, symbol: str) -> pd.DataFrame: function extract_slice (line 134) | def extract_slice(slice_id: str, spec: dict) -> None: function main (line 202) | def main(): FILE: tests/bench/generate_test_data.py function _generate_trading_dates (line 31) | def _generate_trading_dates(n: int, start: str = "2017-01-03") -> pd.Dat... function _random_walk (line 35) | def _random_walk(rng: np.random.Generator, initial: float, n: int, function generate_stocks (line 42) | def generate_stocks(dates: pd.DatetimeIndex, rng: np.random.Generator) -... function _bs_approx (line 64) | def _bs_approx(S: float, K: float, T: float, vol: float, is_call: bool) ... function generate_options (line 93) | def generate_options(dates: pd.DatetimeIndex, rng: np.random.Generator) ... function main (line 183) | def main(): FILE: tests/bench/test_edge_cases.py class TestAllocationEdgeCases (line 32) | class TestAllocationEdgeCases: method test_zero_options (line 34) | def test_zero_options(self): method test_high_options (line 40) | def test_high_options(self): method test_tiny_stocks (line 45) | def test_tiny_stocks(self): class TestCapitalEdgeCases (line 53) | class TestCapitalEdgeCases: method test_tiny_capital (line 55) | def test_tiny_capital(self): method test_huge_capital (line 59) | def test_huge_capital(self): class TestRebalanceEdgeCases (line 66) | class TestRebalanceEdgeCases: method test_weekly_rebalance (line 68) | def test_weekly_rebalance(self): class TestDirectionAndType (line 75) | class TestDirectionAndType: method test_sell_put (line 77) | def test_sell_put(self): method test_buy_call (line 83) | def test_buy_call(self): class TestSMAGating (line 90) | class TestSMAGating: method test_sma_50 (line 92) | def test_sma_50(self): class TestOptionsBudgetPct (line 99) | class TestOptionsBudgetPct: method test_budget_limits_spending (line 101) | def test_budget_limits_spending(self): class TestNoMatchingEntries (line 114) | class TestNoMatchingEntries: method test_filter_matches_nothing (line 116) | def test_filter_matches_nothing(self): FILE: tests/bench/test_execution_models.py class TestCostModels (line 28) | class TestCostModels: method test_cost_model (line 30) | def test_cost_model(self, cost_name): class TestFillModels (line 37) | class TestFillModels: method test_fill_model (line 39) | def test_fill_model(self, fill_name): class TestSignalSelectors (line 46) | class TestSignalSelectors: method test_signal_selector (line 48) | def test_signal_selector(self, signal_name): class TestRiskConstraints (line 55) | class TestRiskConstraints: method test_max_delta (line 56) | def test_max_delta(self): method test_max_drawdown (line 63) | def test_max_drawdown(self): class TestExitThresholds (line 73) | class TestExitThresholds: method test_profit_exit (line 74) | def test_profit_exit(self): method test_loss_exit (line 86) | def test_loss_exit(self): class TestModelGrid (line 101) | class TestModelGrid: method test_model_combo (line 105) | def test_model_combo(self, cost_name, fill_name, signal_name): FILE: tests/bench/test_invariants.py class TestBalanceSheetInvariants (line 39) | class TestBalanceSheetInvariants: method _engine (line 42) | def _engine(self): method test_total_capital_equals_parts (line 45) | def test_total_capital_equals_parts(self): method test_capital_never_negative (line 48) | def test_capital_never_negative(self): method test_initial_capital_correct (line 52) | def test_initial_capital_correct(self): method test_balance_dates_monotonic (line 56) | def test_balance_dates_monotonic(self): method test_balance_not_empty (line 59) | def test_balance_not_empty(self): method test_cash_column_exists (line 62) | def test_cash_column_exists(self): class TestTradeLogInvariants (line 66) | class TestTradeLogInvariants: method _engine (line 69) | def _engine(self): method test_trade_log_not_empty (line 72) | def test_trade_log_not_empty(self): method test_entry_costs_nonzero (line 75) | def test_entry_costs_nonzero(self): method test_qty_positive_on_entry (line 81) | def test_qty_positive_on_entry(self): method test_trade_dates_within_data_range (line 87) | def test_trade_dates_within_data_range(self): class TestBalanceColumns (line 97) | class TestBalanceColumns: method _engine (line 100) | def _engine(self): method test_required_columns (line 103) | def test_required_columns(self): method test_per_stock_columns (line 113) | def test_per_stock_columns(self): class TestGeneratedDataInvariants (line 121) | class TestGeneratedDataInvariants: method _engine (line 124) | def _engine(self): method test_invariants (line 131) | def test_invariants(self): method test_many_balance_rows (line 134) | def test_many_balance_rows(self): method test_initial_capital (line 137) | def test_initial_capital(self): class TestProductionDataInvariants (line 144) | class TestProductionDataInvariants: method _engine (line 147) | def _engine(self): method test_invariants (line 155) | def test_invariants(self): method test_capital_never_negative (line 158) | def test_capital_never_negative(self): FILE: tests/bench/test_multi_leg.py class TestMultiLegStrategies (line 28) | class TestMultiLegStrategies: method test_strangle (line 30) | def test_strangle(self): method test_straddle (line 34) | def test_straddle(self): method test_put_spread (line 38) | def test_put_spread(self): method test_call_spread (line 42) | def test_call_spread(self): class TestMixedDirections (line 47) | class TestMixedDirections: method test_direction_combo (line 57) | def test_direction_combo(self, d1, t1, d2, t2): class TestPerLegOverrides (line 66) | class TestPerLegOverrides: method test_per_leg_signal_selector (line 68) | def test_per_leg_signal_selector(self): method test_per_leg_fill_model (line 77) | def test_per_leg_fill_model(self): FILE: tests/bench/test_partial_exits.py class TestPartialExitGenerated (line 35) | class TestPartialExitGenerated: method _run (line 37) | def _run(self, strategy_fn): method test_buy_put (line 46) | def test_buy_put(self): method test_sell_put (line 50) | def test_sell_put(self): method test_strangle (line 55) | def test_strangle(self): class TestPartialExitProduction (line 61) | class TestPartialExitProduction: method _run (line 63) | def _run(self, strategy_fn): method test_buy_put_spy (line 72) | def test_buy_put_spy(self): method test_sell_put_spy (line 76) | def test_sell_put_spy(self): class TestPartialExitCashAccounting (line 82) | class TestPartialExitCashAccounting: method test_cash_never_deeply_negative (line 84) | def test_cash_never_deeply_negative(self): FILE: tests/bench/test_sweep.py function _pd_to_pl (line 20) | def _pd_to_pl(df: pd.DataFrame) -> "pl.DataFrame": function _dates_to_ns (line 24) | def _dates_to_ns(dates: list[str]) -> list[int]: function _ensure_datetime_cols (line 28) | def _ensure_datetime_cols(df: pd.DataFrame, cols: list[str]) -> pd.DataF... function _make_test_data (line 36) | def _make_test_data(): function _base_config (line 66) | def _base_config(): function _schema (line 87) | def _schema(): class TestSweep (line 97) | class TestSweep: method test_single_config_matches_direct (line 99) | def test_single_config_matches_direct(self): method test_multiple_configs (line 118) | def test_multiple_configs(self): method test_per_leg_filter_overrides (line 133) | def test_per_leg_filter_overrides(self): method test_bad_filter_returns_error (line 147) | def test_bad_filter_returns_error(self): method test_empty_param_grid (line 159) | def test_empty_param_grid(self): method test_deterministic (line 166) | def test_deterministic(self): class TestGridSweepWrapper (line 184) | class TestGridSweepWrapper: method test_sorted_by_sharpe (line 186) | def test_sorted_by_sharpe(self): FILE: tests/compat/test_bt_overlap_gate.py function test_bt_overlap_gate_stock_only (line 11) | def test_bt_overlap_gate_stock_only(): FILE: tests/conftest.py function pytest_collection_modifyitems (line 8) | def pytest_collection_modifyitems(config, items): FILE: tests/convexity/conftest.py class MockOptionsData (line 10) | class MockOptionsData: method __init__ (line 13) | def __init__(self, df: pd.DataFrame): class MockStocksData (line 17) | class MockStocksData: method __init__ (line 20) | def __init__(self, df: pd.DataFrame): function _make_put_row (line 24) | def _make_put_row(date, strike, bid, ask, delta, underlying, dte, iv, ex... function instrument_config (line 40) | def instrument_config(): function backtest_config (line 53) | def backtest_config(): function synthetic_options (line 61) | def synthetic_options(): function synthetic_stocks (line 80) | def synthetic_stocks(): function empty_options (line 90) | def empty_options(): function empty_stocks (line 100) | def empty_stocks(): FILE: tests/convexity/test_allocator.py class TestPickCheapest (line 12) | class TestPickCheapest: method test_picks_highest_ratio (line 13) | def test_picks_highest_ratio(self): method test_single_instrument (line 17) | def test_single_instrument(self): method test_empty_raises (line 20) | def test_empty_raises(self): class TestEqualWeight (line 25) | class TestEqualWeight: method test_splits_evenly (line 26) | def test_splits_evenly(self): method test_single (line 30) | def test_single(self): method test_empty (line 34) | def test_empty(self): class TestInverseVol (line 38) | class TestInverseVol: method test_lower_vol_gets_more (line 39) | def test_lower_vol_gets_more(self): method test_equal_vol (line 44) | def test_equal_vol(self): method test_zero_vol_falls_back (line 49) | def test_zero_vol_falls_back(self): FILE: tests/convexity/test_backtest.py class TestRunBacktest (line 13) | class TestRunBacktest: method test_returns_monthly_records (line 14) | def test_returns_monthly_records( method test_daily_balance_populated (line 21) | def test_daily_balance_populated( method test_budget_deducted (line 28) | def test_budget_deducted( method test_empty_options (line 35) | def test_empty_options( class TestRunUnhedged (line 43) | class TestRunUnhedged: method test_returns_correct_shape (line 44) | def test_returns_correct_shape(self, synthetic_stocks, backtest_config): method test_initial_value_matches_capital (line 52) | def test_initial_value_matches_capital(self, synthetic_stocks, backtes... FILE: tests/convexity/test_config.py class TestConfig (line 10) | class TestConfig: method test_instrument_defaults (line 11) | def test_instrument_defaults(self): method test_backtest_defaults (line 18) | def test_backtest_defaults(self): method test_default_config (line 23) | def test_default_config(self): FILE: tests/core/test_types.py class TestDirection (line 13) | class TestDirection: method test_buy_price_column_is_ask (line 14) | def test_buy_price_column_is_ask(self): method test_sell_price_column_is_bid (line 17) | def test_sell_price_column_is_bid(self): method test_invert_buy (line 20) | def test_invert_buy(self): method test_invert_sell (line 23) | def test_invert_sell(self): method test_decoupled_from_column_name (line 26) | def test_decoupled_from_column_name(self): class TestOptionType (line 36) | class TestOptionType: method test_invert_call (line 37) | def test_invert_call(self): method test_invert_put (line 40) | def test_invert_put(self): class TestOrder (line 48) | class TestOrder: method test_invert_bto (line 49) | def test_invert_bto(self): method test_invert_stc (line 52) | def test_invert_stc(self): method test_invert_sto (line 55) | def test_invert_sto(self): method test_invert_btc (line 58) | def test_invert_btc(self): class TestGetOrder (line 66) | class TestGetOrder: method test_buy_entry (line 67) | def test_buy_entry(self): method test_buy_exit (line 70) | def test_buy_exit(self): method test_sell_entry (line 73) | def test_sell_entry(self): method test_sell_exit (line 76) | def test_sell_exit(self): class TestGreeks (line 84) | class TestGreeks: method test_default_zeros (line 85) | def test_default_zeros(self): method test_addition (line 92) | def test_addition(self): method test_scalar_multiply (line 101) | def test_scalar_multiply(self): method test_rmul (line 107) | def test_rmul(self): method test_negation (line 112) | def test_negation(self): method test_as_dict (line 118) | def test_as_dict(self): method test_frozen (line 123) | def test_frozen(self): class TestFill (line 136) | class TestFill: method test_buy_fill_notional (line 137) | def test_buy_fill_notional(self): method test_sell_fill_notional (line 142) | def test_sell_fill_notional(self): method test_fill_with_commission (line 147) | def test_fill_with_commission(self): method test_fill_with_slippage (line 153) | def test_fill_with_slippage(self): method test_fill_with_commission_and_slippage (line 158) | def test_fill_with_commission_and_slippage(self): class TestOptionContract (line 168) | class TestOptionContract: method test_creation (line 169) | def test_creation(self): class TestStockAllocation (line 186) | class TestStockAllocation: method test_creation (line 187) | def test_creation(self): method test_stock_alias (line 192) | def test_stock_alias(self): FILE: tests/core/test_types_pbt.py class TestDirectionPBT (line 48) | class TestDirectionPBT: method test_price_column_is_bid_or_ask (line 50) | def test_price_column_is_bid_or_ask(self, d): method test_buy_maps_to_ask (line 54) | def test_buy_maps_to_ask(self, d): method test_invert_changes_price_column (line 61) | def test_invert_changes_price_column(self, d): method test_double_invert_identity (line 65) | def test_double_invert_identity(self, d): method test_invert_is_different (line 69) | def test_invert_is_different(self, d): class TestOptionTypePBT (line 78) | class TestOptionTypePBT: method test_double_invert_identity (line 80) | def test_double_invert_identity(self, ot): method test_invert_is_different (line 84) | def test_invert_is_different(self, ot): method test_call_inverts_to_put (line 88) | def test_call_inverts_to_put(self, ot): class TestOrderPBT (line 100) | class TestOrderPBT: method test_double_invert_identity (line 102) | def test_double_invert_identity(self, o): method test_invert_changes_buy_sell (line 106) | def test_invert_changes_buy_sell(self, o): method test_get_order_exhaustive (line 112) | def test_get_order_exhaustive(self, d, s): method test_get_order_entry_exit_paired (line 118) | def test_get_order_entry_exit_paired(self, d, s): method test_buy_entry_is_bto (line 125) | def test_buy_entry_is_bto(self, d): class TestGreeksFieldsPBT (line 137) | class TestGreeksFieldsPBT: method test_has_four_fields (line 139) | def test_has_four_fields(self, g): method test_frozen (line 144) | def test_frozen(self, g): method test_construction (line 149) | def test_construction(self, d, ga, th, v): class TestGreeksAdditionPBT (line 157) | class TestGreeksAdditionPBT: method test_commutative (line 160) | def test_commutative(self, a, b): method test_associative (line 165) | def test_associative(self, a, b, c): method test_zero_identity (line 170) | def test_zero_identity(self, g): method test_inverse (line 175) | def test_inverse(self, g): class TestGreeksScalarMulPBT (line 179) | class TestGreeksScalarMulPBT: method test_componentwise (line 182) | def test_componentwise(self, g, s): method test_identity (line 191) | def test_identity(self, g): method test_zero (line 196) | def test_zero(self, g): method test_rmul (line 201) | def test_rmul(self, g, s): method test_distributes_over_addition (line 206) | def test_distributes_over_addition(self, a, b, s): class TestFillPBT (line 219) | class TestFillPBT: method test_direction_sign_matches (line 222) | def test_direction_sign_matches(self, p, q, d, s): method test_sell_notional_exceeds_buy (line 229) | def test_sell_notional_exceeds_buy(self, p, q, s, comm, slip): method test_zero_costs_notional (line 239) | def test_zero_costs_notional(self, p, q, d, s): method test_costs_reduce_notional (line 246) | def test_costs_reduce_notional(self, p, q, d, s, comm, slip): method test_higher_commission_lower_notional (line 256) | def test_higher_commission_lower_notional(self, p, q, d, s, c1, c2): class TestStockAllocationPBT (line 268) | class TestStockAllocationPBT: method test_named_tuple_fields (line 271) | def test_named_tuple_fields(self, sym, p): function _greeks_close (line 283) | def _greeks_close(a: Greeks, b: Greeks, tol: float = 1e-10) -> bool: FILE: tests/data/test_filter.py function test_strike_eq_100 (line 6) | def test_strike_eq_100(): function test_strike_lt_100 (line 13) | def test_strike_lt_100(): function test_strike_ge_100 (line 20) | def test_strike_ge_100(): function test_negate_filter (line 27) | def test_negate_filter(): function test_compose_filters_with_and (line 35) | def test_compose_filters_with_and(): function test_compose_filters_with_or (line 45) | def test_compose_filters_with_or(): function test_compose_many_filters (line 54) | def test_compose_many_filters(): function test_add_number_to_field (line 65) | def test_add_number_to_field(): function test_subtract_number_from_field (line 73) | def test_subtract_number_from_field(): function test_multiply_field_by_number (line 81) | def test_multiply_field_by_number(): function test_multiply_on_left (line 89) | def test_multiply_on_left(): function test_filter_from_combined_field (line 97) | def test_filter_from_combined_field(): FILE: tests/data/test_property_based.py function _make_df (line 19) | def _make_df(n_rows, col_name="strike", values=None): class TestFilterProperties (line 31) | class TestFilterProperties: method test_filter_returns_subset (line 37) | def test_filter_returns_subset(self, threshold, n_rows): method test_impossible_range_empty (line 49) | def test_impossible_range_empty(self, n_rows): method test_numeric_filter_bounds (line 62) | def test_numeric_filter_bounds(self, threshold, n_rows): method test_and_is_intersection (line 78) | def test_and_is_intersection(self, lo, hi, n_rows): method test_or_is_union (line 100) | def test_or_is_union(self, lo, hi, n_rows): FILE: tests/data/test_providers.py function options_provider (line 19) | def options_provider(): function stocks_provider (line 24) | def stocks_provider(): class TestCsvOptionsProvider (line 28) | class TestCsvOptionsProvider: method test_is_data_provider (line 29) | def test_is_data_provider(self, options_provider): method test_has_schema (line 33) | def test_has_schema(self, options_provider): method test_data_is_dataframe (line 36) | def test_data_is_dataframe(self, options_provider): method test_start_end_dates (line 39) | def test_start_end_dates(self, options_provider): method test_len (line 44) | def test_len(self, options_provider): method test_iter_dates (line 47) | def test_iter_dates(self, options_provider): class TestCsvStocksProvider (line 52) | class TestCsvStocksProvider: method test_is_data_provider (line 53) | def test_is_data_provider(self, stocks_provider): method test_has_schema (line 57) | def test_has_schema(self, stocks_provider): method test_data_is_dataframe (line 60) | def test_data_is_dataframe(self, stocks_provider): method test_start_end_dates (line 63) | def test_start_end_dates(self, stocks_provider): method test_len (line 67) | def test_len(self, stocks_provider): class TestSchemaReExport (line 71) | class TestSchemaReExport: method test_schema_import (line 72) | def test_schema_import(self): method test_options_schema (line 78) | def test_options_schema(self): FILE: tests/data/test_providers_extended.py function stocks_csv (line 15) | def stocks_csv(tmp_path): function options_csv (line 28) | def options_csv(tmp_path): class TestTiingoData (line 43) | class TestTiingoData: method test_len (line 44) | def test_len(self, stocks_csv): method test_getitem_schema_key (line 48) | def test_getitem_schema_key(self, stocks_csv): method test_setitem (line 54) | def test_setitem(self, stocks_csv): method test_repr (line 60) | def test_repr(self, stocks_csv): method test_start_end_dates (line 65) | def test_start_end_dates(self, stocks_csv): method test_iter_dates (line 70) | def test_iter_dates(self, stocks_csv): method test_apply_filter (line 75) | def test_apply_filter(self, stocks_csv): method test_getattr_passthrough_method (line 81) | def test_getattr_passthrough_method(self, stocks_csv): method test_getattr_passthrough_property (line 88) | def test_getattr_passthrough_property(self, stocks_csv): method test_iter_months (line 93) | def test_iter_months(self, stocks_csv): method test_sma (line 99) | def test_sma(self, stocks_csv): class TestHistoricalOptionsData (line 106) | class TestHistoricalOptionsData: method test_len (line 107) | def test_len(self, options_csv): method test_dte_column_added (line 111) | def test_dte_column_added(self, options_csv): method test_getitem_schema_key (line 116) | def test_getitem_schema_key(self, options_csv): method test_getitem_series_indexing (line 121) | def test_getitem_series_indexing(self, options_csv): method test_setitem (line 127) | def test_setitem(self, options_csv): method test_repr (line 132) | def test_repr(self, options_csv): method test_iter_dates (line 137) | def test_iter_dates(self, options_csv): method test_iter_months (line 142) | def test_iter_months(self, options_csv): method test_getattr_passthrough (line 147) | def test_getattr_passthrough(self, options_csv): method test_apply_filter (line 153) | def test_apply_filter(self, options_csv): method test_start_end_dates (line 159) | def test_start_end_dates(self, options_csv): class TestCsvStocksProvider (line 165) | class TestCsvStocksProvider: method test_data_property (line 166) | def test_data_property(self, stocks_csv): method test_underscore_data (line 171) | def test_underscore_data(self, stocks_csv): method test_schema (line 175) | def test_schema(self, stocks_csv): method test_setitem_getitem (line 179) | def test_setitem_getitem(self, stocks_csv): method test_len (line 184) | def test_len(self, stocks_csv): method test_iter_dates (line 188) | def test_iter_dates(self, stocks_csv): method test_iter_months (line 193) | def test_iter_months(self, stocks_csv): method test_apply_filter (line 198) | def test_apply_filter(self, stocks_csv): method test_start_end_date (line 204) | def test_start_end_date(self, stocks_csv): method test_sma (line 209) | def test_sma(self, stocks_csv): class TestCsvOptionsProvider (line 215) | class TestCsvOptionsProvider: method test_data_property (line 216) | def test_data_property(self, options_csv): method test_underscore_data (line 221) | def test_underscore_data(self, options_csv): method test_setitem_getitem (line 225) | def test_setitem_getitem(self, options_csv): method test_len (line 231) | def test_len(self, options_csv): method test_iter_dates (line 235) | def test_iter_dates(self, options_csv): method test_iter_months (line 240) | def test_iter_months(self, options_csv): method test_apply_filter (line 245) | def test_apply_filter(self, options_csv): method test_start_end_date (line 251) | def test_start_end_date(self, options_csv): method test_schema (line 256) | def test_schema(self, options_csv): FILE: tests/data/test_schema.py class TestSchema (line 9) | class TestSchema: method test_stocks_factory (line 10) | def test_stocks_factory(self): method test_options_factory (line 16) | def test_options_factory(self): method test_getitem (line 23) | def test_getitem(self): method test_getattr_returns_field (line 27) | def test_getattr_returns_field(self): method test_update (line 33) | def test_update(self): method test_contains (line 38) | def test_contains(self): method test_setitem (line 43) | def test_setitem(self): method test_iter (line 48) | def test_iter(self): method test_repr (line 53) | def test_repr(self): method test_equality (line 58) | def test_equality(self): method test_inequality_different_schema (line 63) | def test_inequality_different_schema(self): method test_equality_with_non_schema (line 68) | def test_equality_with_non_schema(self): class TestField (line 73) | class TestField: method test_repr (line 74) | def test_repr(self): method test_comparison_operators (line 79) | def test_comparison_operators(self): method test_equality_operator_string (line 85) | def test_equality_operator_string(self): method test_arithmetic_field_field (line 91) | def test_arithmetic_field_field(self): method test_arithmetic_field_scalar (line 97) | def test_arithmetic_field_scalar(self): method test_radd (line 103) | def test_radd(self): method test_rsub (line 108) | def test_rsub(self): method test_rtruediv (line 113) | def test_rtruediv(self): method test_rmul (line 118) | def test_rmul(self): method test_ne_operator (line 123) | def test_ne_operator(self): class TestFilter (line 130) | class TestFilter: method test_and (line 131) | def test_and(self): method test_or (line 137) | def test_or(self): method test_invert (line 143) | def test_invert(self): method test_call_on_dataframe (line 149) | def test_call_on_dataframe(self): method test_repr (line 157) | def test_repr(self): FILE: tests/engine/test_algo_adapters.py function _run_with_algos (line 26) | def _run_with_algos(algos): function _dummy_ctx (line 44) | def _dummy_ctx(**overrides) -> EnginePipelineContext: function test_engine_algo_monthly_gate_translates (line 62) | def test_engine_algo_monthly_gate_translates(): function test_engine_run_monthly_reset (line 82) | def test_engine_run_monthly_reset(): function test_budget_percent_zero_blocks_option_entries (line 96) | def test_budget_percent_zero_blocks_option_entries(): function test_budget_percent_sets_allocation (line 102) | def test_budget_percent_sets_allocation(): function test_budget_percent_clamps_negative_capital (line 109) | def test_budget_percent_clamps_negative_capital(): function test_range_filter_appends_entry_filter (line 120) | def test_range_filter_appends_entry_filter(): function test_range_filter_missing_column_passes_all (line 132) | def test_range_filter_missing_column_passes_all(): function test_select_by_delta_returns_range_filter (line 145) | def test_select_by_delta_returns_range_filter(): function test_select_by_dte_returns_range_filter (line 151) | def test_select_by_dte_returns_range_filter(): function test_iv_rank_filter_returns_range_filter (line 159) | def test_iv_rank_filter_returns_range_filter(): function test_select_by_dte_strict_filter_skips_candidates (line 165) | def test_select_by_dte_strict_filter_skips_candidates(): function test_max_greek_exposure_delta_blocks (line 177) | def test_max_greek_exposure_delta_blocks(): function test_max_greek_exposure_vega_blocks (line 185) | def test_max_greek_exposure_vega_blocks(): function test_max_greek_exposure_within_limits_continues (line 193) | def test_max_greek_exposure_within_limits_continues(): function test_max_greek_exposure_none_limits_pass (line 200) | def test_max_greek_exposure_none_limits_pass(): function test_exit_on_threshold_sets_override (line 211) | def test_exit_on_threshold_sets_override(): function test_exit_on_threshold_warns_on_all_inf (line 218) | def test_exit_on_threshold_warns_on_all_inf(): function test_exit_on_threshold_no_warn_when_finite (line 226) | def test_exit_on_threshold_no_warn_when_finite(): function test_events_dataframe_has_flattened_columns (line 237) | def test_events_dataframe_has_flattened_columns(): function test_events_dataframe_contains_cash_from_rebalance_start (line 247) | def test_events_dataframe_contains_cash_from_rebalance_start(): function test_events_dataframe_empty_when_no_events (line 256) | def test_events_dataframe_empty_when_no_events(): FILE: tests/engine/test_capital_conservation.py function _ivy_stocks (line 36) | def _ivy_stocks(): function _stocks_data (line 43) | def _stocks_data(): function _options_data (line 49) | def _options_data(): function _buy_strategy (line 62) | def _buy_strategy(schema): function _assert_balance_components_sum (line 72) | def _assert_balance_components_sum(balance, rtol=1e-6): function _assert_no_capital_spike (line 90) | def _assert_no_capital_spike(balance, initial_capital, max_first_day_rat... class TestCapitalConservationAQR (line 103) | class TestCapitalConservationAQR: method setup (line 107) | def setup(self): method test_components_sum_to_total (line 123) | def test_components_sum_to_total(self): method test_no_first_day_spike (line 126) | def test_no_first_day_spike(self): method test_final_capital_plausible (line 129) | def test_final_capital_plausible(self): class TestCapitalConservationSpitznagel (line 138) | class TestCapitalConservationSpitznagel: method setup (line 142) | def setup(self): method test_components_sum_to_total (line 159) | def test_components_sum_to_total(self): class TestCapitalConservationNoTrades (line 163) | class TestCapitalConservationNoTrades: method setup (line 167) | def setup(self): method test_components_sum_to_total (line 190) | def test_components_sum_to_total(self): method test_options_capital_always_zero (line 193) | def test_options_capital_always_zero(self): method test_no_trades (line 196) | def test_no_trades(self): class TestCapitalConservationHighBudget (line 200) | class TestCapitalConservationHighBudget: method setup (line 204) | def setup(self): method test_components_sum_to_total (line 220) | def test_components_sum_to_total(self): method test_no_first_day_spike (line 223) | def test_no_first_day_spike(self): class TestSkipDayCashConservation (line 232) | class TestSkipDayCashConservation: method setup (line 244) | def setup(self): method test_components_sum_to_total (line 268) | def test_components_sum_to_total(self): method test_options_capital_always_zero (line 271) | def test_options_capital_always_zero(self): method test_cash_never_below_options_floor (line 276) | def test_cash_never_below_options_floor(self): method test_no_trades (line 295) | def test_no_trades(self): method test_total_stable_with_flat_prices (line 298) | def test_total_stable_with_flat_prices(self): class TestAQRDeploymentNeverExceedsTotal (line 311) | class TestAQRDeploymentNeverExceedsTotal: method engine (line 329) | def engine(self, request): method test_components_sum_to_total (line 346) | def test_components_sum_to_total(self, engine): method test_total_never_above_initial_on_flat_prices (line 349) | def test_total_never_above_initial_on_flat_prices(self, engine): method test_deployment_never_exceeds_total (line 363) | def test_deployment_never_exceeds_total(self, engine): method test_cash_never_negative (line 380) | def test_cash_never_negative(self, engine): class TestAQRRebalanceCycleAccounting (line 395) | class TestAQRRebalanceCycleAccounting: method setup (line 408) | def setup(self): method test_components_sum_to_total (line 424) | def test_components_sum_to_total(self): method test_total_change_equals_component_change (line 427) | def test_total_change_equals_component_change(self): method test_no_cash_leak_over_full_run (line 447) | def test_no_cash_leak_over_full_run(self): class TestAQRvsSpitznagelZeroBudget (line 466) | class TestAQRvsSpitznagelZeroBudget: method setup (line 483) | def setup(self): method test_both_conserve_capital (line 521) | def test_both_conserve_capital(self): method test_aqr_less_equity_than_spitznagel (line 525) | def test_aqr_less_equity_than_spitznagel(self): method test_aqr_return_leq_spitznagel (line 538) | def test_aqr_return_leq_spitznagel(self): method test_no_trades_in_either (line 548) | def test_no_trades_in_either(self): method test_aqr_has_cash_from_unspent_options (line 552) | def test_aqr_has_cash_from_unspent_options(self): class TestExternallyFundedNoLeakage (line 567) | class TestExternallyFundedNoLeakage: method engine (line 583) | def engine(self, request): method test_components_sum_to_total (line 601) | def test_components_sum_to_total(self, engine): method test_no_phantom_cash_growth (line 604) | def test_no_phantom_cash_growth(self, engine): method test_cash_never_negative (line 624) | def test_cash_never_negative(self, engine): method test_total_capital_bounded (line 631) | def test_total_capital_bounded(self, engine): FILE: tests/engine/test_chaos.py function _ivy_stocks (line 39) | def _ivy_stocks(): function _stocks_data (line 44) | def _stocks_data(): function _options_data (line 50) | def _options_data(): function _build_strategy (line 63) | def _build_strategy(schema, direction=Direction.BUY): function _run_chaos (line 72) | def _run_chaos(options_data, stocks_data=None, cost_model=None, function _assert_finite_or_error (line 96) | def _assert_finite_or_error(fn): class TestNaNInjection (line 111) | class TestNaNInjection: method test_nan_all_bids (line 114) | def test_nan_all_bids(self): method test_nan_all_asks (line 119) | def test_nan_all_asks(self): method test_nan_scattered_bid (line 124) | def test_nan_scattered_bid(self): method test_nan_scattered_ask (line 130) | def test_nan_scattered_ask(self): method test_nan_delta (line 136) | def test_nan_delta(self): method test_nan_volume (line 142) | def test_nan_volume(self): class TestNegativePrices (line 148) | class TestNegativePrices: method test_negative_bid (line 151) | def test_negative_bid(self): method test_negative_ask (line 156) | def test_negative_ask(self): method test_both_negative (line 161) | def test_both_negative(self): class TestInvertedBidAsk (line 168) | class TestInvertedBidAsk: method test_inverted_spread (line 171) | def test_inverted_spread(self): method test_bid_equals_ask (line 179) | def test_bid_equals_ask(self): class TestMissingColumns (line 185) | class TestMissingColumns: method test_missing_delta_column (line 188) | def test_missing_delta_column(self): class TestNoMatchingContracts (line 200) | class TestNoMatchingContracts: method test_all_dte_zero (line 203) | def test_all_dte_zero(self): class TestZeroVolume (line 212) | class TestZeroVolume: method test_zero_volume_fill (line 215) | def test_zero_volume_fill(self): class TestExtremeGreeks (line 225) | class TestExtremeGreeks: method test_extreme_delta_blocked (line 228) | def test_extreme_delta_blocked(self): method test_extreme_vega_blocked (line 239) | def test_extreme_vega_blocked(self): method test_extreme_delta_allowed (line 250) | def test_extreme_delta_allowed(self): class TestDuplicateDates (line 262) | class TestDuplicateDates: method test_duplicate_options_rows (line 265) | def test_duplicate_options_rows(self): class TestCapitalExhaustion (line 273) | class TestCapitalExhaustion: method test_tiny_capital (line 276) | def test_tiny_capital(self): method test_zero_capital (line 285) | def test_zero_capital(self): class TestMassiveSpread (line 295) | class TestMassiveSpread: method test_massive_spread (line 298) | def test_massive_spread(self): method test_massive_spread_mid_fill (line 304) | def test_massive_spread_mid_fill(self): class TestAllExpired (line 313) | class TestAllExpired: method test_all_expired_capital_preserved (line 316) | def test_all_expired_capital_preserved(self): class TestSingleDay (line 327) | class TestSingleDay: method test_single_date (line 330) | def test_single_date(self): FILE: tests/engine/test_clock.py function _make_data (line 9) | def _make_data(n_dates=5): class TestDailyIteration (line 25) | class TestDailyIteration: method test_yields_correct_number_of_dates (line 26) | def test_yields_correct_number_of_dates(self): method test_yields_tuples_of_date_stocks_options (line 32) | def test_yields_tuples_of_date_stocks_options(self): class TestAllDates (line 41) | class TestAllDates: method test_returns_all_unique_dates (line 42) | def test_returns_all_unique_dates(self): class TestRebalanceDates (line 48) | class TestRebalanceDates: method test_zero_freq_returns_empty (line 49) | def test_zero_freq_returns_empty(self): method test_negative_freq_returns_empty (line 55) | def test_negative_freq_returns_empty(self): method test_positive_freq_returns_dates (line 61) | def test_positive_freq_returns_dates(self): class TestMonthlyIteration (line 80) | class TestMonthlyIteration: method test_monthly_mode_yields_first_of_month_dates (line 81) | def test_monthly_mode_yields_first_of_month_dates(self): FILE: tests/engine/test_engine.py function _ivy_stocks (line 22) | def _ivy_stocks(): function _stocks_data (line 27) | def _stocks_data(): function _options_data (line 33) | def _options_data(): function _buy_strategy (line 47) | def _buy_strategy(schema): function _run_engine (line 56) | def _run_engine(cost_model=None): class TestEngineRegressionValues (line 74) | class TestEngineRegressionValues: method setup (line 78) | def setup(self): method test_trade_log_not_empty (line 81) | def test_trade_log_not_empty(self): method test_balance_not_empty (line 84) | def test_balance_not_empty(self): method test_regression_costs (line 87) | def test_regression_costs(self): method test_regression_qtys (line 96) | def test_regression_qtys(self): class TestEngineWithCosts (line 106) | class TestEngineWithCosts: method test_commission_reduces_final_capital (line 109) | def test_commission_reduces_final_capital(self): class TestRunMetadata (line 118) | class TestRunMetadata: method test_metadata_attached_to_trade_log_and_balance (line 121) | def test_metadata_attached_to_trade_log_and_balance(self): class TestEngineInit (line 135) | class TestEngineInit: method test_default_allocation_normalized (line 138) | def test_default_allocation_normalized(self): method test_default_components (line 144) | def test_default_components(self): method test_stop_if_broke_flag (line 151) | def test_stop_if_broke_flag(self): FILE: tests/engine/test_engine_deep.py function _ivy_stocks (line 58) | def _ivy_stocks(): function _stocks_data (line 68) | def _stocks_data(): function _options_data (line 74) | def _options_data(): function _buy_strategy (line 87) | def _buy_strategy(schema): function _sell_strategy (line 96) | def _sell_strategy(schema): function _run_engine (line 105) | def _run_engine(**kwargs): class TestIntrinsicValue (line 135) | class TestIntrinsicValue: method test_call_itm (line 138) | def test_call_itm(self): method test_call_otm (line 141) | def test_call_otm(self): method test_put_itm (line 144) | def test_put_itm(self): method test_put_otm (line 147) | def test_put_otm(self): method test_atm_both (line 150) | def test_atm_both(self): class TestCapitalFlowInvariants (line 160) | class TestCapitalFlowInvariants: method test_total_capital_equals_sum_of_parts (line 163) | def test_total_capital_equals_sum_of_parts(self): method test_accumulated_return_consistent_with_pct_change (line 170) | def test_accumulated_return_consistent_with_pct_change(self): method test_initial_capital_preserved_in_first_row (line 177) | def test_initial_capital_preserved_in_first_row(self): method test_total_capital_never_negative_with_buy_only (line 181) | def test_total_capital_never_negative_with_buy_only(self): method test_stock_qty_columns_present_for_all_stocks (line 185) | def test_stock_qty_columns_present_for_all_stocks(self): class TestOptionsBudget (line 197) | class TestOptionsBudget: method test_budget_pct (line 200) | def test_budget_pct(self): method test_budget_preserves_raw_allocation (line 205) | def test_budget_preserves_raw_allocation(self): method test_budget_changes_trade_sizes_vs_no_budget (line 221) | def test_budget_changes_trade_sizes_vs_no_budget(self): class TestMonthlyMode (line 237) | class TestMonthlyMode: method test_monthly_mode_runs (line 240) | def test_monthly_mode_runs(self): method test_monthly_produces_fewer_balance_rows (line 244) | def test_monthly_produces_fewer_balance_rows(self): class TestCheckExitsDaily (line 255) | class TestCheckExitsDaily: method test_daily_exits_runs_without_error (line 258) | def test_daily_exits_runs_without_error(self): method test_daily_exits_may_close_positions_earlier (line 262) | def test_daily_exits_may_close_positions_earlier(self): class TestStopIfBroke (line 276) | class TestStopIfBroke: method test_completes_without_stopping (line 279) | def test_completes_without_stopping(self): class TestSMAGating (line 290) | class TestSMAGating: method test_sma_gating_runs (line 293) | def test_sma_gating_runs(self): method test_sma_gating_changes_stock_allocation (line 297) | def test_sma_gating_changes_stock_allocation(self): class TestEventLog (line 318) | class TestEventLog: method test_events_dataframe_returns_dataframe (line 325) | def test_events_dataframe_returns_dataframe(self): method test_event_log_has_required_columns (line 330) | def test_event_log_has_required_columns(self): class TestAllocationNormalization (line 343) | class TestAllocationNormalization: method test_unnormalized_sums_to_one (line 346) | def test_unnormalized_sums_to_one(self): method test_already_normalized (line 351) | def test_already_normalized(self): method test_missing_keys_default_to_zero (line 355) | def test_missing_keys_default_to_zero(self): method test_raw_allocation_preserved (line 360) | def test_raw_allocation_preserved(self): class TestMultiStrategy (line 371) | class TestMultiStrategy: method _make_multi_engine (line 374) | def _make_multi_engine(self): method test_two_strategies_equal_weight (line 386) | def test_two_strategies_equal_weight(self): method test_multi_strategy_weights_must_sum_to_one (line 394) | def test_multi_strategy_weights_must_sum_to_one(self): method test_multi_strategy_different_frequencies (line 401) | def test_multi_strategy_different_frequencies(self): method test_multi_strategy_with_daily_exit_checks (line 408) | def test_multi_strategy_with_daily_exit_checks(self): method test_multi_strategy_capital_identity (line 420) | def test_multi_strategy_capital_identity(self): class TestRiskManagementIntegration (line 436) | class TestRiskManagementIntegration: method test_max_delta_blocks_large_positions (line 439) | def test_max_delta_blocks_large_positions(self): method test_max_vega_blocks_entries (line 446) | def test_max_vega_blocks_entries(self): method test_max_drawdown_blocks_during_dd (line 451) | def test_max_drawdown_blocks_during_dd(self): method test_no_constraints_allows_all (line 456) | def test_no_constraints_allows_all(self): method test_compound_constraints (line 461) | def test_compound_constraints(self): method test_risk_events_logged_on_block (line 467) | def test_risk_events_logged_on_block(self): class TestExecutionCombinations (line 482) | class TestExecutionCombinations: method test_midprice_fill (line 485) | def test_midprice_fill(self): method test_volume_aware_fill (line 489) | def test_volume_aware_fill(self): method test_per_contract_commission (line 493) | def test_per_contract_commission(self): method test_tiered_commission (line 497) | def test_tiered_commission(self): method test_max_open_interest_selector (line 501) | def test_max_open_interest_selector(self): method test_commission_reduces_capital_consistently (line 505) | def test_commission_reduces_capital_consistently(self): class TestMaxNotionalPct (line 521) | class TestMaxNotionalPct: method test_max_notional_limits_sell_positions (line 524) | def test_max_notional_limits_sell_positions(self): class TestSellDirectionStrategy (line 545) | class TestSellDirectionStrategy: method test_sell_puts_run (line 548) | def test_sell_puts_run(self): method test_sell_entry_costs_are_negative (line 561) | def test_sell_entry_costs_are_negative(self): class TestExitThresholds (line 584) | class TestExitThresholds: method test_very_tight_profit_threshold (line 587) | def test_very_tight_profit_threshold(self): method test_very_tight_loss_threshold (line 603) | def test_very_tight_loss_threshold(self): method test_both_thresholds_at_zero_forces_immediate_exit (line 619) | def test_both_thresholds_at_zero_forces_immediate_exit(self): class TestRunMetadataDeep (line 642) | class TestRunMetadataDeep: method test_metadata_config_hash_deterministic (line 645) | def test_metadata_config_hash_deterministic(self): method test_metadata_data_snapshot_hash_deterministic (line 651) | def test_metadata_data_snapshot_hash_deterministic(self): method test_metadata_has_data_snapshot (line 656) | def test_metadata_has_data_snapshot(self): method test_metadata_has_framework_key (line 663) | def test_metadata_has_framework_key(self): method test_multi_strategy_has_metadata (line 667) | def test_multi_strategy_has_metadata(self): class TestRebalanceFrequency (line 689) | class TestRebalanceFrequency: method test_rebalance_freq_zero_means_no_rebalance (line 692) | def test_rebalance_freq_zero_means_no_rebalance(self): method test_high_rebalance_freq (line 707) | def test_high_rebalance_freq(self): method test_rebalance_freq_1_vs_2_differ (line 711) | def test_rebalance_freq_1_vs_2_differ(self): class TestPerLegOverrides (line 728) | class TestPerLegOverrides: method test_per_leg_signal_selector (line 731) | def test_per_leg_signal_selector(self): method test_per_leg_fill_model (line 754) | def test_per_leg_fill_model(self): method test_midprice_fill_produces_different_costs (line 778) | def test_midprice_fill_produces_different_costs(self): class TestEngineEdgeCases (line 794) | class TestEngineEdgeCases: method test_all_cash_allocation (line 797) | def test_all_cash_allocation(self): method test_tiny_initial_capital (line 810) | def test_tiny_initial_capital(self): method test_large_initial_capital (line 824) | def test_large_initial_capital(self): FILE: tests/engine/test_engine_unit.py class TestBacktestEngineRepr (line 8) | class TestBacktestEngineRepr: method test_repr_basic (line 9) | def test_repr_basic(self): method test_repr_with_custom_cost_model (line 19) | def test_repr_with_custom_cost_model(self): class TestSha256Json (line 29) | class TestSha256Json: method test_deterministic (line 30) | def test_deterministic(self): method test_different_inputs_different_hashes (line 37) | def test_different_inputs_different_hashes(self): method test_key_order_independent (line 42) | def test_key_order_independent(self): class TestGitSha (line 48) | class TestGitSha: method test_returns_string (line 49) | def test_returns_string(self): class TestFlatTradeLogToMultiIndex (line 56) | class TestFlatTradeLogToMultiIndex: method test_empty_dataframe (line 57) | def test_empty_dataframe(self): method test_converts_double_underscore_columns (line 65) | def test_converts_double_underscore_columns(self): class TestEventsDataframe (line 81) | class TestEventsDataframe: method test_empty_events (line 82) | def test_empty_events(self): class TestAllocationNormalization (line 91) | class TestAllocationNormalization: method test_normalizes_to_sum_one (line 92) | def test_normalizes_to_sum_one(self): method test_missing_keys_default_to_zero (line 99) | def test_missing_keys_default_to_zero(self): FILE: tests/engine/test_full_liquidation.py function _ivy_stocks (line 30) | def _ivy_stocks(): function _stocks_data (line 35) | def _stocks_data(): function _options_data (line 41) | def _options_data(): function _build_strategy (line 54) | def _build_strategy(schema, direction=Direction.BUY): function _run (line 63) | def _run(cost_model=None, direction=Direction.BUY, signal_selector=None): class TestTradePattern (line 86) | class TestTradePattern: method setup (line 90) | def setup(self): method test_trades_are_entries (line 93) | def test_trades_are_entries(self): method test_exit_filter_produces_exits (line 99) | def test_exit_filter_produces_exits(self): method test_first_trade_is_entry (line 105) | def test_first_trade_is_entry(self): class TestCashAccounting (line 116) | class TestCashAccounting: method setup (line 120) | def setup(self): method test_max_drawdown_under_100_pct (line 123) | def test_max_drawdown_under_100_pct(self): method test_total_capital_always_positive (line 130) | def test_total_capital_always_positive(self): method test_total_capital_equals_sum_of_parts (line 135) | def test_total_capital_equals_sum_of_parts(self): method test_initial_capital_preserved (line 143) | def test_initial_capital_preserved(self): method test_no_capital_inflation (line 148) | def test_no_capital_inflation(self): class TestDirectionVariants (line 162) | class TestDirectionVariants: method test_buy_put_cash_stays_positive (line 163) | def test_buy_put_cash_stays_positive(self): method test_sell_put_has_credit_entries (line 167) | def test_sell_put_has_credit_entries(self): method test_sell_put_max_dd_under_100 (line 176) | def test_sell_put_max_dd_under_100(self): class TestCommissionImpact (line 187) | class TestCommissionImpact: method test_commission_reduces_capital (line 188) | def test_commission_reduces_capital(self): method test_high_commission_still_positive (line 196) | def test_high_commission_still_positive(self): FILE: tests/engine/test_max_notional.py function _ivy_stocks (line 18) | def _ivy_stocks(): function _stocks_data (line 23) | def _stocks_data(): function _options_data (line 29) | def _options_data(): function _buy_strategy (line 42) | def _buy_strategy(schema): function _sell_strategy (line 52) | def _sell_strategy(schema): function _straddle_strategy (line 62) | def _straddle_strategy(schema): function _run_engine (line 75) | def _run_engine(max_notional_pct=None, strategy_fn=None): class TestMaxNotionalPct (line 94) | class TestMaxNotionalPct: method test_none_is_backward_compatible (line 97) | def test_none_is_backward_compatible(self): method test_long_only_unaffected (line 103) | def test_long_only_unaffected(self): method test_sell_strategy_capped (line 109) | def test_sell_strategy_capped(self): method test_zero_cap_blocks_all_short_trades (line 119) | def test_zero_cap_blocks_all_short_trades(self): method test_generous_cap_allows_trades (line 124) | def test_generous_cap_allows_trades(self): method test_straddle_both_legs_contribute_notional (line 131) | def test_straddle_both_legs_contribute_notional(self): method test_cap_monotonic (line 139) | def test_cap_monotonic(self): FILE: tests/engine/test_multi_strategy.py function data_dir (line 21) | def data_dir(): function _make_engine (line 25) | def _make_engine(data_dir): class TestStrategyAllocation (line 56) | class TestStrategyAllocation: method test_fields (line 57) | def test_fields(self): class TestMultiStrategyEngine (line 65) | class TestMultiStrategyEngine: method test_weight_normalization (line 66) | def test_weight_normalization(self): method test_equal_weights (line 79) | def test_equal_weights(self): method test_run_with_mocked_engines (line 89) | def test_run_with_mocked_engines(self): method test_run_engine_without_balance (line 124) | def test_run_engine_without_balance(self): method test_run_with_data (line 141) | def test_run_with_data(self, data_dir): FILE: tests/engine/test_multi_strategy_engine.py function _ivy_stocks (line 28) | def _ivy_stocks(): function _stocks_data (line 35) | def _stocks_data(): function _options_data (line 41) | def _options_data(): function _buy_put_strategy (line 54) | def _buy_put_strategy(schema): function _sell_call_strategy (line 64) | def _sell_call_strategy(schema): function _make_engine (line 74) | def _make_engine(**kwargs): class TestStrategySlot (line 90) | class TestStrategySlot: method test_dataclass_fields (line 91) | def test_dataclass_fields(self): class TestAddStrategy (line 111) | class TestAddStrategy: method test_adds_slot (line 112) | def test_adds_slot(self): method test_auto_names (line 120) | def test_auto_names(self): method test_custom_names (line 128) | def test_custom_names(self): method test_not_multi_strategy_by_default (line 140) | def test_not_multi_strategy_by_default(self): class TestValidation (line 149) | class TestValidation: method test_weights_must_sum_to_one (line 150) | def test_weights_must_sum_to_one(self): class TestSameFrequency (line 163) | class TestSameFrequency: method setup (line 165) | def setup(self): method test_balance_not_empty (line 176) | def test_balance_not_empty(self): method test_balance_has_required_columns (line 179) | def test_balance_has_required_columns(self): method test_has_run_metadata (line 186) | def test_has_run_metadata(self): method test_trade_log_type (line 189) | def test_trade_log_type(self): class TestDifferentFrequency (line 198) | class TestDifferentFrequency: method setup (line 200) | def setup(self): method test_balance_not_empty (line 213) | def test_balance_not_empty(self): method test_total_capital_computed (line 216) | def test_total_capital_computed(self): class TestBackwardCompat (line 226) | class TestBackwardCompat: method test_single_strategy_api_unchanged (line 227) | def test_single_strategy_api_unchanged(self): class TestSharedCash (line 240) | class TestSharedCash: method test_cash_flows_into_shared_pool (line 241) | def test_cash_flows_into_shared_pool(self): class TestPerStrategyExitThresholds (line 259) | class TestPerStrategyExitThresholds: method test_different_exit_thresholds (line 260) | def test_different_exit_thresholds(self): class TestPerStrategyDailyExits (line 281) | class TestPerStrategyDailyExits: method test_daily_exits_per_slot (line 282) | def test_daily_exits_per_slot(self): method test_global_check_exits_daily (line 296) | def test_global_check_exits_daily(self): class TestStopIfBroke (line 314) | class TestStopIfBroke: method test_stop_halts_multi_strategy (line 315) | def test_stop_halts_multi_strategy(self): class TestRustGate (line 333) | class TestRustGate: method test_multi_strategy_produces_metadata (line 334) | def test_multi_strategy_produces_metadata(self): class TestSingleSlotEquivalence (line 348) | class TestSingleSlotEquivalence: method test_single_slot_produces_balance (line 349) | def test_single_slot_produces_balance(self): class TestOptionsBudget (line 365) | class TestOptionsBudget: method test_options_budget_pct (line 366) | def test_options_budget_pct(self): FILE: tests/engine/test_per_leg_overrides.py function _ivy_stocks (line 25) | def _ivy_stocks(): function _stocks_data (line 30) | def _stocks_data(): function _options_data (line 36) | def _options_data(): class TestPerLegSignalSelector (line 49) | class TestPerLegSignalSelector: method test_leg_selector_overrides_engine (line 56) | def test_leg_selector_overrides_engine(self): method test_engine_selector_used_when_leg_has_none (line 88) | def test_engine_selector_used_when_leg_has_none(self): class TestPerLegFillModel (line 114) | class TestPerLegFillModel: method test_midprice_differs_from_market (line 117) | def test_midprice_differs_from_market(self): FILE: tests/engine/test_pipeline.py function _prices (line 59) | def _prices() -> pd.DataFrame: function test_pipeline_rebalances_on_month_start_only (line 68) | def test_pipeline_rebalances_on_month_start_only(): function test_run_monthly_reset_allows_rerun (line 86) | def test_run_monthly_reset_allows_rerun(): function test_drawdown_guard_blocks_rebalance (line 99) | def test_drawdown_guard_blocks_rebalance(): function test_drawdown_guard_reset (line 124) | def test_drawdown_guard_reset(): class _StopAlgo (line 143) | class _StopAlgo: method __call__ (line 144) | def __call__(self, ctx: PipelineContext) -> StepDecision: function test_stop_algo_halts_pipeline_early (line 150) | def test_stop_algo_halts_pipeline_early(): function test_select_these_filters_missing_symbols (line 169) | def test_select_these_filters_missing_symbols(): function test_select_these_case_insensitive (line 184) | def test_select_these_case_insensitive(): function test_weigh_specified_normalizes (line 193) | def test_weigh_specified_normalizes(): function test_weigh_specified_skips_on_empty_selected (line 208) | def test_weigh_specified_skips_on_empty_selected(): function test_rebalance_computes_floor_qty (line 226) | def test_rebalance_computes_floor_qty(): function test_rebalance_skips_zero_price (line 241) | def test_rebalance_skips_zero_price(): function test_balance_has_expected_columns (line 259) | def test_balance_has_expected_columns(): function test_logs_dataframe_schema (line 270) | def test_logs_dataframe_schema(): function test_empty_run_returns_empty_balance (line 282) | def test_empty_run_returns_empty_balance(): function test_multi_symbol_rebalance (line 293) | def test_multi_symbol_rebalance(): function _daily_prices (line 314) | def _daily_prices(symbols=("SPY", "TLT"), days=60, seed=42) -> pd.DataFr... function _weekly_prices (line 326) | def _weekly_prices() -> pd.DataFrame: function _ctx (line 335) | def _ctx(prices=None, total_capital=1000.0, cash=1000.0, positions=None, function test_run_weekly_triggers_once_per_week (line 364) | def test_run_weekly_triggers_once_per_week(): function test_run_weekly_reset (line 378) | def test_run_weekly_reset(): function test_run_weekly_skips_same_week (line 387) | def test_run_weekly_skips_same_week(): function test_run_quarterly_triggers_once_per_quarter (line 399) | def test_run_quarterly_triggers_once_per_quarter(): function test_run_quarterly_skips_same_quarter (line 417) | def test_run_quarterly_skips_same_quarter(): function test_run_quarterly_reset (line 425) | def test_run_quarterly_reset(): function test_run_yearly_triggers_once_per_year (line 436) | def test_run_yearly_triggers_once_per_year(): function test_run_yearly_skips_same_year (line 450) | def test_run_yearly_skips_same_year(): function test_run_yearly_reset (line 458) | def test_run_yearly_reset(): function test_run_daily_always_continues (line 469) | def test_run_daily_always_continues(): function test_run_daily_full_pipeline (line 475) | def test_run_daily_full_pipeline(): function test_run_once_only_first_date (line 491) | def test_run_once_only_first_date(): function test_run_once_reset (line 501) | def test_run_once_reset(): function test_run_once_full_pipeline (line 511) | def test_run_once_full_pipeline(): function test_run_on_date_specific_dates (line 527) | def test_run_on_date_specific_dates(): function test_run_on_date_accepts_timestamps (line 537) | def test_run_on_date_accepts_timestamps(): function test_run_on_date_full_pipeline (line 543) | def test_run_on_date_full_pipeline(): function test_run_after_date_skips_before (line 562) | def test_run_after_date_skips_before(): function test_run_after_date_full_pipeline (line 572) | def test_run_after_date_full_pipeline(): function test_run_every_n_periods (line 592) | def test_run_every_n_periods(): function test_run_every_n_periods_reset (line 606) | def test_run_every_n_periods_reset(): function test_or_passes_if_any_child_passes (line 620) | def test_or_passes_if_any_child_passes(): function test_or_skips_if_all_children_skip (line 627) | def test_or_skips_if_all_children_skip(): function test_or_passes_when_one_passes (line 640) | def test_or_passes_when_one_passes(): function test_or_reset (line 650) | def test_or_reset(): function test_not_inverts_skip_to_continue (line 664) | def test_not_inverts_skip_to_continue(): function test_not_inverts_continue_to_skip (line 672) | def test_not_inverts_continue_to_skip(): function test_not_reset (line 681) | def test_not_reset(): function test_select_all_picks_valid_prices (line 698) | def test_select_all_picks_valid_prices(): function test_select_all_skips_zero_price (line 705) | def test_select_all_skips_zero_price(): function test_select_all_skips_all_nan (line 711) | def test_select_all_skips_all_nan(): function test_select_has_data_filters_by_history_length (line 721) | def test_select_has_data_filters_by_history_length(): function test_select_has_data_removes_short_history (line 735) | def test_select_has_data_removes_short_history(): function test_select_has_data_no_history (line 748) | def test_select_has_data_no_history(): function test_select_has_data_uses_all_symbols_if_none_selected (line 755) | def test_select_has_data_uses_all_symbols_if_none_selected(): function test_select_momentum_picks_top_n (line 773) | def test_select_momentum_picks_top_n(): function test_select_momentum_ascending (line 793) | def test_select_momentum_ascending(): function test_select_momentum_no_history (line 810) | def test_select_momentum_no_history(): function test_select_n_truncates (line 820) | def test_select_n_truncates(): function test_select_n_empty (line 827) | def test_select_n_empty(): function test_select_n_fewer_than_n (line 833) | def test_select_n_fewer_than_n(): function test_select_where_custom_filter (line 844) | def test_select_where_custom_filter(): function test_select_where_all_filtered (line 856) | def test_select_where_all_filtered(): function test_select_where_falls_back_to_prices_index (line 866) | def test_select_where_falls_back_to_prices_index(): function test_weigh_equally_two_symbols (line 886) | def test_weigh_equally_two_symbols(): function test_weigh_equally_single_symbol (line 894) | def test_weigh_equally_single_symbol(): function test_weigh_equally_empty (line 900) | def test_weigh_equally_empty(): function test_weigh_equally_three_symbols (line 906) | def test_weigh_equally_three_symbols(): function test_weigh_inv_vol_basic (line 917) | def test_weigh_inv_vol_basic(): function test_weigh_inv_vol_lower_vol_gets_higher_weight (line 931) | def test_weigh_inv_vol_lower_vol_gets_higher_weight(): function test_weigh_inv_vol_no_history (line 949) | def test_weigh_inv_vol_no_history(): function test_weigh_inv_vol_no_selected (line 955) | def test_weigh_inv_vol_no_selected(): function test_weigh_mean_var_basic (line 965) | def test_weigh_mean_var_basic(): function test_weigh_mean_var_single_asset (line 979) | def test_weigh_mean_var_single_asset(): function test_weigh_mean_var_no_history (line 992) | def test_weigh_mean_var_no_history(): function test_weigh_mean_var_insufficient_data (line 998) | def test_weigh_mean_var_insufficient_data(): function test_weigh_erc_basic (line 1015) | def test_weigh_erc_basic(): function test_weigh_erc_no_history (line 1029) | def test_weigh_erc_no_history(): function test_weigh_erc_single_asset (line 1035) | def test_weigh_erc_single_asset(): function test_weigh_erc_weights_sum_to_one (line 1048) | def test_weigh_erc_weights_sum_to_one(): function test_target_vol_scales_weights (line 1064) | def test_target_vol_scales_weights(): function test_target_vol_no_weights (line 1080) | def test_target_vol_no_weights(): function test_target_vol_no_history (line 1086) | def test_target_vol_no_history(): function test_target_vol_never_levers (line 1092) | def test_target_vol_never_levers(): function test_limit_weights_caps (line 1115) | def test_limit_weights_caps(): function test_limit_weights_no_change_under_limit (line 1123) | def test_limit_weights_no_change_under_limit(): function test_limit_weights_empty (line 1130) | def test_limit_weights_empty(): function test_limit_weights_redistributes (line 1136) | def test_limit_weights_redistributes(): function test_capital_flow_dict (line 1150) | def test_capital_flow_dict(): function test_capital_flow_no_flow_date (line 1158) | def test_capital_flow_no_flow_date(): function test_capital_flow_withdrawal (line 1165) | def test_capital_flow_withdrawal(): function test_capital_flow_callable (line 1173) | def test_capital_flow_callable(): function test_capital_flow_in_pipeline (line 1188) | def test_capital_flow_in_pipeline(): function test_rebalance_over_time_gradual (line 1211) | def test_rebalance_over_time_gradual(): function test_rebalance_over_time_reset (line 1230) | def test_rebalance_over_time_reset(): function test_rebalance_over_time_no_target (line 1239) | def test_rebalance_over_time_no_target(): function test_pipeline_select_all_weigh_equally (line 1251) | def test_pipeline_select_all_weigh_equally(): function test_pipeline_momentum_selection (line 1264) | def test_pipeline_momentum_selection(): function test_pipeline_limit_weights_integration (line 1290) | def test_pipeline_limit_weights_integration(): function test_pipeline_run_on_date_with_capital_flow (line 1309) | def test_pipeline_run_on_date_with_capital_flow(): function test_pipeline_inv_vol_with_limit_weights (line 1329) | def test_pipeline_inv_vol_with_limit_weights(): function test_run_after_days_skips_warmup (line 1363) | def test_run_after_days_skips_warmup(): function test_run_after_days_reset (line 1372) | def test_run_after_days_reset(): function test_run_after_days_in_pipeline (line 1382) | def test_run_after_days_in_pipeline(): function test_run_if_out_of_bounds_skips_when_in_bounds (line 1400) | def test_run_if_out_of_bounds_skips_when_in_bounds(): function test_run_if_out_of_bounds_triggers_when_drifted (line 1413) | def test_run_if_out_of_bounds_triggers_when_drifted(): function test_run_if_out_of_bounds_no_prior_target (line 1426) | def test_run_if_out_of_bounds_no_prior_target(): function test_run_if_out_of_bounds_reset (line 1432) | def test_run_if_out_of_bounds_reset(): function test_limit_deltas_clips_large_change (line 1443) | def test_limit_deltas_clips_large_change(): function test_limit_deltas_no_change_needed (line 1455) | def test_limit_deltas_no_change_needed(): function test_limit_deltas_empty (line 1467) | def test_limit_deltas_empty(): function test_scale_weights_half (line 1477) | def test_scale_weights_half(): function test_scale_weights_double (line 1484) | def test_scale_weights_double(): function test_scale_weights_empty (line 1491) | def test_scale_weights_empty(): function test_select_randomly_picks_n (line 1501) | def test_select_randomly_picks_n(): function test_select_randomly_deterministic (line 1513) | def test_select_randomly_deterministic(): function test_select_randomly_n_exceeds_candidates (line 1529) | def test_select_randomly_n_exceeds_candidates(): function test_select_randomly_no_candidates (line 1540) | def test_select_randomly_no_candidates(): function test_select_active_filters_dead (line 1554) | def test_select_active_filters_dead(): function test_select_active_all_dead (line 1564) | def test_select_active_all_dead(): function test_weigh_randomly_sums_to_one (line 1577) | def test_weigh_randomly_sums_to_one(): function test_weigh_randomly_deterministic (line 1584) | def test_weigh_randomly_deterministic(): function test_weigh_randomly_empty (line 1592) | def test_weigh_randomly_empty(): function test_weigh_target_basic (line 1602) | def test_weigh_target_basic(): function test_weigh_target_uses_latest_row (line 1619) | def test_weigh_target_uses_latest_row(): function test_weigh_target_no_data_before_date (line 1633) | def test_weigh_target_no_data_before_date(): function test_weigh_target_empty_selected (line 1647) | def test_weigh_target_empty_selected(): function test_close_dead_removes_zero_price (line 1661) | def test_close_dead_removes_zero_price(): function test_close_dead_removes_nan_price (line 1671) | def test_close_dead_removes_nan_price(): function test_close_dead_no_dead (line 1680) | def test_close_dead_no_dead(): function test_close_dead_missing_price (line 1690) | def test_close_dead_missing_price(): function test_close_positions_after_dates (line 1703) | def test_close_positions_after_dates(): function test_close_positions_before_date (line 1715) | def test_close_positions_before_date(): function test_close_positions_on_exact_date (line 1725) | def test_close_positions_on_exact_date(): function test_require_passes_when_inner_passes (line 1739) | def test_require_passes_when_inner_passes(): function test_require_blocks_when_inner_skips (line 1746) | def test_require_blocks_when_inner_skips(): function test_require_reset (line 1754) | def test_require_reset(): function test_benchmark_random_basic (line 1766) | def test_benchmark_random_basic(): function test_benchmark_random_deterministic (line 1787) | def test_benchmark_random_deterministic(): function test_benchmark_random_result_properties (line 1796) | def test_benchmark_random_result_properties(): function test_pipeline_or_run_if_out_of_bounds (line 1811) | def test_pipeline_or_run_if_out_of_bounds(): function test_pipeline_close_dead_then_rebalance (line 1829) | def test_pipeline_close_dead_then_rebalance(): function test_pipeline_scale_weights_deleverage (line 1846) | def test_pipeline_scale_weights_deleverage(): function test_pipeline_select_randomly_weigh_randomly (line 1863) | def test_pipeline_select_randomly_weigh_randomly(): function test_pipeline_weigh_target_from_df (line 1878) | def test_pipeline_weigh_target_from_df(): function test_select_regex_matches (line 1904) | def test_select_regex_matches(): function test_select_regex_no_match_skips (line 1912) | def test_select_regex_no_match_skips(): function test_select_regex_case_insensitive (line 1919) | def test_select_regex_case_insensitive(): function test_select_regex_in_pipeline (line 1927) | def test_select_regex_in_pipeline(): function test_hedge_risks_adjusts_weights (line 1949) | def test_hedge_risks_adjusts_weights(): function test_hedge_risks_no_target_weights (line 1965) | def test_hedge_risks_no_target_weights(): function test_hedge_risks_no_history (line 1971) | def test_hedge_risks_no_history(): function test_hedge_risks_in_pipeline (line 1981) | def test_hedge_risks_in_pipeline(): function test_margin_scales_weights (line 2002) | def test_margin_scales_weights(): function test_margin_charges_interest (line 2014) | def test_margin_charges_interest(): function test_margin_reset (line 2028) | def test_margin_reset(): function test_margin_call_stops (line 2035) | def test_margin_call_stops(): function test_coupon_pays_on_schedule (line 2055) | def test_coupon_pays_on_schedule(): function test_coupon_semi_annual_spacing (line 2068) | def test_coupon_semi_annual_spacing(): function test_coupon_stops_at_maturity (line 2085) | def test_coupon_stops_at_maturity(): function test_coupon_before_start_date (line 2095) | def test_coupon_before_start_date(): function test_coupon_invalid_frequency (line 2104) | def test_coupon_invalid_frequency(): function test_coupon_reset (line 2110) | def test_coupon_reset(): function test_replay_buys_on_matching_date (line 2122) | def test_replay_buys_on_matching_date(): function test_replay_sells (line 2143) | def test_replay_sells(): function test_replay_no_trades_on_date (line 2161) | def test_replay_no_trades_on_date(): function test_replay_closes_position_to_zero (line 2175) | def test_replay_closes_position_to_zero(): function test_replay_missing_columns_raises (line 2192) | def test_replay_missing_columns_raises(): function test_replay_in_pipeline (line 2199) | def test_replay_in_pipeline(): function test_set_date_range_returns_stats (line 2220) | def test_set_date_range_returns_stats(): FILE: tests/engine/test_portfolio_integration.py function _ivy_stocks (line 22) | def _ivy_stocks(): function _stocks_data (line 27) | def _stocks_data(): function _options_data (line 33) | def _options_data(): function _buy_strategy (line 46) | def _buy_strategy(schema): function _run_engine (line 55) | def _run_engine(): class TestPortfolioIntegration (line 73) | class TestPortfolioIntegration: method setup (line 77) | def setup(self): method test_portfolio_exists (line 80) | def test_portfolio_exists(self): method test_portfolio_position_count_matches_inventory (line 84) | def test_portfolio_position_count_matches_inventory(self): method test_positions_have_correct_legs (line 92) | def test_positions_have_correct_legs(self): method test_trade_log_not_empty (line 100) | def test_trade_log_not_empty(self): method test_portfolio_contracts_match_inventory (line 104) | def test_portfolio_contracts_match_inventory(self): FILE: tests/engine/test_regression_snapshots.py function _ivy_stocks (line 32) | def _ivy_stocks(): function _stocks_data (line 37) | def _stocks_data(): function _options_data (line 43) | def _options_data(): function _build_strategy (line 56) | def _build_strategy(schema, direction=Direction.BUY): function _run (line 65) | def _run(cost_model=None, direction=Direction.BUY, monthly=False): class TestSnapshotBuyPutNoCosts (line 88) | class TestSnapshotBuyPutNoCosts: method setup (line 92) | def setup(self): method test_final_capital (line 95) | def test_final_capital(self): method test_trade_count (line 99) | def test_trade_count(self): method test_balance_rows (line 103) | def test_balance_rows(self): method test_total_return (line 107) | def test_total_return(self): method test_max_drawdown (line 112) | def test_max_drawdown(self): class TestSnapshotBuyPutWithCommission (line 120) | class TestSnapshotBuyPutWithCommission: method setup (line 124) | def setup(self): method test_commission_reduces_capital (line 128) | def test_commission_reduces_capital(self): method test_final_capital (line 133) | def test_final_capital(self): class TestSnapshotSellPut (line 138) | class TestSnapshotSellPut: method setup (line 142) | def setup(self): method test_final_capital (line 145) | def test_final_capital(self): method test_trade_count (line 149) | def test_trade_count(self): method test_sell_vs_buy_differ (line 153) | def test_sell_vs_buy_differ(self): class TestSnapshotMonthlyRebalance (line 160) | class TestSnapshotMonthlyRebalance: method setup (line 164) | def setup(self): method test_fewer_balance_rows (line 168) | def test_fewer_balance_rows(self): method test_final_capital (line 173) | def test_final_capital(self): method test_balance_rows (line 177) | def test_balance_rows(self): FILE: tests/engine/test_risk_wiring.py function _ivy_stocks (line 21) | def _ivy_stocks(): function _stocks_data (line 26) | def _stocks_data(): function _options_data (line 32) | def _options_data(): function _buy_strategy (line 45) | def _buy_strategy(schema): function _run_engine (line 54) | def _run_engine(risk_manager=None): class TestRiskManagerWiring (line 73) | class TestRiskManagerWiring: method test_no_constraints_allows_all (line 76) | def test_no_constraints_allows_all(self): method test_max_delta_blocks_entries (line 80) | def test_max_delta_blocks_entries(self): method test_max_drawdown_blocks_during_crash (line 91) | def test_max_drawdown_blocks_during_crash(self): method test_risk_manager_preserves_capital (line 101) | def test_risk_manager_preserves_capital(self): FILE: tests/engine/test_rust_parity.py function _ivy_stocks (line 32) | def _ivy_stocks(): function _stocks_data (line 37) | def _stocks_data(): function _options_data (line 43) | def _options_data(): function _buy_strategy (line 56) | def _buy_strategy(schema): function _make_engine (line 65) | def _make_engine(): function _run_python_path (line 78) | def _run_python_path(): function _run_rust_path (line 93) | def _run_rust_path(): class TestRustVsPythonParity (line 101) | class TestRustVsPythonParity: method setup (line 110) | def setup(self): method test_trade_log_shape (line 113) | def test_trade_log_shape(self): method test_regression_costs (line 116) | def test_regression_costs(self): method test_regression_qtys (line 122) | def test_regression_qtys(self): method test_final_capital (line 127) | def test_final_capital(self): method test_balance_row_count (line 131) | def test_balance_row_count(self): method test_balance_column_count (line 134) | def test_balance_column_count(self): method test_balance_has_all_columns (line 137) | def test_balance_has_all_columns(self): method test_initial_row_capital (line 149) | def test_initial_row_capital(self): method test_accumulated_return_starts_at_one (line 153) | def test_accumulated_return_starts_at_one(self): class TestRustDispatchGating (line 161) | class TestRustDispatchGating: method test_default_config_runs (line 164) | def test_default_config_runs(self): method test_custom_cost_model_runs (line 177) | def test_custom_cost_model_runs(self): method test_custom_selector_runs (line 190) | def test_custom_selector_runs(self): method test_per_leg_override_runs (line 204) | def test_per_leg_override_runs(self): class TestThresholdExits (line 230) | class TestThresholdExits: method test_profit_threshold_triggers_exit (line 233) | def test_profit_threshold_triggers_exit(self): method test_loss_threshold_triggers_exit (line 258) | def test_loss_threshold_triggers_exit(self): method test_both_thresholds (line 280) | def test_both_thresholds(self): class TestPerLegSellDirection (line 304) | class TestPerLegSellDirection: method test_sell_leg_with_midprice (line 307) | def test_sell_leg_with_midprice(self): class TestBalanceCompleteness (line 344) | class TestBalanceCompleteness: method test_balance_columns_present (line 347) | def test_balance_columns_present(self): method test_balance_no_negative_total_capital (line 376) | def test_balance_no_negative_total_capital(self): class TestEdgeCases (line 395) | class TestEdgeCases: method test_high_rebalance_freq (line 398) | def test_high_rebalance_freq(self): method test_stop_if_broke (line 413) | def test_stop_if_broke(self): FILE: tests/engine/test_signal_selector_wiring.py function _ivy_stocks (line 28) | def _ivy_stocks(): function _stocks_data (line 33) | def _stocks_data(): function _options_data (line 39) | def _options_data(): function _buy_strategy (line 52) | def _buy_strategy(schema): function _run_engine (line 61) | def _run_engine(signal_selector): class TestSignalSelectorWiring (line 80) | class TestSignalSelectorWiring: method test_first_match_still_works (line 83) | def test_first_match_still_works(self): method test_different_selectors_may_pick_different_contracts (line 87) | def test_different_selectors_may_pick_different_contracts(self): method test_nearest_delta_runs_without_error (line 95) | def test_nearest_delta_runs_without_error(self): method test_max_open_interest_runs (line 99) | def test_max_open_interest_runs(self): FILE: tests/engine/test_strategy_tree.py function test_strategy_tree_allocates_capital_by_weights (line 10) | def test_strategy_tree_allocates_capital_by_weights(): function test_nested_tree_weight_propagation (line 25) | def test_nested_tree_weight_propagation(): function test_leaf_max_share_throttles_allocation (line 41) | def test_leaf_max_share_throttles_allocation(): function test_node_rejects_engine_and_children (line 58) | def test_node_rejects_engine_and_children(): function test_empty_branch_produces_no_leaves (line 68) | def test_empty_branch_produces_no_leaves(): function test_engine_capital_restored_after_tree_run (line 81) | def test_engine_capital_restored_after_tree_run(): function test_capital_uses_round_not_truncate (line 96) | def test_capital_uses_round_not_truncate(): function test_balance_has_pct_change_and_accumulated_return (line 112) | def test_balance_has_pct_change_and_accumulated_return(): function test_attribution_dict_structure (line 122) | def test_attribution_dict_structure(): function test_to_dot_single_leaf (line 137) | def test_to_dot_single_leaf(): function test_to_dot_nested_tree (line 146) | def test_to_dot_nested_tree(): function test_to_dot_max_share_shown (line 159) | def test_to_dot_max_share_shown(): function test_engine_to_dot_delegates_to_root (line 165) | def test_engine_to_dot_delegates_to_root(): FILE: tests/execution/test_cost_model.py class TestNoCosts (line 8) | class TestNoCosts: method test_option_cost_is_zero (line 9) | def test_option_cost_is_zero(self): method test_stock_cost_is_zero (line 13) | def test_stock_cost_is_zero(self): class TestPerContractCommission (line 18) | class TestPerContractCommission: method test_default_rate (line 19) | def test_default_rate(self): method test_custom_rate (line 23) | def test_custom_rate(self): method test_stock_rate (line 27) | def test_stock_rate(self): method test_negative_qty_uses_abs (line 31) | def test_negative_qty_uses_abs(self): class TestTieredCommission (line 36) | class TestTieredCommission: method test_default_tiers_small_qty (line 37) | def test_default_tiers_small_qty(self): method test_default_tiers_large_qty (line 42) | def test_default_tiers_large_qty(self): class TestSpreadSlippage (line 49) | class TestSpreadSlippage: method test_zero_pct (line 50) | def test_zero_pct(self): method test_half_spread (line 54) | def test_half_spread(self): method test_full_spread (line 59) | def test_full_spread(self): method test_option_cost_is_zero (line 63) | def test_option_cost_is_zero(self): method test_stock_cost_is_zero (line 68) | def test_stock_cost_is_zero(self): class TestTieredCommissionEdgeCases (line 73) | class TestTieredCommissionEdgeCases: method test_qty_exceeds_all_tiers (line 74) | def test_qty_exceeds_all_tiers(self): method test_stock_cost (line 81) | def test_stock_cost(self): method test_tier_boundary_exact (line 85) | def test_tier_boundary_exact(self): class TestRustConfigs (line 92) | class TestRustConfigs: method test_no_costs_rust_config (line 93) | def test_no_costs_rust_config(self): method test_per_contract_rust_config (line 97) | def test_per_contract_rust_config(self): method test_tiered_rust_config (line 103) | def test_tiered_rust_config(self): FILE: tests/execution/test_execution_deep.py class TestNoCosts (line 40) | class TestNoCosts: method test_option_cost_always_zero (line 41) | def test_option_cost_always_zero(self): method test_stock_cost_always_zero (line 46) | def test_stock_cost_always_zero(self): method test_rust_config (line 50) | def test_rust_config(self): class TestPerContractCommission (line 54) | class TestPerContractCommission: method test_basic_cost (line 55) | def test_basic_cost(self): method test_negative_qty_uses_abs (line 59) | def test_negative_qty_uses_abs(self): method test_zero_qty (line 63) | def test_zero_qty(self): method test_stock_cost_per_share (line 67) | def test_stock_cost_per_share(self): method test_stock_cost_negative_qty (line 71) | def test_stock_cost_negative_qty(self): method test_rust_config_roundtrip (line 75) | def test_rust_config_roundtrip(self): class TestTieredCommission (line 83) | class TestTieredCommission: method test_default_tiers (line 84) | def test_default_tiers(self): method test_tier_boundary (line 89) | def test_tier_boundary(self): method test_crosses_first_tier (line 95) | def test_crosses_first_tier(self): method test_crosses_all_tiers (line 102) | def test_crosses_all_tiers(self): method test_custom_tiers (line 109) | def test_custom_tiers(self): method test_negative_qty (line 115) | def test_negative_qty(self): method test_zero_qty (line 120) | def test_zero_qty(self): method test_rust_config (line 124) | def test_rust_config(self): class TestSpreadSlippage (line 131) | class TestSpreadSlippage: method test_option_cost_is_zero (line 132) | def test_option_cost_is_zero(self): method test_slippage_computation (line 136) | def test_slippage_computation(self): method test_slippage_zero_spread (line 142) | def test_slippage_zero_spread(self): method test_slippage_full_pct (line 146) | def test_slippage_full_pct(self): method test_pct_bounds (line 151) | def test_pct_bounds(self): function _make_option_row (line 163) | def _make_option_row(bid=9.0, ask=10.0, volume=100): class TestMarketAtBidAsk (line 167) | class TestMarketAtBidAsk: method test_buy_fills_at_ask (line 168) | def test_buy_fills_at_ask(self): method test_sell_fills_at_bid (line 172) | def test_sell_fills_at_bid(self): method test_zero_spread (line 176) | def test_zero_spread(self): class TestMidPrice (line 182) | class TestMidPrice: method test_midpoint (line 183) | def test_midpoint(self): method test_same_bid_ask (line 187) | def test_same_bid_ask(self): method test_direction_doesnt_matter (line 191) | def test_direction_doesnt_matter(self): method test_wide_spread (line 196) | def test_wide_spread(self): class TestVolumeAwareFill (line 201) | class TestVolumeAwareFill: method test_high_volume_fills_at_target (line 202) | def test_high_volume_fills_at_target(self): method test_zero_volume_fills_at_mid (line 208) | def test_zero_volume_fills_at_mid(self): method test_half_volume_interpolates (line 214) | def test_half_volume_interpolates(self): method test_above_threshold_same_as_market (line 222) | def test_above_threshold_same_as_market(self): method test_rust_config (line 227) | def test_rust_config(self): function _make_candidates (line 239) | def _make_candidates(n=5, with_delta=True, with_oi=True): class TestFirstMatch (line 253) | class TestFirstMatch: method test_selects_first_row (line 254) | def test_selects_first_row(self): method test_single_row (line 260) | def test_single_row(self): class TestNearestDelta (line 267) | class TestNearestDelta: method test_selects_closest_delta (line 268) | def test_selects_closest_delta(self): method test_boundary_delta (line 275) | def test_boundary_delta(self): method test_missing_delta_column_fallback (line 282) | def test_missing_delta_column_fallback(self): method test_column_requirements (line 289) | def test_column_requirements(self): method test_rust_config (line 293) | def test_rust_config(self): class TestMaxOpenInterest (line 299) | class TestMaxOpenInterest: method test_selects_highest_oi (line 300) | def test_selects_highest_oi(self): method test_missing_oi_column_fallback (line 306) | def test_missing_oi_column_fallback(self): method test_custom_oi_column (line 312) | def test_custom_oi_column(self): class TestCapitalBasedSizer (line 325) | class TestCapitalBasedSizer: method test_basic_sizing (line 326) | def test_basic_sizing(self): method test_fractional_truncated (line 330) | def test_fractional_truncated(self): method test_zero_cost (line 334) | def test_zero_cost(self): method test_cost_exceeds_capital (line 338) | def test_cost_exceeds_capital(self): method test_negative_cost_uses_abs (line 342) | def test_negative_cost_uses_abs(self): class TestFixedQuantitySizer (line 347) | class TestFixedQuantitySizer: method test_within_budget (line 348) | def test_within_budget(self): method test_exceeds_budget_scales_down (line 352) | def test_exceeds_budget_scales_down(self): method test_zero_cost_returns_fixed_qty (line 356) | def test_zero_cost_returns_fixed_qty(self): method test_one_contract (line 361) | def test_one_contract(self): class TestFixedDollarSizer (line 366) | class TestFixedDollarSizer: method test_within_budget (line 367) | def test_within_budget(self): method test_amount_exceeds_available (line 371) | def test_amount_exceeds_available(self): method test_zero_cost (line 375) | def test_zero_cost(self): class TestPercentOfPortfolioSizer (line 380) | class TestPercentOfPortfolioSizer: method test_basic (line 381) | def test_basic(self): method test_pct_exceeds_available (line 386) | def test_pct_exceeds_available(self): method test_invalid_pct (line 391) | def test_invalid_pct(self): method test_zero_cost (line 397) | def test_zero_cost(self): FILE: tests/execution/test_execution_pbt.py class TestNoCostsPBT (line 57) | class TestNoCostsPBT: method test_always_zero (line 60) | def test_always_zero(self, p, q, s): class TestPerContractPBT (line 66) | class TestPerContractPBT: method test_non_negative (line 69) | def test_non_negative(self, r, p, q, s): method test_symmetric_buy_sell (line 75) | def test_symmetric_buy_sell(self, r, p, q, s): method test_linear_in_quantity (line 82) | def test_linear_in_quantity(self, r, p, q, s): method test_independent_of_price_and_spc (line 92) | def test_independent_of_price_and_spc(self, r, p, q): method test_stock_cost_non_negative (line 102) | def test_stock_cost_non_negative(self, sr, p, q): class TestTieredCommissionPBT (line 107) | class TestTieredCommissionPBT: method test_non_negative (line 110) | def test_non_negative(self, p, q, s): method test_symmetric (line 116) | def test_symmetric(self, p, q, s): method test_monotone_in_quantity (line 122) | def test_monotone_in_quantity(self, q): method test_bounded_by_flat_rate (line 131) | def test_bounded_by_flat_rate(self, q): method test_bounded_below_by_lowest_rate (line 140) | def test_bounded_below_by_lowest_rate(self, q): method test_average_rate_decreasing (line 149) | def test_average_rate_decreasing(self, q): class TestSpreadSlippagePBT (line 160) | class TestSpreadSlippagePBT: method test_option_cost_always_zero (line 163) | def test_option_cost_always_zero(self, pct, p, q, s): method test_slippage_non_negative (line 171) | def test_slippage_non_negative(self, pct, bid, ask, q, s): method test_zero_spread_zero_slippage (line 178) | def test_zero_spread_zero_slippage(self, pct, p, q, s): method test_slippage_monotone_in_pct (line 185) | def test_slippage_monotone_in_pct(self, pct, p, q, s): method test_slippage_linear_in_quantity (line 197) | def test_slippage_linear_in_quantity(self, pct, p, s): class TestMarketAtBidAskPBT (line 211) | class TestMarketAtBidAskPBT: method test_buy_at_ask_sell_at_bid (line 215) | def test_buy_at_ask_sell_at_bid(self, bid, ask): method test_zero_spread_both_equal (line 224) | def test_zero_spread_both_equal(self, p): method test_buy_never_cheaper_than_sell (line 232) | def test_buy_never_cheaper_than_sell(self, bid, ask): class TestMidPricePBT (line 240) | class TestMidPricePBT: method test_between_bid_and_ask (line 245) | def test_between_bid_and_ask(self, bid, ask, d): method test_direction_independent (line 255) | def test_direction_independent(self, bid, ask): method test_midpoint_formula (line 264) | def test_midpoint_formula(self, bid, ask): class TestVolumeAwareFillPBT (line 272) | class TestVolumeAwareFillPBT: method test_fill_between_mid_and_edge (line 277) | def test_fill_between_mid_and_edge(self, bid, ask, vol, threshold, d): method test_zero_volume_fills_at_mid (line 293) | def test_zero_volume_fills_at_mid(self, bid, ask, threshold): method test_higher_volume_moves_toward_edge (line 305) | def test_higher_volume_moves_toward_edge(self, bid, ask, threshold, d): method test_above_threshold_equals_market (line 323) | def test_above_threshold_equals_market(self, bid, ask, threshold): function _make_candidates (line 336) | def _make_candidates(n, deltas=None, ois=None): class TestFirstMatchPBT (line 350) | class TestFirstMatchPBT: method test_always_selects_row_from_dataframe (line 353) | def test_always_selects_row_from_dataframe(self, n): method test_always_selects_first (line 361) | def test_always_selects_first(self, n): class TestNearestDeltaPBT (line 367) | class TestNearestDeltaPBT: method test_selected_is_closest_to_target (line 371) | def test_selected_is_closest_to_target(self, target, n): method test_result_is_valid_row (line 384) | def test_result_is_valid_row(self, target, n): method test_missing_delta_falls_back_to_first (line 393) | def test_missing_delta_falls_back_to_first(self, n): class TestMaxOpenInterestPBT (line 400) | class TestMaxOpenInterestPBT: method test_selects_max_oi (line 403) | def test_selects_max_oi(self, ois): method test_missing_oi_falls_back (line 411) | def test_missing_oi_falls_back(self, n): method test_uniform_oi_selects_some_row (line 419) | def test_uniform_oi_selects_some_row(self, n, oi): class TestCapitalBasedPBT (line 432) | class TestCapitalBasedPBT: method test_non_negative_integer (line 436) | def test_non_negative_integer(self, cost, avail, total): method test_total_cost_within_budget (line 445) | def test_total_cost_within_budget(self, cost, avail, total): method test_zero_cost_returns_zero (line 453) | def test_zero_cost_returns_zero(self, avail, total): method test_more_capital_more_contracts (line 461) | def test_more_capital_more_contracts(self, cost, avail, total): method test_negative_cost_same_as_positive (line 472) | def test_negative_cost_same_as_positive(self, cost, avail, total): class TestFixedQuantityPBT (line 477) | class TestFixedQuantityPBT: method test_never_exceeds_budget (line 482) | def test_never_exceeds_budget(self, qty, cost, avail, total): method test_large_budget_returns_fixed (line 492) | def test_large_budget_returns_fixed(self, qty, cost, avail, total): method test_bounded_by_capital_based (line 501) | def test_bounded_by_capital_based(self, qty, cost, avail, total): class TestFixedDollarPBT (line 509) | class TestFixedDollarPBT: method test_non_negative_integer (line 514) | def test_non_negative_integer(self, amount, cost, avail, total): method test_total_cost_within_min_amount_avail (line 524) | def test_total_cost_within_min_amount_avail(self, amount, cost, avail,... method test_zero_cost_returns_zero (line 533) | def test_zero_cost_returns_zero(self, amount, avail, total): class TestPercentOfPortfolioPBT (line 538) | class TestPercentOfPortfolioPBT: method test_non_negative_integer (line 544) | def test_non_negative_integer(self, pct, cost, avail, total): method test_cost_bounded_by_pct_of_total (line 555) | def test_cost_bounded_by_pct_of_total(self, pct, cost, avail, total): method test_zero_cost_returns_zero (line 565) | def test_zero_cost_returns_zero(self, pct, avail, total): method test_higher_pct_more_contracts (line 574) | def test_higher_pct_more_contracts(self, pct, cost, avail, total): FILE: tests/execution/test_fill_model.py function _make_row (line 11) | def _make_row(bid: float = 1.00, ask: float = 1.10, volume: int = 100) -... class TestMarketAtBidAsk (line 15) | class TestMarketAtBidAsk: method test_buy_fills_at_ask (line 16) | def test_buy_fills_at_ask(self): method test_sell_fills_at_bid (line 20) | def test_sell_fills_at_bid(self): class TestMidPrice (line 25) | class TestMidPrice: method test_mid (line 26) | def test_mid(self): method test_mid_sell (line 30) | def test_mid_sell(self): class TestVolumeAwareFill (line 35) | class TestVolumeAwareFill: method test_high_volume_fills_at_target (line 36) | def test_high_volume_fills_at_target(self): method test_zero_volume_fills_at_mid (line 40) | def test_zero_volume_fills_at_mid(self): method test_half_volume_interpolates (line 44) | def test_half_volume_interpolates(self): FILE: tests/execution/test_rust_parity_execution.py class TestCostModelEdgeCases (line 30) | class TestCostModelEdgeCases: method test_per_contract_basic (line 32) | def test_per_contract_basic(self): method test_per_contract_negative_quantity (line 35) | def test_per_contract_negative_quantity(self): method test_per_contract_zero_quantity (line 38) | def test_per_contract_zero_quantity(self): method test_per_contract_stock (line 41) | def test_per_contract_stock(self): method test_zero_rate (line 44) | def test_zero_rate(self): method test_very_small_quantity (line 48) | def test_very_small_quantity(self): method test_tiered_within_first_tier (line 51) | def test_tiered_within_first_tier(self): method test_tiered_spanning_tiers (line 55) | def test_tiered_spanning_tiers(self): method test_tiered_beyond_all (line 60) | def test_tiered_beyond_all(self): method test_tiered_exactly_at_boundary (line 65) | def test_tiered_exactly_at_boundary(self): method test_tiered_negative_quantity (line 69) | def test_tiered_negative_quantity(self): method test_very_large_quantity (line 74) | def test_very_large_quantity(self): method test_invalid_model_type_raises (line 78) | def test_invalid_model_type_raises(self): class TestFillModelEdgeCases (line 83) | class TestFillModelEdgeCases: method test_full_volume_buy (line 85) | def test_full_volume_buy(self): method test_full_volume_sell (line 88) | def test_full_volume_sell(self): method test_zero_volume (line 91) | def test_zero_volume(self): method test_half_volume (line 96) | def test_half_volume(self): method test_missing_volume (line 100) | def test_missing_volume(self): method test_zero_bid_ask (line 103) | def test_zero_bid_ask(self): method test_bid_equals_ask (line 106) | def test_bid_equals_ask(self): method test_invalid_fill_type_raises (line 109) | def test_invalid_fill_type_raises(self): class TestSignalSelectorEdgeCases (line 114) | class TestSignalSelectorEdgeCases: method test_nearest_delta_exact (line 116) | def test_nearest_delta_exact(self): method test_nearest_delta_between (line 119) | def test_nearest_delta_between(self): method test_empty_list (line 122) | def test_empty_list(self): method test_all_nan_nearest (line 126) | def test_all_nan_nearest(self): method test_all_nan_max (line 129) | def test_all_nan_max(self): method test_single_element (line 132) | def test_single_element(self): method test_max_value_basic (line 136) | def test_max_value_basic(self): method test_max_value_negative (line 139) | def test_max_value_negative(self): method test_max_value_ties_first_wins (line 142) | def test_max_value_ties_first_wins(self): method test_large_list (line 145) | def test_large_list(self): class TestRiskCheckEdgeCases (line 149) | class TestRiskCheckEdgeCases: method test_max_delta_allows (line 151) | def test_max_delta_allows(self): method test_max_delta_rejects (line 154) | def test_max_delta_rejects(self): method test_max_delta_exactly_at_limit (line 157) | def test_max_delta_exactly_at_limit(self): method test_max_delta_negative (line 160) | def test_max_delta_negative(self): method test_max_vega_allows (line 163) | def test_max_vega_allows(self): method test_max_vega_rejects (line 166) | def test_max_vega_rejects(self): method test_max_drawdown_allows (line 169) | def test_max_drawdown_allows(self): method test_max_drawdown_rejects (line 173) | def test_max_drawdown_rejects(self): method test_max_drawdown_zero_peak (line 177) | def test_max_drawdown_zero_peak(self): method test_zero_greeks (line 181) | def test_zero_greeks(self): method test_negative_peak_value (line 186) | def test_negative_peak_value(self): method test_invalid_constraint_raises (line 190) | def test_invalid_constraint_raises(self): class TestCostInvariants (line 205) | class TestCostInvariants: method test_cost_always_non_negative (line 209) | def test_cost_always_non_negative(self, rate, qty): method test_tiered_cost_non_negative (line 214) | def test_tiered_cost_non_negative(self, qty): method test_sign_symmetry (line 220) | def test_sign_symmetry(self, rate, qty): class TestFillInvariants (line 226) | class TestFillInvariants: method test_fill_between_bid_ask (line 235) | def test_fill_between_bid_ask(self, bid, spread, vol, is_buy): class TestSelectorInvariants (line 242) | class TestSelectorInvariants: method test_index_in_range (line 249) | def test_index_in_range(self, values, target): method test_max_index_in_range (line 260) | def test_max_index_in_range(self, values): class TestRiskInvariants (line 265) | class TestRiskInvariants: method test_higher_limit_more_permissive (line 273) | def test_higher_limit_more_permissive(self, limit_low, limit_high, del... class TestPythonClassDelegation (line 286) | class TestPythonClassDelegation: method test_per_contract_via_class (line 288) | def test_per_contract_via_class(self): method test_tiered_via_class (line 294) | def test_tiered_via_class(self): method test_volume_aware_via_class (line 300) | def test_volume_aware_via_class(self): method test_nearest_delta_via_class (line 307) | def test_nearest_delta_via_class(self): method test_max_oi_via_class (line 313) | def test_max_oi_via_class(self): method test_max_delta_via_class (line 318) | def test_max_delta_via_class(self): method test_max_vega_via_class (line 324) | def test_max_vega_via_class(self): method test_max_drawdown_via_class (line 330) | def test_max_drawdown_via_class(self): FILE: tests/execution/test_signal_selector.py function _make_candidates (line 10) | def _make_candidates() -> pd.DataFrame: class TestFirstMatch (line 19) | class TestFirstMatch: method test_picks_first (line 20) | def test_picks_first(self): class TestNearestDelta (line 26) | class TestNearestDelta: method test_nearest_to_target (line 27) | def test_nearest_to_target(self): method test_nearest_to_different_target (line 32) | def test_nearest_to_different_target(self): method test_fallback_without_column (line 37) | def test_fallback_without_column(self): class TestMaxOpenInterest (line 44) | class TestMaxOpenInterest: method test_picks_max_oi (line 45) | def test_picks_max_oi(self): method test_fallback_without_column (line 50) | def test_fallback_without_column(self): FILE: tests/execution/test_sizer.py class TestCapitalBased (line 8) | class TestCapitalBased: method test_basic_sizing (line 9) | def test_basic_sizing(self): method test_zero_cost (line 13) | def test_zero_cost(self): method test_insufficient_capital (line 17) | def test_insufficient_capital(self): class TestFixedQuantity (line 22) | class TestFixedQuantity: method test_fixed (line 23) | def test_fixed(self): method test_insufficient_capital_reduces (line 27) | def test_insufficient_capital_reduces(self): class TestFixedDollar (line 32) | class TestFixedDollar: method test_fixed_amount (line 33) | def test_fixed_amount(self): method test_amount_capped_by_available (line 37) | def test_amount_capped_by_available(self): class TestPercentOfPortfolio (line 42) | class TestPercentOfPortfolio: method test_one_percent (line 43) | def test_one_percent(self): method test_capped_by_available (line 48) | def test_capped_by_available(self): FILE: tests/portfolio/test_greeks_aggregation.py function _make_position (line 12) | def _make_position(pid, direction=Direction.BUY, qty=10): function test_aggregate_single_position (line 28) | def test_aggregate_single_position(): function test_aggregate_sell_position (line 39) | def test_aggregate_sell_position(): function test_aggregate_multiple_positions (line 48) | def test_aggregate_multiple_positions(): function test_aggregate_empty (line 60) | def test_aggregate_empty(): function test_aggregate_missing_greeks_for_position (line 68) | def test_aggregate_missing_greeks_for_position(): FILE: tests/portfolio/test_portfolio.py function _make_portfolio (line 8) | def _make_portfolio() -> Portfolio: class TestPortfolio (line 23) | class TestPortfolio: method test_initial_cash (line 24) | def test_initial_cash(self): method test_add_remove_position (line 28) | def test_add_remove_position(self): method test_remove_nonexistent (line 37) | def test_remove_nonexistent(self): method test_next_position_id_increments (line 41) | def test_next_position_id_increments(self): method test_options_value (line 47) | def test_options_value(self): method test_stocks_value (line 53) | def test_stocks_value(self): method test_total_value (line 58) | def test_total_value(self): method test_clear_stock_holdings (line 68) | def test_clear_stock_holdings(self): method test_portfolio_greeks (line 74) | def test_portfolio_greeks(self): class TestPortfolioInvariant (line 82) | class TestPortfolioInvariant: method test_invariant_after_stock_buy (line 85) | def test_invariant_after_stock_buy(self): method test_invariant_after_option_buy (line 94) | def test_invariant_after_option_buy(self): FILE: tests/portfolio/test_position.py class TestPositionLeg (line 7) | class TestPositionLeg: method test_exit_order_inverts (line 8) | def test_exit_order_inverts(self): method test_buy_leg_value (line 17) | def test_buy_leg_value(self): method test_sell_leg_value (line 27) | def test_sell_leg_value(self): class TestOptionPosition (line 38) | class TestOptionPosition: method _make_position (line 39) | def _make_position(self) -> OptionPosition: method test_current_value (line 49) | def test_current_value(self): method test_current_value_missing_price (line 55) | def test_current_value_missing_price(self): method test_greeks (line 60) | def test_greeks(self): method test_multi_leg_greeks (line 70) | def test_multi_leg_greeks(self): FILE: tests/portfolio/test_property_based.py class TestPositionProperties (line 25) | class TestPositionProperties: method test_zero_quantity_zero_value (line 28) | def test_zero_quantity_zero_value(self, p, shares_per_contract): method test_buy_leg_value_formula (line 42) | def test_buy_leg_value_formula(self, qty, p, shares_per_contract): method test_sell_leg_value_formula (line 57) | def test_sell_leg_value_formula(self, qty, p, shares_per_contract): class TestPortfolioProperties (line 75) | class TestPortfolioProperties: method test_total_value_is_sum (line 78) | def test_total_value_is_sum(self, cash, stock_price, qty): method test_add_remove_position_roundtrip (line 89) | def test_add_remove_position_roundtrip(self, cash, qty, p, shares_per_... method test_portfolio_value_non_negative (line 109) | def test_portfolio_value_non_negative(self, cash, stock_price, qty): FILE: tests/portfolio/test_risk.py class TestMaxDelta (line 9) | class TestMaxDelta: method test_within_limit (line 10) | def test_within_limit(self): method test_exceeds_limit (line 14) | def test_exceeds_limit(self): method test_negative_delta (line 18) | def test_negative_delta(self): class TestMaxVega (line 23) | class TestMaxVega: method test_within_limit (line 24) | def test_within_limit(self): method test_exceeds_limit (line 28) | def test_exceeds_limit(self): class TestMaxDrawdown (line 33) | class TestMaxDrawdown: method test_no_drawdown (line 34) | def test_no_drawdown(self): method test_within_limit (line 38) | def test_within_limit(self): method test_exceeds_limit (line 42) | def test_exceeds_limit(self): class TestRiskManager (line 47) | class TestRiskManager: method test_empty_allows (line 48) | def test_empty_allows(self): method test_single_constraint_blocks (line 54) | def test_single_constraint_blocks(self): method test_multiple_constraints_first_blocks (line 60) | def test_multiple_constraints_first_blocks(self): method test_add_constraint (line 67) | def test_add_constraint(self): FILE: tests/strategy/test_presets.py function _options_schema (line 12) | def _options_schema(): class TestStrangleFunction (line 29) | class TestStrangleFunction: method test_creates_two_legs (line 30) | def test_creates_two_legs(self): method test_leg_types (line 35) | def test_leg_types(self): method test_leg_directions_match_input (line 41) | def test_leg_directions_match_input(self): method test_exit_thresholds (line 47) | def test_exit_thresholds(self): method test_default_exit_thresholds_are_inf (line 53) | def test_default_exit_thresholds_are_inf(self): class TestIronCondor (line 59) | class TestIronCondor: method test_creates_four_legs (line 60) | def test_creates_four_legs(self): method test_leg_directions (line 65) | def test_leg_directions(self): method test_leg_types (line 74) | def test_leg_types(self): class TestCoveredCall (line 83) | class TestCoveredCall: method test_creates_one_leg (line 84) | def test_creates_one_leg(self): method test_leg_is_sell_call (line 89) | def test_leg_is_sell_call(self): class TestCashSecuredPut (line 96) | class TestCashSecuredPut: method test_creates_one_leg (line 97) | def test_creates_one_leg(self): method test_leg_is_sell_put (line 102) | def test_leg_is_sell_put(self): class TestCollar (line 109) | class TestCollar: method test_creates_two_legs (line 110) | def test_creates_two_legs(self): method test_leg_types_and_directions (line 115) | def test_leg_types_and_directions(self): class TestButterfly (line 125) | class TestButterfly: method test_creates_three_legs (line 126) | def test_creates_three_legs(self): method test_default_type_is_call (line 131) | def test_default_type_is_call(self): method test_put_butterfly (line 137) | def test_put_butterfly(self): method test_directions (line 144) | def test_directions(self): method test_entry_sort_on_wings (line 152) | def test_entry_sort_on_wings(self): FILE: tests/strategy/test_strangle.py function schema (line 11) | def schema(): class TestStrangle (line 17) | class TestStrangle: method test_long_strangle_creates_buy_call_and_buy_put (line 18) | def test_long_strangle_creates_buy_call_and_buy_put(self, schema): method test_short_strangle_creates_sell_call_and_sell_put (line 26) | def test_short_strangle_creates_sell_call_and_sell_put(self, schema): method test_invalid_name_asserts (line 34) | def test_invalid_name_asserts(self, schema): method test_exit_thresholds_propagate (line 38) | def test_exit_thresholds_propagate(self, schema): method test_case_insensitive_name (line 42) | def test_case_insensitive_name(self, schema): FILE: tests/strategy/test_strategy.py function schema (line 16) | def schema(): function strategy (line 21) | def strategy(schema): function make_leg (line 26) | def make_leg(schema): class TestAddLeg (line 32) | class TestAddLeg: method test_add_one_leg (line 33) | def test_add_one_leg(self, strategy, make_leg): method test_add_two_legs (line 39) | def test_add_two_legs(self, strategy, make_leg): method test_add_legs_batch (line 46) | def test_add_legs_batch(self, strategy, make_leg): method test_add_leg_schema_mismatch_asserts (line 51) | def test_add_leg_schema_mismatch_asserts(self, strategy): class TestRemoveLeg (line 59) | class TestRemoveLeg: method test_remove_leg (line 60) | def test_remove_leg(self, strategy, make_leg): method test_clear_legs (line 65) | def test_clear_legs(self, strategy, make_leg): class TestExitThresholds (line 71) | class TestExitThresholds: method test_default_thresholds (line 72) | def test_default_thresholds(self, strategy): method test_set_valid_thresholds (line 75) | def test_set_valid_thresholds(self, strategy): method test_negative_profit_asserts (line 79) | def test_negative_profit_asserts(self, strategy): method test_negative_loss_asserts (line 83) | def test_negative_loss_asserts(self, strategy): class TestFilterThresholds (line 88) | class TestFilterThresholds: method test_within_bounds_no_exit (line 89) | def test_within_bounds_no_exit(self, strategy): method test_profit_exceeded (line 96) | def test_profit_exceeded(self, strategy): method test_loss_exceeded (line 103) | def test_loss_exceeded(self, strategy): FILE: tests/strategy/test_strategy_deep.py function schema (line 52) | def schema(): class TestStranglePreset (line 62) | class TestStranglePreset: method test_has_two_legs (line 63) | def test_has_two_legs(self, schema): method test_leg_types (line 67) | def test_leg_types(self, schema): method test_leg_directions_long (line 72) | def test_leg_directions_long(self, schema): method test_leg_directions_short (line 77) | def test_leg_directions_short(self, schema): method test_exit_thresholds_applied (line 82) | def test_exit_thresholds_applied(self, schema): method test_default_exit_thresholds (line 87) | def test_default_exit_thresholds(self, schema): class TestIronCondorPreset (line 92) | class TestIronCondorPreset: method test_has_four_legs (line 93) | def test_has_four_legs(self, schema): method test_two_sells_two_buys (line 97) | def test_two_sells_two_buys(self, schema): method test_has_both_option_types (line 104) | def test_has_both_option_types(self, schema): class TestCoveredCallPreset (line 110) | class TestCoveredCallPreset: method test_one_sell_call_leg (line 111) | def test_one_sell_call_leg(self, schema): method test_otm_pct_applied (line 117) | def test_otm_pct_applied(self, schema): class TestCashSecuredPutPreset (line 124) | class TestCashSecuredPutPreset: method test_one_sell_put_leg (line 125) | def test_one_sell_put_leg(self, schema): class TestCollarPreset (line 132) | class TestCollarPreset: method test_two_legs (line 133) | def test_two_legs(self, schema): method test_short_call_long_put (line 137) | def test_short_call_long_put(self, schema): class TestButterflyPreset (line 145) | class TestButterflyPreset: method test_three_legs (line 146) | def test_three_legs(self, schema): method test_buy_sell_buy_pattern (line 150) | def test_buy_sell_buy_pattern(self, schema): method test_call_butterfly (line 155) | def test_call_butterfly(self, schema): method test_put_butterfly (line 160) | def test_put_butterfly(self, schema): method test_lower_wing_has_asc_sort (line 165) | def test_lower_wing_has_asc_sort(self, schema): method test_upper_wing_has_desc_sort (line 169) | def test_upper_wing_has_desc_sort(self, schema): class TestStrangleClassBased (line 174) | class TestStrangleClassBased: method test_long_strangle (line 175) | def test_long_strangle(self, schema): method test_short_strangle (line 181) | def test_short_strangle(self, schema): method test_invalid_name_raises (line 186) | def test_invalid_name_raises(self, schema): class TestStrategyOperations (line 196) | class TestStrategyOperations: method test_add_and_remove_leg (line 197) | def test_add_and_remove_leg(self, schema): method test_clear_legs (line 207) | def test_clear_legs(self, schema): method test_exit_thresholds_validation (line 213) | def test_exit_thresholds_validation(self, schema): method test_filter_thresholds_series (line 220) | def test_filter_thresholds_series(self, schema): class TestStrategyLegFilters (line 235) | class TestStrategyLegFilters: method test_base_entry_filter_buy_requires_ask_gt_zero (line 236) | def test_base_entry_filter_buy_requires_ask_gt_zero(self, schema): method test_base_entry_filter_sell_requires_bid_gt_zero (line 240) | def test_base_entry_filter_sell_requires_bid_gt_zero(self, schema): method test_custom_entry_filter_combines_with_base (line 244) | def test_custom_entry_filter_combines_with_base(self, schema): method test_exit_filter_includes_type (line 250) | def test_exit_filter_includes_type(self, schema): class TestMaxDeltaConstraint (line 260) | class TestMaxDeltaConstraint: method test_within_limit_allowed (line 261) | def test_within_limit_allowed(self): method test_at_limit_allowed (line 265) | def test_at_limit_allowed(self): method test_exceeds_limit_blocked (line 269) | def test_exceeds_limit_blocked(self): method test_negative_delta (line 273) | def test_negative_delta(self): method test_describe (line 278) | def test_describe(self): class TestMaxVegaConstraint (line 283) | class TestMaxVegaConstraint: method test_within_limit (line 284) | def test_within_limit(self): method test_exceeds_limit (line 288) | def test_exceeds_limit(self): class TestMaxDrawdownConstraint (line 293) | class TestMaxDrawdownConstraint: method test_no_drawdown_allowed (line 294) | def test_no_drawdown_allowed(self): method test_at_drawdown_limit (line 298) | def test_at_drawdown_limit(self): method test_beyond_drawdown (line 303) | def test_beyond_drawdown(self): method test_peak_is_zero (line 307) | def test_peak_is_zero(self): class TestRiskManagerComposite (line 312) | class TestRiskManagerComposite: method test_empty_constraints_allows_all (line 313) | def test_empty_constraints_allows_all(self): method test_single_violation_blocks (line 319) | def test_single_violation_blocks(self): method test_first_failure_reported (line 325) | def test_first_failure_reported(self): method test_all_pass (line 333) | def test_all_pass(self): class TestGreeksAlgebra (line 344) | class TestGreeksAlgebra: method test_addition (line 345) | def test_addition(self): method test_scalar_multiplication (line 354) | def test_scalar_multiplication(self): method test_rmul (line 360) | def test_rmul(self): method test_negation (line 365) | def test_negation(self): method test_as_dict (line 371) | def test_as_dict(self): class TestOrderMapping (line 383) | class TestOrderMapping: method test_buy_entry_bto (line 384) | def test_buy_entry_bto(self): method test_buy_exit_stc (line 387) | def test_buy_exit_stc(self): method test_sell_entry_sto (line 390) | def test_sell_entry_sto(self): method test_sell_exit_btc (line 393) | def test_sell_exit_btc(self): method test_order_inversion (line 396) | def test_order_inversion(self): class TestDirectionInversion (line 403) | class TestDirectionInversion: method test_buy_inverts_to_sell (line 404) | def test_buy_inverts_to_sell(self): method test_sell_inverts_to_buy (line 407) | def test_sell_inverts_to_buy(self): class TestOptionTypeInversion (line 411) | class TestOptionTypeInversion: method test_call_inverts_to_put (line 412) | def test_call_inverts_to_put(self): method test_put_inverts_to_call (line 415) | def test_put_inverts_to_call(self): class TestFillNotional (line 424) | class TestFillNotional: method test_buy_fill_negative_notional (line 425) | def test_buy_fill_negative_notional(self): method test_sell_fill_positive_notional (line 430) | def test_sell_fill_positive_notional(self): method test_commission_deducted (line 434) | def test_commission_deducted(self): method test_slippage_deducted (line 438) | def test_slippage_deducted(self): class TestPortfolio (line 448) | class TestPortfolio: method test_initial_cash (line 449) | def test_initial_cash(self): method test_add_remove_option_position (line 453) | def test_add_remove_option_position(self): method test_remove_nonexistent_returns_none (line 462) | def test_remove_nonexistent_returns_none(self): method test_stock_holdings (line 466) | def test_stock_holdings(self): method test_clear_stock_holdings (line 472) | def test_clear_stock_holdings(self): method test_total_value (line 478) | def test_total_value(self): method test_next_position_id_increments (line 488) | def test_next_position_id_increments(self): class TestPositionLeg (line 495) | class TestPositionLeg: method test_buy_leg_positive_value (line 496) | def test_buy_leg_positive_value(self): method test_sell_leg_negative_value (line 507) | def test_sell_leg_negative_value(self): method test_exit_order (line 517) | def test_exit_order(self): class TestOptionPosition (line 526) | class TestOptionPosition: method test_multi_leg_value (line 527) | def test_multi_leg_value(self): method test_greeks_aggregation (line 541) | def test_greeks_aggregation(self): class TestAggregateGreeks (line 565) | class TestAggregateGreeks: method test_empty_portfolio (line 566) | def test_empty_portfolio(self): method test_single_position (line 570) | def test_single_position(self): method test_multiple_positions (line 580) | def test_multiple_positions(self): FILE: tests/strategy/test_strategy_leg.py function make_options_df (line 10) | def make_options_df(): class TestDefaultEntryFilter (line 19) | class TestDefaultEntryFilter: method test_buy_call_filters_calls_with_positive_ask (line 20) | def test_buy_call_filters_calls_with_positive_ask(self): method test_sell_put_filters_puts_with_positive_bid (line 29) | def test_sell_put_filters_puts_with_positive_bid(self): method test_buy_put_filters_puts_with_positive_ask (line 38) | def test_buy_put_filters_puts_with_positive_ask(self): method test_sell_call_filters_calls_with_positive_bid (line 46) | def test_sell_call_filters_calls_with_positive_bid(self): class TestDefaultExitFilter (line 55) | class TestDefaultExitFilter: method test_exit_filter_matches_type (line 56) | def test_exit_filter_matches_type(self): class TestCustomFilter (line 66) | class TestCustomFilter: method test_custom_entry_filter_is_anded_with_base (line 67) | def test_custom_entry_filter_is_anded_with_base(self): method test_custom_exit_filter_is_anded_with_base (line 79) | def test_custom_exit_filter_is_anded_with_base(self): FILE: tests/strategy/test_strategy_pbt.py function _options_schema (line 53) | def _options_schema(): class TestGreeksAlgebraPBT (line 75) | class TestGreeksAlgebraPBT: method test_addition_commutative (line 78) | def test_addition_commutative(self, a, b): method test_addition_associative (line 88) | def test_addition_associative(self, a, b, c): method test_additive_identity (line 98) | def test_additive_identity(self, g): method test_additive_inverse (line 108) | def test_additive_inverse(self, g): method test_scalar_mul_distributes_over_components (line 118) | def test_scalar_mul_distributes_over_components(self, g, s): method test_scalar_mul_composition (line 127) | def test_scalar_mul_composition(self, g, a, b): method test_scalar_mul_distributes_over_addition (line 137) | def test_scalar_mul_distributes_over_addition(self, a, b, s): method test_rmul_equals_mul (line 146) | def test_rmul_equals_mul(self, g, s): method test_mul_by_one_is_identity (line 155) | def test_mul_by_one_is_identity(self, g): method test_mul_by_zero_is_zero (line 162) | def test_mul_by_zero_is_zero(self, g): method test_neg_is_mul_minus_one (line 171) | def test_neg_is_mul_minus_one(self, g): method test_as_dict_roundtrip (line 179) | def test_as_dict_roundtrip(self, g): class TestEnumInversionsPBT (line 193) | class TestEnumInversionsPBT: method test_direction_double_invert (line 196) | def test_direction_double_invert(self, d): method test_option_type_double_invert (line 201) | def test_option_type_double_invert(self, ot): method test_order_double_invert (line 206) | def test_order_double_invert(self, d, s): method test_direction_invert_differs (line 212) | def test_direction_invert_differs(self, d): method test_option_type_invert_differs (line 217) | def test_option_type_invert_differs(self, ot): class TestFillPBT (line 226) | class TestFillPBT: method test_buy_negative_sell_positive_notional (line 232) | def test_buy_negative_sell_positive_notional(self, price, qty, d, spc): method test_sell_notional_exceeds_buy_notional (line 244) | def test_sell_notional_exceeds_buy_notional(self, price, qty, spc): method test_commission_slippage_reduce_notional (line 257) | def test_commission_slippage_reduce_notional(self, price, qty, d, spc,... method test_notional_formula (line 269) | def test_notional_formula(self, price, qty, d, spc): class TestMaxDeltaPBT (line 283) | class TestMaxDeltaPBT: method test_within_limit_passes (line 286) | def test_within_limit_passes(self, limit, current, proposed, pv, peak): method test_zero_greeks_always_pass (line 298) | def test_zero_greeks_always_pass(self, limit): method test_tighter_limit_blocks_more (line 306) | def test_tighter_limit_blocks_more(self, tight, loose): class TestMaxVegaPBT (line 322) | class TestMaxVegaPBT: method test_correctness (line 325) | def test_correctness(self, limit, current, proposed, pv, peak): method test_zero_greeks_always_pass (line 336) | def test_zero_greeks_always_pass(self, limit): class TestMaxDrawdownPBT (line 342) | class TestMaxDrawdownPBT: method test_correctness (line 347) | def test_correctness(self, max_dd, pv, peak): method test_at_peak_always_passes (line 359) | def test_at_peak_always_passes(self, max_dd, peak): method test_zero_peak_always_passes (line 366) | def test_zero_peak_always_passes(self, max_dd): method test_tighter_limit_blocks_more (line 373) | def test_tighter_limit_blocks_more(self, tight, peak): class TestRiskManagerPBT (line 383) | class TestRiskManagerPBT: method test_no_constraints_always_passes (line 386) | def test_no_constraints_always_passes(self, current, proposed, pv, peak): method test_composite_is_conjunction (line 394) | def test_composite_is_conjunction(self, delta_limit, vega_limit, curre... method test_triple_constraint_conjunction (line 408) | def test_triple_constraint_conjunction(self, dl, vl, ddp, curr, prop, ... method test_adding_constraints_only_restricts (line 421) | def test_adding_constraints_only_restricts(self, current, proposed, pv... class TestStrategyPresetsPBT (line 436) | class TestStrategyPresetsPBT: method test_strangle_always_two_legs (line 439) | def test_strangle_always_two_legs(self, d, dte_lo, dte_ex, otm, tol): method test_iron_condor_four_legs (line 449) | def test_iron_condor_four_legs(self, dte_lo, dte_ex): method test_covered_call_one_leg (line 457) | def test_covered_call_one_leg(self, dte_lo, dte_ex, otm, tol): method test_cash_secured_put_one_leg (line 467) | def test_cash_secured_put_one_leg(self, dte_lo, dte_ex, otm, tol): method test_collar_two_legs (line 477) | def test_collar_two_legs(self, dte_lo, dte_ex, call_otm, put_otm, tol): method test_butterfly_three_legs (line 487) | def test_butterfly_three_legs(self, dte_lo, dte_ex, ot): method test_strangle_class_matches_function (line 496) | def test_strangle_class_matches_function(self, name, dte_lo, dte_ex, o... class TestStrategyOperationsPBT (line 509) | class TestStrategyOperationsPBT: method test_add_remove_legs_preserves_length (line 512) | def test_add_remove_legs_preserves_length(self, n, d, ot): method test_exit_thresholds_stored (line 526) | def test_exit_thresholds_stored(self, profit, loss): method test_clear_legs (line 534) | def test_clear_legs(self, d, ot): FILE: tests/test_cleanup.py function test_top_level_exports_trimmed (line 6) | def test_top_level_exports_trimmed(): function test_pipeline_importable_from_submodule (line 26) | def test_pipeline_importable_from_submodule(): function test_algo_adapters_importable_from_submodule (line 41) | def test_algo_adapters_importable_from_submodule(): function test_strategy_tree_importable_from_submodule (line 53) | def test_strategy_tree_importable_from_submodule(): function test_compat_directory_removed (line 62) | def test_compat_directory_removed(): function test_no_duplicate_import_in_engine (line 71) | def test_no_duplicate_import_in_engine(): function test_safe_ratio_removed (line 78) | def test_safe_ratio_removed(): function test_rust_extension_importable (line 84) | def test_rust_extension_importable(): FILE: tests/test_deep_analytics_convexity.py function _make_balance (line 55) | def _make_balance(n_days=252, start_capital=100_000, daily_return=0.0004): class TestStatsEmpty (line 66) | class TestStatsEmpty: method test_empty_balance (line 67) | def test_empty_balance(self): method test_single_row_balance (line 72) | def test_single_row_balance(self): class TestStatsAccuracy (line 81) | class TestStatsAccuracy: method test_total_return_positive_market (line 82) | def test_total_return_positive_market(self): method test_total_return_negative_market (line 89) | def test_total_return_negative_market(self): method test_sharpe_positive_for_good_market (line 95) | def test_sharpe_positive_for_good_market(self): method test_max_drawdown_non_negative (line 101) | def test_max_drawdown_non_negative(self): method test_volatility_non_negative (line 107) | def test_volatility_non_negative(self): method test_calmar_ratio_computed (line 113) | def test_calmar_ratio_computed(self): class TestPeriodStatsDetail (line 121) | class TestPeriodStatsDetail: method test_daily_stats_populated (line 122) | def test_daily_stats_populated(self): method test_monthly_stats_populated (line 129) | def test_monthly_stats_populated(self): method test_yearly_stats_with_enough_data (line 135) | def test_yearly_stats_with_enough_data(self): method test_skew_kurtosis_need_8_samples (line 141) | def test_skew_kurtosis_need_8_samples(self): class TestLookbackReturns (line 149) | class TestLookbackReturns: method test_lookback_mtd (line 150) | def test_lookback_mtd(self): method test_lookback_ytd (line 155) | def test_lookback_ytd(self): method test_lookback_one_year (line 160) | def test_lookback_one_year(self): method test_lookback_short_data_still_computes (line 165) | def test_lookback_short_data_still_computes(self): class TestTradeStats (line 175) | class TestTradeStats: method test_with_pnls (line 176) | def test_with_pnls(self): method test_all_winners (line 189) | def test_all_winners(self): method test_all_losers (line 197) | def test_all_losers(self): method test_no_pnls (line 204) | def test_no_pnls(self): class TestBalanceRange (line 210) | class TestBalanceRange: method test_slice_by_date (line 211) | def test_slice_by_date(self): method test_empty_slice (line 218) | def test_empty_slice(self): class TestToDataframe (line 224) | class TestToDataframe: method test_output_is_dataframe (line 225) | def test_output_is_dataframe(self): method test_summary_string (line 232) | def test_summary_string(self): class TestTurnoverAndHerfindahl (line 240) | class TestTurnoverAndHerfindahl: method test_turnover_with_stocks (line 241) | def test_turnover_with_stocks(self): method test_turnover_no_stocks (line 254) | def test_turnover_no_stocks(self): method test_herfindahl_single_stock (line 261) | def test_herfindahl_single_stock(self): method test_herfindahl_two_equal_stocks (line 272) | def test_herfindahl_two_equal_stocks(self): class TestSharpeViaStats (line 291) | class TestSharpeViaStats: method test_positive_returns (line 292) | def test_positive_returns(self): method test_single_value_finite (line 303) | def test_single_value_finite(self): class TestSortinoViaStats (line 311) | class TestSortinoViaStats: method test_no_downside_returns_zero (line 312) | def test_no_downside_returns_zero(self): method test_with_downside (line 323) | def test_with_downside(self): class TestFindTargetPut (line 340) | class TestFindTargetPut: method test_exact_match (line 341) | def test_exact_match(self): method test_closest_match (line 348) | def test_closest_match(self): method test_dte_filter_excludes_short (line 356) | def test_dte_filter_excludes_short(self): method test_dte_filter_excludes_long (line 363) | def test_dte_filter_excludes_long(self): method test_zero_ask_excluded (line 370) | def test_zero_ask_excluded(self): method test_nan_delta_excluded (line 376) | def test_nan_delta_excluded(self): method test_all_excluded (line 383) | def test_all_excluded(self): method test_empty_arrays (line 389) | def test_empty_arrays(self): class TestConvexityRatio (line 397) | class TestConvexityRatio: method test_basic_computation (line 398) | def test_basic_computation(self): method test_otm_put_zero_payoff (line 409) | def test_otm_put_zero_payoff(self): method test_zero_ask (line 415) | def test_zero_ask(self): method test_deep_itm (line 420) | def test_deep_itm(self): class TestMonthlyRebalanceDates (line 432) | class TestMonthlyRebalanceDates: method test_basic (line 433) | def test_basic(self): method test_single_month (line 438) | def test_single_month(self): method test_empty (line 443) | def test_empty(self): class TestStockPriceOn (line 447) | class TestStockPriceOn: method test_exact_match (line 448) | def test_exact_match(self): method test_between_dates (line 453) | def test_between_dates(self): method test_before_first_date (line 459) | def test_before_first_date(self): class TestFindDateRange (line 465) | class TestFindDateRange: method test_exact_match (line 466) | def test_exact_match(self): method test_no_match (line 472) | def test_no_match(self): class TestConvexityConfig (line 483) | class TestConvexityConfig: method test_instrument_config_defaults (line 484) | def test_instrument_config_defaults(self): method test_backtest_config_defaults (line 491) | def test_backtest_config_defaults(self): method test_default_config (line 496) | def test_default_config(self): method test_frozen (line 501) | def test_frozen(self): class TestAllocator (line 512) | class TestAllocator: method test_pick_cheapest (line 513) | def test_pick_cheapest(self): method test_pick_cheapest_empty_raises (line 517) | def test_pick_cheapest_empty_raises(self): method test_equal_weight (line 521) | def test_equal_weight(self): method test_equal_weight_empty (line 526) | def test_equal_weight_empty(self): method test_inverse_vol (line 529) | def test_inverse_vol(self): method test_inverse_vol_zero_vol (line 535) | def test_inverse_vol_zero_vol(self): method test_inverse_vol_mixed_zero (line 540) | def test_inverse_vol_mixed_zero(self): class TestRustExtension (line 551) | class TestRustExtension: method test_rust_extension_importable (line 552) | def test_rust_extension_importable(self): class TestSchemaBasic (line 561) | class TestSchemaBasic: method test_stocks_schema (line 562) | def test_stocks_schema(self): method test_options_schema (line 567) | def test_options_schema(self): method test_update (line 572) | def test_update(self): method test_contains (line 577) | def test_contains(self): method test_equality (line 582) | def test_equality(self): method test_inequality_different_mappings (line 587) | def test_inequality_different_mappings(self): class TestFilterDSL (line 594) | class TestFilterDSL: method test_field_comparison (line 595) | def test_field_comparison(self): method test_field_equality_string (line 601) | def test_field_equality_string(self): method test_filter_and (line 606) | def test_filter_and(self): method test_filter_or (line 611) | def test_filter_or(self): method test_filter_invert (line 616) | def test_filter_invert(self): method test_filter_call_on_dataframe (line 621) | def test_filter_call_on_dataframe(self): method test_field_arithmetic (line 628) | def test_field_arithmetic(self): method test_field_subtraction (line 634) | def test_field_subtraction(self): method test_field_comparison_between_fields (line 639) | def test_field_comparison_between_fields(self): FILE: tests/test_intrinsic_sign.py function _make_engine_with_position (line 19) | def _make_engine_with_position(direction: Direction, option_type: Option... class TestBuyPutItmPositiveCapital (line 65) | class TestBuyPutItmPositiveCapital: method test_buy_put_itm_positive_capital (line 68) | def test_buy_put_itm_positive_capital(self): class TestSellPutItmNegativeCapital (line 78) | class TestSellPutItmNegativeCapital: method test_sell_put_itm_negative_capital (line 81) | def test_sell_put_itm_negative_capital(self): class TestBuyCallItmPositiveCapital (line 91) | class TestBuyCallItmPositiveCapital: method test_buy_call_itm_positive_capital (line 94) | def test_buy_call_itm_positive_capital(self): class TestSellCallItmNegativeCapital (line 103) | class TestSellCallItmNegativeCapital: method test_sell_call_itm_negative_capital (line 106) | def test_sell_call_itm_negative_capital(self): class TestOtmCapitalIsZero (line 115) | class TestOtmCapitalIsZero: method test_otm_put (line 118) | def test_otm_put(self): method test_otm_call (line 125) | def test_otm_call(self): FILE: tests/test_intrinsic_value.py class TestIntrinsicValue (line 16) | class TestIntrinsicValue: method test_put_itm (line 17) | def test_put_itm(self): method test_put_otm (line 21) | def test_put_otm(self): method test_call_itm (line 25) | def test_call_itm(self): method test_call_otm (line 29) | def test_call_otm(self): method test_put_atm (line 33) | def test_put_atm(self): method test_call_atm (line 37) | def test_call_atm(self): method test_deep_itm_put (line 41) | def test_deep_itm_put(self): method test_uses_option_type_enum_values (line 45) | def test_uses_option_type_enum_values(self): FILE: tests/test_property_based.py function _make_balance (line 54) | def _make_balance(returns: list[float], initial: float = 100_000.0) -> p... class TestStatsInvariants (line 68) | class TestStatsInvariants: method test_max_drawdown_non_negative (line 71) | def test_max_drawdown_non_negative(self, returns): method test_max_drawdown_at_most_one (line 78) | def test_max_drawdown_at_most_one(self, returns): method test_avg_drawdown_leq_max (line 85) | def test_avg_drawdown_leq_max(self, returns): method test_volatility_non_negative (line 92) | def test_volatility_non_negative(self, returns): method test_total_return_consistent (line 99) | def test_total_return_consistent(self, returns): method test_trade_stats_consistent (line 111) | def test_trade_stats_consistent(self, returns, pnls): method test_dataframe_has_all_rows (line 122) | def test_dataframe_has_all_rows(self, returns): class TestCostModelInvariants (line 134) | class TestCostModelInvariants: method test_no_costs_always_zero (line 137) | def test_no_costs_always_zero(self, p, q): method test_per_contract_non_negative (line 143) | def test_per_contract_non_negative(self, p, q, r): method test_per_contract_proportional (line 150) | def test_per_contract_proportional(self, p, q, r): method test_per_contract_symmetric (line 158) | def test_per_contract_symmetric(self, p, q): class TestFillModelInvariants (line 168) | class TestFillModelInvariants: method test_mid_price_between_bid_ask (line 174) | def test_mid_price_between_bid_ask(self, bid, ask): method test_market_bid_ask_buy_at_ask (line 187) | def test_market_bid_ask_buy_at_ask(self, bid, ask): class TestWeightInvariants (line 200) | class TestWeightInvariants: method test_weigh_equally_sums_to_one (line 203) | def test_weigh_equally_sums_to_one(self, n): method test_limit_weights_caps_with_many_assets (line 218) | def test_limit_weights_caps_with_many_assets(self): method test_scale_weights_multiplies (line 237) | def test_scale_weights_multiplies(self, scale): class TestPipelineFuzz (line 255) | class TestPipelineFuzz: method test_pipeline_no_crash_on_random_prices (line 265) | def test_pipeline_no_crash_on_random_prices(self, spy_prices, capital): method test_pipeline_multi_asset_no_crash (line 288) | def test_pipeline_multi_asset_no_crash(self, price_pairs): method test_stats_from_pipeline_no_crash (line 310) | def test_stats_from_pipeline_no_crash(self, spy_prices): class TestRustConfigRoundTrip (line 330) | class TestRustConfigRoundTrip: method test_cost_models_have_rust_config (line 331) | def test_cost_models_have_rust_config(self): method test_fill_models_have_rust_config (line 337) | def test_fill_models_have_rust_config(self): method test_signal_selectors_have_rust_config (line 343) | def test_signal_selectors_have_rust_config(self): FILE: tests/test_smoke.py function test_top_level_imports (line 4) | def test_top_level_imports(): function test_strategy_presets_import (line 36) | def test_strategy_presets_import():