Hi,

For my first QC project I want to use AddUniverse Coarse Selection and some indicators (sma & Bollinger Bands) on the selected securities.  Daily Resolution only.

1) To do this: in OnData(), foreach security passed in, I construct a new Indicator object for it, and update with historical data.  Is this approach correct?  I can't construct the Indicator objects in Initialize() as we don't know which securities will be selected.

2) The SMA seems to work, but I get a "runtime error: Number Overflow" for the Bollinger Bands.

3) Other questions for the Coarse Selection:

a) I am selecting the top 5 securities by Dollar Volume, but OnData() is called for 4-7 securities daily.

   Why are 4-7 securities returned when 5 specified?  MinimumTimeInUniverse is set to 1 day.  Do several securities have equal DollarVolume values?  I want to make sure that I'm specifying this correctly - with top N securities specified, then N are returned (..or approximately N is OK). 

b) The Coarse Selection returns a lot of ETF, I only want equities.  Can I remove/ignore the ETFs, either in the Coarse Selection or in OnData()?

   I may also want to ignore ADRs, B class shares and LCs/LLPs.  Can I get the full security name (e.g.: 'BERKSHIRE HATHAWAY CLASS B', 'SEADRILL PARTNERS LLC') from within OnData() ?

Thanks,

  Roger

 

 

Author