Can I use the integer sids to construct either sid objects or to use in order* calls? This fails, for example:
for s in data.keys():
i = int(s.sid)
order(i, 50)
#order(sid(i), 50)
The first order results in an "unknown error" at build time in some contexts and in a runtime error in other contexts. The runtime error is
OrderNonSecurity: 0035 Attempt to order [6992], which is not a security. You must place orders with a Security object. You can construct a Security by calling sid(123).
The second (commented-out) invocation gives a build error "The sid(id) method takes one parameter."
Confusingly, the documentation seems to indicate the integer id and the sid can be used interchangeably, but perhaps I am misinterpreting:
All securities have a unique integer id in our system. Your algorithm can reference a security directly by its id, or use our sid method to look up a security by its id, symbol, or name. Using the sid method brings up a search box that shows you the top results for your search.
In other words, sid(24) and 24 are equivalent, and both refer to Apple.
The documentation for the order* methods seems to specifically require a sid object.
What am I doing wrong?