Hi,
How would I go about listing all the stocks and stock IDs in a universe summoned by:
set_universe(universe.DollarVolumeUniverse(99.9, 100.0))
Any help is greatly appreciated!
Rich
Hi,
How would I go about listing all the stocks and stock IDs in a universe summoned by:
set_universe(universe.DollarVolumeUniverse(99.9, 100.0))
Any help is greatly appreciated!
Rich
Hello Rich,
This works:
def initialize(context):
context.stocks = []
set_universe(universe.DollarVolumeUniverse(floor_percentile=20, ceiling_percentile=20.5))
def handle_data(context, data):
context.stocks = [str(sid.symbol) for sid in data]
print ', '.join(context.stocks)
However, you might run into logging limits if your list gets too long.
Grant
thanks grant! yeah, i'm seeing problems using set universe in my testing with dates prior to 2008, so this helps generate some specific sets to test with.