Coverage report: 96%

Files Functions Classes

coverage.py v7.15.4, created at 2026-08-21 17:12 +0000

      Statements   Branches   Total
File function   coverage statements missing excluded   coverage branches partial   coverage
src/finbot/__init__.py (no function)   100% 0 0 0   100% 0 0   100%
src/finbot/backtest/__init__.py (no function)   100% 0 0 0   100% 0 0   100%
src/finbot/backtest/artifacts.py ExperimentStore.__init__   100% 1 0 0   100% 0 0   100%
src/finbot/backtest/artifacts.py ExperimentStore.create_run   100% 4 0 0   100% 0 0   100%
src/finbot/backtest/artifacts.py ExperimentStore.save   100% 4 0 0   100% 0 0   100%
src/finbot/backtest/artifacts.py ExperimentStore.load   100% 5 0 0   100% 2 0   100%
src/finbot/backtest/artifacts.py ExperimentStore.load_many   100% 1 0 0   100% 0 0   100%
src/finbot/backtest/artifacts.py ExperimentStore._serialize   100% 1 0 0   100% 0 0   100%
src/finbot/backtest/artifacts.py ExperimentStore._deserialize   100% 9 0 0   100% 2 0   100%
src/finbot/backtest/artifacts.py (no function)   100% 18 0 0   100% 0 0   100%
src/finbot/backtest/comparison.py compare_experiments   100% 1 0 0   100% 0 0   100%
src/finbot/backtest/comparison.py (no function)   100% 19 0 0   100% 0 0   100%
src/finbot/backtest/experiment.py ExperimentConfig.__post_init__   93% 14 1 0   93% 14 1   93%
src/finbot/backtest/experiment.py (no function)   100% 27 0 0   100% 0 0   100%
src/finbot/backtest/models.py EquityPoint.serialize   100% 1 0 0   100% 0 0   100%
src/finbot/backtest/models.py EquityPoint.deserialize   100% 1 0 0   100% 0 0   100%
src/finbot/backtest/models.py SignalRejection.serialize   100% 0 0 6   100% 0 0   100%
src/finbot/backtest/models.py SignalRejection.deserialize   0% 1 1 0   100% 0 0   0%
src/finbot/backtest/models.py BacktestResult.pnl   100% 1 0 0   100% 0 0   100%
src/finbot/backtest/models.py BacktestResult.total_return   100% 3 0 0   100% 2 0   100%
src/finbot/backtest/models.py BacktestResult.max_drawdown   100% 10 0 0   100% 6 0   100%
src/finbot/backtest/models.py BacktestResult.trades   100% 1 0 0   100% 0 0   100%
src/finbot/backtest/models.py BacktestResult.trade_count   100% 1 0 0   100% 0 0   100%
src/finbot/backtest/models.py BacktestResult.winning_trades   100% 1 0 0   100% 0 0   100%
src/finbot/backtest/models.py BacktestResult.losing_trades   100% 1 0 0   100% 0 0   100%
src/finbot/backtest/models.py BacktestResult.win_rate   100% 3 0 0   100% 2 0   100%
src/finbot/backtest/models.py BacktestResult.profit_factor   100% 3 0 0   100% 0 0   100%
src/finbot/backtest/models.py BacktestResult.returns   100% 3 0 0   100% 2 0   100%
src/finbot/backtest/models.py BacktestResult.average_trade   100% 2 0 0   100% 2 0   100%
src/finbot/backtest/models.py BacktestResult.median_trade   100% 2 0 0   100% 2 0   100%
src/finbot/backtest/models.py BacktestResult.best_trade   100% 2 0 0   100% 2 0   100%
src/finbot/backtest/models.py BacktestResult.worst_trade   100% 2 0 0   100% 2 0   100%
src/finbot/backtest/models.py BacktestResult.average_trade_duration   100% 3 0 0   100% 2 0   100%
src/finbot/backtest/models.py BacktestResult.cagr   100% 11 0 0   100% 8 0   100%
src/finbot/backtest/models.py BacktestResult.calmar_ratio   89% 9 1 0   83% 6 1   87%
src/finbot/backtest/models.py BacktestResult.total_fees   100% 1 0 0   100% 0 0   100%
src/finbot/backtest/models.py BacktestResult.total_slippage   100% 1 0 0   100% 0 0   100%
src/finbot/backtest/models.py BacktestResult.turnover   100% 7 0 0   83% 6 1   92%
src/finbot/backtest/models.py BacktestResult.exposure   100% 3 0 0   100% 2 0   100%
src/finbot/backtest/models.py BacktestResult.excess_return   100% 3 0 0   100% 2 0   100%
src/finbot/backtest/models.py BacktestResult._risk_free_rate_per_period   67% 3 1 0   50% 2 1   60%
src/finbot/backtest/models.py BacktestResult.annualized_volatility   100% 7 0 0   100% 4 0   100%
src/finbot/backtest/models.py BacktestResult.sharpe_ratio   100% 12 0 0   100% 6 0   100%
src/finbot/backtest/models.py BacktestResult.sortino_ratio   100% 16 0 0   100% 8 0   100%
src/finbot/backtest/models.py (no function)   100% 81 0 1   100% 0 0   100%
src/finbot/backtest/runner.py ExperimentRunner.__init__   100% 1 0 0   100% 0 0   100%
src/finbot/backtest/runner.py ExperimentRunner.run   100% 9 0 0   100% 4 0   100%
src/finbot/backtest/runner.py ExperimentRunner._create_strategy   100% 7 0 0   100% 6 0   100%
src/finbot/backtest/runner.py (no function)   100% 15 0 0   100% 0 0   100%
src/finbot/backtest/trades.py Trade.gross_pnl   100% 1 0 0   100% 0 0   100%
src/finbot/backtest/trades.py Trade.fees   100% 1 0 0   100% 0 0   100%
src/finbot/backtest/trades.py Trade.net_pnl   100% 1 0 0   100% 0 0   100%
src/finbot/backtest/trades.py Trade.pnl   100% 1 0 0   100% 0 0   100%
src/finbot/backtest/trades.py Trade.return_pct   100% 1 0 0   100% 0 0   100%
src/finbot/backtest/trades.py Trade.duration   100% 1 0 0   100% 0 0   100%
src/finbot/backtest/trades.py Trade.serialize   100% 0 0 15   100% 0 0   100%
src/finbot/backtest/trades.py trades_from_fills   100% 15 0 0   100% 10 0   100%
src/finbot/backtest/trades.py (no function)   100% 27 0 1   100% 0 0   100%
src/finbot/cli/__init__.py (no function)   100% 0 0 0   100% 0 0   100%
src/finbot/cli/backtest.py _format_comparison   100% 7 0 0   100% 0 0   100%
src/finbot/cli/backtest.py _format_comparison.format_row   100% 1 0 0   100% 0 0   100%
src/finbot/cli/backtest.py add_arguments   100% 12 0 0   100% 0 0   100%
src/finbot/cli/backtest.py add_compare_arguments   100% 2 0 0   100% 0 0   100%
src/finbot/cli/backtest.py run   0% 2 2 0   100% 0 0   0%
src/finbot/cli/backtest.py run_compare   100% 11 0 0   100% 2 0   100%
src/finbot/cli/backtest.py (no function)   100% 10 0 0   100% 0 0   100%
src/finbot/cli/main.py _test_api   100% 7 0 0   100% 0 0   100%
src/finbot/cli/main.py _add_verbose_argument   100% 4 0 0   100% 2 0   100%
src/finbot/cli/main.py _build_parser   100% 18 0 0   100% 0 0   100%
src/finbot/cli/main.py main   100% 11 0 0   100% 2 0   100%
src/finbot/cli/main.py (no function)   100% 14 0 2   100% 0 0   100%
src/finbot/config.py load_settings   100% 10 0 0   100% 6 0   100%
src/finbot/config.py (no function)   100% 10 0 0   100% 0 0   100%
src/finbot/engine/__init__.py (no function)   100% 0 0 0   100% 0 0   100%
src/finbot/engine/backtest_engine.py BacktestEngine.__init__   100% 9 0 0   100% 2 0   100%
src/finbot/engine/backtest_engine.py BacktestEngine.run   94% 49 3 0   89% 28 3   92%
src/finbot/engine/backtest_engine.py BacktestEngine._signal_to_order   52% 23 11 0   43% 14 4   49%
src/finbot/engine/backtest_engine.py (no function)   100% 17 0 0   100% 0 0   100%
src/finbot/engine/trading_engine.py TradingEngine.__init__   0% 3 3 0   100% 0 0   0%
src/finbot/engine/trading_engine.py TradingEngine.tick   0% 3 3 0   100% 0 0   0%
src/finbot/engine/trading_engine.py (no function)   0% 6 6 0   100% 0 0   0%
src/finbot/execution/__init__.py (no function)   100% 0 0 0   100% 0 0   100%
src/finbot/execution/broker.py SimulatedBroker.__init__   100% 11 0 0   100% 8 0   100%
src/finbot/execution/broker.py SimulatedBroker.execute   100% 15 0 0   100% 8 0   100%
src/finbot/execution/broker.py (no function)   100% 8 0 0   100% 0 0   100%
src/finbot/execution/fill.py Fill.__post_init__   100% 18 0 0   100% 18 0   100%
src/finbot/execution/fill.py Fill.serialize   100% 1 0 0   100% 0 0   100%
src/finbot/execution/fill.py Fill.deserialize   100% 1 0 0   100% 0 0   100%
src/finbot/execution/fill.py (no function)   100% 18 0 0   100% 0 0   100%
src/finbot/execution/order.py Order.__post_init__   100% 6 0 0   100% 6 0   100%
src/finbot/execution/order.py (no function)   100% 16 0 0   100% 0 0   100%
src/finbot/execution/policy.py (no function)   100% 4 0 0   100% 0 0   100%
src/finbot/main.py main   0% 4 4 0   100% 0 0   0%
src/finbot/main.py (no function)   0% 3 3 2   100% 0 0   0%
src/finbot/market/__init__.py (no function)   100% 0 0 0   100% 0 0   100%
src/finbot/market/alpaca.py AlpacaMarketDataProvider.__init__   100% 4 0 0   100% 0 0   100%
src/finbot/market/alpaca.py AlpacaMarketDataProvider.get_latest_bar   100% 5 0 0   100% 0 0   100%
src/finbot/market/alpaca.py AlpacaMarketDataProvider.get_bars   100% 35 0 0   100% 12 0   100%
src/finbot/market/alpaca.py AlpacaMarketDataProvider._parse_bar   100% 1 0 0   100% 0 0   100%
src/finbot/market/alpaca.py (no function)   100% 16 0 0   100% 0 0   100%
src/finbot/market/cache.py HistoricalDataCache.__init__   100% 1 0 0   100% 0 0   100%
src/finbot/market/cache.py HistoricalDataCache.contains   100% 1 0 0   100% 0 0   100%
src/finbot/market/cache.py HistoricalDataCache.save   88% 32 4 0   83% 6 1   87%
src/finbot/market/cache.py HistoricalDataCache.load   100% 32 0 0   100% 12 0   100%
src/finbot/market/cache.py HistoricalDataCache.get_bars   100% 2 0 0   100% 0 0   100%
src/finbot/market/cache.py HistoricalDataCache.get_metadata   100% 2 0 0   100% 0 0   100%
src/finbot/market/cache.py HistoricalDataCache._dataset_dir   100% 3 0 0   100% 2 0   100%
src/finbot/market/cache.py HistoricalDataCache._json_bytes   100% 2 0 0   100% 0 0   100%
src/finbot/market/cache.py HistoricalDataCache._serialize_bars   100% 5 0 0   100% 4 0   100%
src/finbot/market/cache.py HistoricalDataCache._deserialize_bars   92% 13 1 0   83% 6 1   89%
src/finbot/market/cache.py HistoricalDataCache._normalize_bars   95% 21 1 0   86% 14 2   91%
src/finbot/market/cache.py HistoricalDataCache._read_json_object   100% 7 0 0   100% 2 0   100%
src/finbot/market/cache.py HistoricalDataCache._validate_manifest   100% 12 0 0   100% 10 0   100%
src/finbot/market/cache.py (no function)   100% 36 0 0   100% 0 0   100%
src/finbot/market/data_provider.py MarketDataProvider.get_latest_bar   100% 0 0 1   100% 0 0   100%
src/finbot/market/data_provider.py MarketDataProvider.get_bars   100% 0 0 1   100% 0 0   100%
src/finbot/market/data_provider.py (no function)   100% 4 0 11   100% 0 0   100%
src/finbot/market/dataset.py DatasetMetadata.__post_init__   100% 28 0 0   100% 18 0   100%
src/finbot/market/dataset.py DatasetMetadata.dataset_id   100% 2 0 0   100% 0 0   100%
src/finbot/market/dataset.py DatasetMetadata.to_dict   100% 1 0 0   100% 0 0   100%
src/finbot/market/dataset.py DatasetMetadata.from_dict   97% 31 1 0   93% 14 1   96%
src/finbot/market/dataset.py (no function)   100% 21 0 0   100% 0 0   100%
src/finbot/market/models.py Bar.__post_init__   100% 16 0 0   100% 16 0   100%
src/finbot/market/models.py (no function)   100% 13 0 0   100% 0 0   100%
src/finbot/portfolio/__init__.py (no function)   100% 0 0 0   100% 0 0   100%
src/finbot/portfolio/portfolio.py Portfolio.apply_fill   100% 6 0 0   100% 4 0   100%
src/finbot/portfolio/portfolio.py Portfolio._apply_buy_fill   100% 13 0 0   100% 2 0   100%
src/finbot/portfolio/portfolio.py Portfolio._apply_sell_fill   100% 16 0 0   100% 6 0   100%
src/finbot/portfolio/portfolio.py Portfolio.positions_value   100% 6 0 0   100% 4 0   100%
src/finbot/portfolio/portfolio.py Portfolio.total_value   100% 1 0 0   100% 0 0   100%
src/finbot/portfolio/portfolio.py (no function)   100% 15 0 0   100% 0 0   100%
src/finbot/portfolio/position.py Position.market_value   100% 1 0 0   100% 0 0   100%
src/finbot/portfolio/position.py Position.unrealized_pnl   100% 1 0 0   100% 0 0   100%
src/finbot/portfolio/position.py (no function)   100% 10 0 0   100% 0 0   100%
src/finbot/risk/__init__.py (no function)   100% 4 0 0   100% 0 0   100%
src/finbot/risk/models.py RiskLimits.__post_init__   100% 13 0 0   100% 10 0   100%
src/finbot/risk/models.py RiskLimits._validate_fraction   100% 4 0 0   100% 4 0   100%
src/finbot/risk/models.py RiskLimits._validate_positive   100% 4 0 0   100% 4 0   100%
src/finbot/risk/models.py RiskDecision.__post_init__   86% 7 1 0   88% 8 1   87%
src/finbot/risk/models.py RiskDecision.accept   100% 1 0 0   100% 0 0   100%
src/finbot/risk/models.py RiskDecision.reject   100% 1 0 0   100% 0 0   100%
src/finbot/risk/models.py SizingDecision.__post_init__   100% 8 0 0   100% 8 0   100%
src/finbot/risk/models.py SizingDecision.accepted   100% 1 0 0   100% 0 0   100%
src/finbot/risk/models.py SizingDecision.accept   100% 1 0 0   100% 0 0   100%
src/finbot/risk/models.py SizingDecision.reject   100% 1 0 0   100% 0 0   100%
src/finbot/risk/models.py (no function)   100% 36 0 0   100% 0 0   100%
src/finbot/risk/position_sizer.py PositionSizer.size   93% 14 1 0   88% 8 1   91%
src/finbot/risk/position_sizer.py PositionSizer._validate_inputs   100% 10 0 0   100% 10 0   100%
src/finbot/risk/position_sizer.py (no function)   100% 7 0 0   100% 0 0   100%
src/finbot/risk/risk_manager.py RiskManager.__init__   100% 1 0 0   100% 0 0   100%
src/finbot/risk/risk_manager.py RiskManager.assess   100% 8 0 0   100% 6 0   100%
src/finbot/risk/risk_manager.py RiskManager._assess_long   93% 29 2 0   92% 12 1   93%
src/finbot/risk/risk_manager.py RiskManager._assess_short   100% 10 0 0   100% 6 0   100%
src/finbot/risk/risk_manager.py RiskManager._validate_market_prices   88% 8 1 0   83% 6 1   86%
src/finbot/risk/risk_manager.py (no function)   100% 11 0 0   100% 0 0   100%
src/finbot/strategy/__init__.py (no function)   100% 0 0 0   100% 0 0   100%
src/finbot/strategy/base.py Strategy.on_bar   100% 0 0 1   100% 0 0   100%
src/finbot/strategy/base.py (no function)   100% 4 0 2   100% 0 0   100%
src/finbot/strategy/signal.py Signal.__post_init__   100% 7 0 0   100% 8 0   100%
src/finbot/strategy/signal.py (no function)   100% 15 0 0   100% 0 0   100%
src/finbot/strategy/sma_crossover.py SmaCrossoverStrategy.__init__   100% 8 0 0   100% 4 0   100%
src/finbot/strategy/sma_crossover.py SmaCrossoverStrategy._get_direction   67% 3 1 0   75% 4 1   71%
src/finbot/strategy/sma_crossover.py SmaCrossoverStrategy.on_bar   100% 17 0 0   100% 8 0   100%
src/finbot/strategy/sma_crossover.py (no function)   100% 9 0 0   100% 0 0   100%
src/finbot/strategy/strategies.py RandomStrategy.on_bar   100% 6 0 0   100% 4 0   100%
src/finbot/strategy/strategies.py BuyOnceStrategy.__init__   100% 1 0 0   100% 0 0   100%
src/finbot/strategy/strategies.py BuyOnceStrategy.on_bar   100% 4 0 0   100% 2 0   100%
src/finbot/strategy/strategies.py (no function)   100% 9 0 0   100% 0 0   100%
Total     96% 1390 52 43   94% 444 21   96%

No items found using the specified filter.