backtesting¶
alpha_model¶
Base class for all alpha models. |
|
Type of alpha model, which can be easily integrated with any type of Tickers (plain Ticker objects, as well as FutureTickers). |
contract¶
|
Simulated contract to ticker mapper, which should be used for backtesting purposes. |
|
IB IBContract mapper that can be used for live trading. |
data_handler¶
DataHandler is a wrapper which can be used with any AbstractPriceDataProvider in both live and backtest environment. |
|
events¶
Represents an event associated with certain date/time (e.g. |
|
TimeEvent which occurs on regular basis (e.g. |
|
Class implementing the logic for all events happening every day such as MarketOpenEvent, MarketCloseEvent etc. |
|
|
Rule which is triggered every day after market closes. |
|
Rule which is triggered every day before market opens. |
Rule which is triggered every day when the market closes. |
|
Rule which is triggered every day when the market opens. |
execution_handler¶
commission_models¶
Naive commission model which always charges the same commission. |
|
|
Commission model which uses fixed bps rate for trade value. |
Interactive Brokers commission for a transaction. |
slippage¶
Base class for slippage models. |
|
Slippage which always adds (or subtracts if short sale) certain absolute amount of money to the price. |
|
Calculates the slippage by using some fixed fraction of the current securities’ price (e.g. |
|
|
Slippage based on the square-root formula for market impact modelling. |
fast_alpha_model_tester¶
Class containing a summary of the performed backtest. |
|
ModelTester in which portfolio construction is simulated by always following the suggested Exposures from AlphaModels. |
|
Class pretending to be a DataHandler but being much faster and not protecting from the look-ahead bias (one needs to be careful). |
|
Class used for generating different scenarios for Trades. |
monitoring¶
AbstractMonitor is a class providing an interface for all inherited Monitor classes (live, historic, custom, etc). |
|
This Monitor will be used to monitor backtest run from the script. |
|
BacktestResult is a class providing simple data model containing information about the backtest: for example it contains a portfolio with its timeseries and trades. |
order¶
Creates Orders. |
|
Order generated by a strategy, then processed by PositionSizer. |
|
An enumeration. |
orders_filter¶
Adjusts final orders list to meet various requirements e.g. |
|
Verifies whether the orders sizes do not exceed the given volume limit. |
portfolio¶
Trade is a logical unit representing getting exposure to the market (long or short) finished by closing the position. |
|
Encapsulates the notion of a filled Order, as returned from a Brokerage. |
position_sizer¶
The PositionSizer abstract class converts signals to orders with size specified. |
|
This SimplePositionSizer converts signals to orders which are the size of 100% of the current portfolio value |
|
This PositionSizer converts signals to orders using Initial Risk value that is predefined in the position sizer. |
|
|
Variant of initial risk position sizer, which additionally controls the target size based on the mean daily volume. |
|
This PositionSizer converts signals to orders using Fixed Percentage value. |
signals¶
Objects of this class are used in the portfolio construction process. |
|
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. |
|
In memory implementation of Signals Register. |
strategies¶
Basic interface used to create a generic strategy. |
|
Puts together models and all settings around it and generates orders on before market open. |
|
Wrapper, which facilitates the subscription process of the Strategy to the BeforeMarketOpenEvent. |
trading_session¶
Base class for all Trading Sessions. |
|
Encapsulates the settings and components for carrying out a backtest session. |
|
|
Class used to build a Trading Session with all necessary elements, connections and dependencies. |