@run-out Apparently the best way is to loop thru columns and reconstruct the ohlc dataframe per symbol and subsequently append them to datas? Thanks.
Latest posts made by gstrader
-
RE: datafeeds with cross-section OHCL data
-
datafeeds with cross-section OHCL data
Hi, all,
Is there to derive a feed from existing structure to support loading data from multiple dataframes, say 4 dataframes of open, high, low, close. Each DF has an index of dates and columns of various stocks? mach appreciated!
-
RE: order price is None
@vladisld In that case, what would be the default order price set for order_target_percent? Is it the next available bar (Open price)? And under what circumstance it's set to NA? Thanks!
-
order price is None
I used the following order logic in the next function, but in notify_order I got None order price in completed orders, did I miss sth. here? Thanks for your help!
self.order_target_percent(d, target=weights[i])
def notify_order(self, order):
date = self.data.datetime.datetime().date()if order.status == order.Completed: print('{} >> Order Completed >> Stock: {}, Ref: {}, Size: {}, Price: {}'. format(date, order.data._name, order.ref, order.size, 'NA' if not order.price else round(order.price, 5) ))
-
Build a datafeed with multi-index OHLC dataframe
Is there a way to build a datafeed with multi-index OHLC dataframe inputs, such as (date, symbol) as the index, and OHLCV as the columns? Thanks!