Example #1
0
        public override void Initialize()
        {
            SetStartDate(2013, 10, 07);
            SetEndDate(2013, 10, 11);

            // even though we're using a framework algorithm, we can still add our securities
            // using the AddEquity/Forex/Crypto/ect methods and then pass them into a manual
            // universe selection model using Securities.Keys
            AddEquity("SPY");
            AddEquity("IBM");
            AddEquity("BAC");
            AddEquity("AIG");

            // define a manual universe of all the securities we manually registered
            UniverseSelection = new ManualUniverseSelectionModel(Securities.Keys);

            // define alpha model as a composite of the rsi and ema cross models
            Alpha = new CompositeAlphaModel(
                new RsiAlphaModel(),
                new EmaCrossAlphaModel()
                );

            // default models for the rest
            PortfolioConstruction = new EqualWeightingPortfolioConstructionModel();
            Execution             = new ImmediateExecutionModel();
            RiskManagement        = new NullRiskManagementModel();
        }
Example #2
0
        public override void Initialize()
        {
            SetStartDate(2013, 10, 07);
            SetEndDate(2013, 10, 11);

            var bac = AddEquity("BAC");
            var aig = AddEquity("AIG");

            UniverseSelection     = new ManualUniverseSelectionModel(Securities.Keys);
            Alpha                 = new PairsTradingAlphaModel(bac.Symbol, aig.Symbol);
            PortfolioConstruction = new EqualWeightingPortfolioConstructionModel();
            Execution             = new ImmediateExecutionModel();
            RiskManagement        = new NullRiskManagementModel();
        }