Hello,
when I call history(...) I receive an array of all my securities.
So what is the order? Is it the same as that one I receive when calling
for stock in data:
print stock
in the handle_data function?
Thanks very much for an hints!
Hello,
when I call history(...) I receive an array of all my securities.
So what is the order? Is it the same as that one I receive when calling
for stock in data:
print stock
in the handle_data function?
Thanks very much for an hints!
Eugen,
The columns of the history dataframe are keyed by the security id's (sid) and sorted in ascending sid order, but it looks like they are not necessarily in the same order as when looping through data. Best practice is to select columns using the securities so there is no ambiguity. I attached a simple experiment you can play with. The data sids appear to have the same ordering as context.stocks. I hope this helps, if not, let me know your specific use case and I'll do my best to help you out.
David