Hi, I'm interested in building a strategy that works based on evaluating randomly-selected stock symbols, but the API doesn't seem to allow that. In particular, the data object is only prepopulated with the sids it finds at compile-time; even if I try something like this (just as a test):
def initialize(context):
context.stocks = []
while len(context.stocks) < 200:
randId = int(random.random()*30000)
context.stocks.append(sid(randId))
I get a compile-time error, "The sid(id) method takes one parameter."
I was really hoping to just have something that can buy stocks selected at random (I'm calling it a "monkey with a dartboard") and hold on to them until a certain condition happens, but it doesn't look like the Quantopian API allows for this. Do I really just need to generate a list of 200 at the outset and essentially hardcode them into my algorithm?