Changelog
2.0.0
Requires Python 3.11+.
Multiple time intervals, including
.intervals()binding.Fill-time slippage models via
apply_slippage/SlippageContext.Parallelization configuration (Ray backend).
Ranking with long_score / short_score.
Position limits via Strategy.set_max_long_positions / set_max_short_positions.
to_json / to_json_str on backtest and optimize results.
ATR indicator; bars_to_df helper.
Broad NumPy/Numba performance improvements.
Breaking changes
Removes
PosSizeContext,set_pos_size_handler, andExecSignal; use Strategy.enable_rotation / RotationContext.Deprecates
ExecContext.scoreandStrategyConfig.max_*_positions; use long_score / short_score and set_max_long_positions / set_max_short_positions.Unifies slippage API; removes
RandomSlippageModel.Removes
bootstrap_sample_size; BCa and drawdown bootstrap now resample the full backtest series instead of a fixed-size sample, fixing cases that could produce incorrect confidence intervals or degenerate to a single replicate.Removes
disable_parallelfrom backtest / walkforward; parallel indicator and model work is opt-in viaparallel_indicators/parallel_models.result.positionsis opt-in via StrategyConfig.record_position_bars; fullPortfolio.barssnapshots are opt-in via record_portfolio_bars.Removes
aksharefrom install dependencies; install it separately to use AKShare.Fixes the Calmar Ratio to the standard definition of annualized return (CAGR) divided by maximum drawdown percentage; it previously annualized arithmetically and measured drawdown on the cumulative sum of per-bar returns.
Fixes the Ulcer Index to measure drawdowns from the running peak over the whole equity curve, and the Ulcer Performance Index to use the annualized (CAGR) return when
bars_per_yearis set; passing aperiodto the functions keeps the previous trailing-window behavior.Fixes
unrealized_pnlin EvalMetrics, which previously understated unrealized PnL by the total fees paid (per-trade PnL is gross of fees while market values are net of them).annual_total_return_percent now counts
nbar values asn - 1return intervals when annualizing.
1.2.14
Requires Python 3.10+.
Fixes indicator computation bugs in vect (Aroon, Laguerre RSI, ADX, price change oscillator, reactivity, trend, and related kernels).
Fixes duplicate
volumecolumn in the AKShare TX fallback path.
1.2.13
Adds signal provenance fields to Order:
created- date the order signal was created.order_type- how the order originated (market,limit,stop_bar,stop_loss,stop_profit,stop_trailing).intent- position intent (buy_to_open,buy_to_close,sell_to_open,sell_to_close).
Adds OrderType and PositionIntent enums.
Adds
order_idparameter to PendingOrderScope.orders().Adds Agent Skills.
Broad performance improvements to bar capture, scope fetches, and position lookups.
Improves Alpaca crypto and AKShare reliability.
1.2.12
Supports Pandas 3.
1.2.11
Fixes readonly NumPy arrays returned by Pandas 2.3.
Adds clear_params to clear global parameters.
Forwards
*argsand**kwargsfrom Strategy.add_execution to the execution function.Adds
seedto backtest / walkforward for reproducible bootstrap results.Removes redundant
subtract_feesconfig option.
1.2.10
Uses per-bar returns instead of absolute per-bar deltas for Sharpe, Sortino, and Calmar ratios.
1.2.9
Upgrades to NumPy 2 while still supporting NumPy 1.
Adds
LONG_ONLYandSHORT_ONLYposition modes.Adds
max_drawdown_dateto EvalMetrics.Fixes
yfinancedependency version.
1.2.8
Fixes NumPy typecheck errors.
1.2.7
Fixes
df.loc[index]returning a DataFrame when the index is not unique.
1.2.6
Fixes missing
Adj Closecolumn from YFinance; addsauto_adjustargument.Raises an error when
sell_all_sharesorcover_all_sharesis called with no open position.
1.2.5
Adds
adjustparameter to backtest / walkforward.Fixes mypy typecheck errors.
1.2.4
Guarantees
largest_loss_pctis always negative andlargest_win_pctis always positive in EvalMetrics.
1.2.3
Adds built-in indicators to the indicator module.
1.1.0
Adds support for the following stop types:
Stop loss
Trailing stop loss
Take profit
Upgrades
alpaca-trade-api-pythontoalpaca-pypackage.
1.0.0
Initial release!