Hi,
I have a rookie question on the use of the dictionary (for data especially), as I am getting up to speed with Python language.
Let's say I defined my universe of stocks in my algorithm (via set_universe or by adding some stocks manually using sids.
Is there a difference between the following lines of codes?
1)
'''
for s in data:
order(s,10)
'''
2)
'''
context.sids = data.keys()
for s in context.sids
order(s,10)
'''
In other words, when using a dictionary, do we need to specify that the variable we are using is a key or is it automatic when iterating?
My second question, related to set_universe, is how to exclude some stocks from the set_universe.
For example the 98/100 universe would include VXX etf, which arguably I would not treat like other stocks etf. Can I remove specific side from my universe?
Thanks for your help
Vincent