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
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
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
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
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