public void AddInstance(Instrument instrument, InstrumentStrategy strategy)
 {
     strategy.Instrument = instrument;
     strategy.Instruments.Add(instrument);
     strategy.Portfolio.GetOrCreatePosition(instrument);
     strategy.raiseEvents = true;
     strategy.SetRawDataProvider(this.rawDataProvider);
     strategy.SetRawExecutionProvider(this.rawExecutionProvider);
     InsertStrategy(strategy);
     if (Instruments.GetById(instrument.Id) == null)
     {
         Instruments.Add(instrument);
     }
     strategy.Status = StrategyStatus.Running;
     strategy.OnStrategyInit();
     strategy.OnStrategyStart();
 }
Exemplo n.º 2
0
 public void AddInstance(Instrument instrument, InstrumentStrategy strategy)
 {
     strategy.Instrument = instrument;
     strategy.Instruments.Add(instrument);
     strategy.Portfolio.GetOrCreatePosition(instrument);
     strategy.raiseEvents = true;
     strategy.SetRawDataProvider(this.rawDataProvider);
     strategy.SetRawExecutionProvider(this.rawExecutionProvider);
     InsertStrategy(strategy);
     if (Instruments.GetById(instrument.Id) == null)
         Instruments.Add(instrument);
     strategy.Status = StrategyStatus.Running;
     strategy.OnStrategyInit();
     strategy.OnStrategyStart();
 }
 private void InsertStrategy(InstrumentStrategy strategy)
 {
     AddStrategy(strategy, false);
 }
Exemplo n.º 4
0
 private void InsertStrategy(InstrumentStrategy strategy)
 {
     AddStrategy(strategy, false);
 }