backtesting

alpha_model

alpha_model.AlphaModel

Base class for all alpha models.

futures_model.FuturesModel

Type of alpha model, which can be easily integrated with any type of Tickers (plain Ticker objects, as well as FutureTickers).

contract

contract_to_ticker_conversion.base.ContractTickerMapper

contract_to_ticker_conversion.simulated_contract_ticker_mapper.SimulatedContractTickerMapper

Simulated contract to ticker mapper, which should be used for backtesting purposes.

contract_to_ticker_conversion.ib_contract_ticker_mapper.IBContractTickerMapper

IB IBContract mapper that can be used for live trading.

data_handler

data_handler.DataHandler

DataHandler is a wrapper which can be used with any AbstractPriceDataProvider in both live and backtest environment.

daily_data_handler.DailyDataHandler

intraday_data_handler.IntradayDataHandler

events

time_event.TimeEvent

Represents an event associated with certain date/time (e.g.

regular_time_event.regular_time_event.RegularTimeEvent

TimeEvent which occurs on regular basis (e.g.

regular_time_event.after_market_close_event.AfterMarketCloseEvent

Rule which is triggered every day after market closes.

regular_time_event.market_close_event.MarketCloseEvent

Rule which is triggered every day when the market closes.

regular_time_event.market_open_event.MarketOpenEvent

Rule which is triggered every day when the market opens.

regular_time_event.calculate_and_place_orders_event.CalculateAndPlaceOrdersRegularEvent

Class implementing the logic for all triggering regular calculation of signals and placing orders.

execution_handler

commission_models

commission_model.CommissionModel

fixed_commission_model.FixedCommissionModel

Naive commission model which always charges the same commission.

bps_trade_value_commission_model.BpsTradeValueCommissionModel

Commission model which uses fixed bps rate for trade value.

ib_commission_model.IBCommissionModel

Interactive Brokers commission for a transaction.

slippage

base.Slippage

Base class for slippage models.

fixed_slippage.FixedSlippage

Slippage which always adds (or subtracts if short sale) certain absolute amount of money to the price.

price_based_slippage.PriceBasedSlippage

Calculates the slippage by using some fixed fraction of the current securities’ price (e.g.

square_root_market_impact_slippage.SquareRootMarketImpactSlippage

Slippage based on the square-root formula for market impact modelling.

fast_alpha_model_tester

backtest_summary.BacktestSummaryElement

Class containing a summary of the performed backtest.

fast_alpha_models_tester.FastAlphaModelTester

ModelTester in which portfolio construction is simulated by always following the suggested Exposures from AlphaModels.

initial_risk_stats.InitialRiskStatsFactory

scenarios_generator.ScenariosGenerator

Class used for generating different scenarios for Trades.

monitoring

abstract_monitor.AbstractMonitor

AbstractMonitor is a class providing an interface for all inherited Monitor classes (live, historic, custom, etc).

backtest_monitor.BacktestMonitor

This Monitor will be used to monitor backtest run from the script.

backtest_result.BacktestResult

BacktestResult is a class providing simple data model containing information about the backtest: for example it contains a portfolio with its timeseries and trades.

orders_filter

orders_filter.OrdersFilter

Adjusts final orders list to meet various requirements e.g.

volume_orders_filter.VolumeOrdersFilter

Verifies whether the orders sizes do not exceed the given volume limit.

portfolio

portfolio.Portfolio

backtest_position.BacktestPosition

backtest_equity_position.BacktestEquityPosition

backtest_crypto_position.BacktestCryptoPosition

backtest_future_position.BacktestFuturePosition

trade.Trade

Trade is a logical unit representing getting exposure to the market (long or short) finished by closing the position.

transaction.Transaction

Encapsulates the notion of a filled Order, as returned from a Brokerage.

position_sizer

position_sizer.PositionSizer

The PositionSizer abstract class converts signals to orders with size specified.

simple_position_sizer.SimplePositionSizer

This SimplePositionSizer converts signals to orders which are the size of 100% of the current portfolio value

initial_risk_position_sizer.InitialRiskPositionSizer

This PositionSizer converts signals to orders using Initial Risk value that is predefined in the position sizer.

initial_risk_with_volume_position_sizer.InitialRiskWithVolumePositionSizer

Variant of initial risk position sizer, which additionally controls the target size based on the mean daily volume.

fixed_portfolio_percentage_position_sizer.FixedPortfolioPercentagePositionSizer

This PositionSizer converts signals to orders using Fixed Percentage value.

signals

signal.Signal

Objects of this class are used in the portfolio construction process.

signals_register.SignalsRegister

Used to save signals processed by the Position Sizer and to be able to later to analyze all signals generated by the model and to present them in a readable form.

backtest_signals_register.BacktestSignalsRegister

In memory implementation of Signals Register.

strategies

abstract_strategy.AbstractStrategy

Basic interface used to create a generic strategy.

alpha_model_strategy.AlphaModelStrategy

Puts together models and all settings around it and generates orders on before market open.

trading_session

trading_session.TradingSession

Base class for all Trading Sessions.

backtest_trading_session.BacktestTradingSession

Encapsulates the settings and components for carrying out a backtest session.

backtest_trading_session_builder.BacktestTradingSessionBuilder

Class used to build a Trading Session with all necessary elements, connections and dependencies.