Example #1
0
 def trade_split(self, symbol, qty, price, timestamp):
     data = {"timestamp": timestamp, "qty": qty, "price": price, "id_num": 0}
     trade = Trade(data)
     if trade.timestamp > self.last_timestamp:
         self.last_timestamp = trade.timestamp
     self.last_tick = trade
     self.trades.appendleft(trade)
     if self.save_tseries:
         self.time_series[trade.timestamp] = ("T", trade)
     return trade
Example #2
0
 def trade(self, csv):
     columns = ['event', 'symbol', 'exchange', 'id_num', 'qty', 'price', 'timestamp']
     data = parse_csv(columns, csv)
     data['id_num'] = 0
     trade = Trade(data)
     if trade.timestamp > self.last_timestamp:
         self.last_timestamp = trade.timestamp
     self.last_tick = trade
     self.trades.appendleft(trade)
     return trade
Example #3
0
 def trade(self, csv):
     columns = ["event", "symbol", "exchange", "id_num", "qty", "price", "timestamp"]
     data = parse_csv(columns, csv)
     data["id_num"] = 0
     trade = Trade(data)
     if trade.timestamp > self.last_timestamp:
         self.last_timestamp = trade.timestamp
     self.last_tick = trade
     self.trades.appendleft(trade)
     if self.save_tseries:
         self.time_series[trade.timestamp] = ("T", trade)
     return trade
Example #4
0
 def trade_split(self, symbol, qty, price, timestamp):
     data = {
         'timestamp': timestamp,
         'qty': qty,
         'price': price,
         'id_num': 0
     }
     trade = Trade(data)
     if trade.timestamp > self.last_timestamp:
         self.last_timestamp = trade.timestamp
     self.last_tick = trade
     self.trades.appendleft(trade)
     return trade
Example #5
0
 def trade(self, csv):
     columns = [
         'Record_ind', 'segment', 'order_no', 'quote_tm', 'buysell',
         'activity_typ', 'symbol', 'series', 'vol_disc', 'vol_orgnl',
         'limit_prc', 'price_trig', 'mkt_ord_flg', 'StLoss_I', 'Io_flag',
         'Algo_Ind'
     ]
     data = parse_csv(columns, csv)
     data['order_no'] = 0
     trade = Trade(data)
     if trade.timestamp > self.last_timestamp:
         self.last_timestamp = trade.timestamp
     self.last_tick = trade
     self.trades.appendleft(trade)
     return trade