Library Structure¶
There are 5 main components to QTPyLib:
Blotter
- handles market data retrieval and processing.Broker
- sends and process orders/positions (abstracted layer).Algo
- (sub-class ofBroker
) communicates with theBlotter
to pass market data to your strategies, and process/positions orders viaBroker
.Reports
- provides real-time monitoring of trades and open positions via Web App, as well as a simple REST API for trades, open positions, and market data.- Lastly, Your Strategies, which are sub-classes of
Algo
, handle the trading logic/rules and does most of its operation using theInstument API
. This is where you’ll write most of your code.
The Workflow
module is a utility module that includes a few handy methods for working with external data sources when backtesting (see the Data Workflow section for more info).
Please refer to the API Reference for a complete list of available methods.