Esempio n. 1
0
 def __init__(self, name, events_pool, settings={}):
     super(SimpleBlotter, self).__init__(name)
     self.open_orders = set()
     self.positions = {}  # Contract: Position
     self.holding = {}  # 当前的资金 dict
     self.api = SimulateTraderAPI(self, events_pool)  # 模拟交易接口
     self._all_orders = []
     self._pre_settlement = 0     # 昨日结算价
     self._datetime = None  # 当前时间
     self._all_holdings = []   # 所有时间点上的资金 list of dict
     self._all_transactions = []
     self._capital = settings['capital']