|
Apex Options
|
Public Member Functions | |
| def | __init__ (self, days, verbose=False) |
| def | get_all_orders (self) |
| pd.DataFrame | historical_positions (self, final_day) |
| pd.DataFrame | historical_pnl (self, final_day) |
| def | add_order (self, Order order) |
| def | orders_by_day (self, Union[str, pd.Timestamp, datetime] day) |
| def | orders_by_status (self, order_status status) |
| def | orders_by_tif (self, time_in_force tif) |
| def | orders_by_security (self, Tradeable security) |
| def | orders_by_tag (self, str tag) |
Public Attributes | |
| verbose | |
| days | |
Holds orders and positions. Creates several sets, so that it is fast to look up lists of orders. Also handles orders and executions. O(1) order retrieval. O(1) order status list. Etc.
| def order_book.OrderBook.__init__ | ( | self, | |
| days, | |||
verbose = False |
|||
| ) |
Basic initialization
| def order_book.OrderBook.add_order | ( | self, | |
| Order | order | ||
| ) |
Adds order to book.
| def order_book.OrderBook.get_all_orders | ( | self | ) |
Returns all orders.
| pd.DataFrame order_book.OrderBook.historical_pnl | ( | self, | |
| final_day | |||
| ) |
Returns pnl of book by security. It does in two steps: first the diffs. Then it goes through every order and computes the account flows per day.
| pd.DataFrame order_book.OrderBook.historical_positions | ( | self, | |
| final_day | |||
| ) |
Returns historical positions for this trading book. It returns a dataframe with index equal to days, columns equal to securities, and values equal to security weights at that date.
| def order_book.OrderBook.orders_by_security | ( | self, | |
| Tradeable | security | ||
| ) |
Returns orders by TIF
| def order_book.OrderBook.orders_by_status | ( | self, | |
| order_status | status | ||
| ) |
Returns orders by status
| def order_book.OrderBook.orders_by_tag | ( | self, | |
| str | tag | ||
| ) |
Returns orders by TIF
| def order_book.OrderBook.orders_by_tif | ( | self, | |
| time_in_force | tif | ||
| ) |
Returns orders by TIF
1.8.15