OrderManager class

The purpose of the order manager is to gather the orders from all the trading strategies and to communicate this order with the market. It will check the validity of the orders and can also keep track of the overall positions and PnL. It can be a safeguard against mistakes introduced in trading strategies.

This component is the interface between the trading strategies and the market. It will be the only component using two inputs and two outputs. The constructor of this class will take four arguments representing these channels:

class OrderManager:     def __init__(self,ts_2_om = None, om_2_ts = None,                  om_2_gw=None,gw_2_om=None):         self.orders=[]         self.order_id=0         self.ts_2_om = ts_2_om         self.om_2_gw = om_2_gw self.gw_2_om = gw_2_om ...

Get Learn Algorithmic Trading now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.