Пример #1
0
 protected override void OnBehaviorInit()
 {
     this.atsComponents.Clear();
     //把持仓中的证券添加到市场中来
     foreach (Position position in this.portfolio.Positions)
     {
         Instrument instrument = position.Instrument;
         this.marketManager.AddInstrument(instrument);
     }
     foreach (Instrument instrument in this.marketManager.Instruments)
     {
         this.activeInstruments.Add(instrument);
         ATSComponent aTSComponent = Activator.CreateInstance(this.atsComponent.GetType()) as ATSComponent;
         aTSComponent.StrategyBase = this;
         aTSComponent.Instrument   = instrument;
         base.SetProxyProperties(aTSComponent, this.atsComponent);
         aTSComponent.Init();
         this.atsComponents.Add(instrument, aTSComponent);
     }
 }