コード例 #1
0
        /// <summary>
        /// Creates a new universe and adds it to the algorithm. This is for coarse and fine fundamental US Equity data and
        /// will be executed on day changes in the NewYork time zone (<see cref="TimeZones.NewYork"/>
        /// </summary>
        /// <param name="coarseSelector">Defines an initial coarse selection</param>
        /// <param name="fineSelector">Defines a more detailed selection with access to more data</param>
        public void AddUniverse(Func <IEnumerable <CoarseFundamental>, IEnumerable <Symbol> > coarseSelector, Func <IEnumerable <FineFundamental>, IEnumerable <Symbol> > fineSelector)
        {
            // create a new universe for coarse fundamental data
            var coarse = new CoarseFundamentalUniverse(UniverseSettings, SecurityInitializer, coarseSelector);

            // create a new universe for fine fundamental data
            var fine = new FineFundamentalUniverse(UniverseSettings, SecurityInitializer, fineSelector);

            // wire them up such that the results from coarse will be piped into fine
            var chained = coarse.ChainedTo(fine, configurationPerSymbol: true);

            // finally add the chained universe
            AddUniverse(chained);
        }