Beispiel #1
0
 def from_ohlcs(self, ohlcs, price_type):
     """Set prices using a list of ohlc classes."""
     dfs = []
     for ohlc in ohlcs:
         df = DataFrame(getattr(ohlc, price_type),
                        posix_as_dt(ohlc.timestamps))
         dfs.append(df)
     prices = concat(dfs, join='outer', axis=1)
     prices.columns = [ohlc.symbol for ohlc in ohlcs]
     return prices.fillna(method='pad')
Beispiel #2
0
 def datetimes(self):
     """Get datetimes of posix timestamps."""
     return cv.posix_as_dt(self.timestamps)