Inheritance: FastQuant.SellSideInstrumentStrategy
Esempio n. 1
0
        public override void Run()
        {
            Strategy metaStrategy = new Strategy(framework, "MetaStrategy");

            Instrument instrument1 = InstrumentManager.Instruments["CSCO"];
            Instrument instrument2 = InstrumentManager.Instruments["MSFT"];

            MyStrategy strategy = new MyStrategy(framework, "BuySell");

            strategy.Instruments.Add(instrument1);
            strategy.Instruments.Add(instrument2);

            VWAP_SellSide sellSideStrategy = new VWAP_SellSide(framework, "VWAP SellSide");

            strategy.ExecutionProvider = sellSideStrategy;
            strategy.DataProvider      = sellSideStrategy;

            DataSimulator.DateTime1 = new DateTime(2013, 12, 01);
            DataSimulator.DateTime2 = new DateTime(2013, 12, 31);

            BarFactory.Add(instrument1, BarType.Time, 60);
            BarFactory.Add(instrument2, BarType.Time, 60);

            metaStrategy.AddStrategy(strategy);
            metaStrategy.AddStrategy(sellSideStrategy);

            this.strategy = metaStrategy;

            StartStrategy();
        }
Esempio n. 2
0
        public override void Run()
        {
            Strategy metaStrategy = new Strategy(framework, "MetaStrategy");

            Instrument instrument1 = InstrumentManager.Instruments["CSCO"];
            Instrument instrument2 = InstrumentManager.Instruments["MSFT"];

            MyStrategy strategy = new MyStrategy(framework, "BuySell");

            strategy.Instruments.Add(instrument1);
            strategy.Instruments.Add(instrument2);

            VWAP_SellSide sellSideStrategy = new VWAP_SellSide(framework, "VWAP SellSide");

            strategy.ExecutionProvider = sellSideStrategy;
            strategy.DataProvider = sellSideStrategy;

            DataSimulator.DateTime1 = new DateTime(2013, 12, 01);
            DataSimulator.DateTime2 = new DateTime(2013, 12, 31);

            BarFactory.Add(instrument1, BarType.Time, 60);
            BarFactory.Add(instrument2, BarType.Time, 60);

            metaStrategy.AddStrategy(strategy);
            metaStrategy.AddStrategy(sellSideStrategy);

            this.strategy = metaStrategy;

            StartStrategy();
        }