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(); }
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); }