public void Start(Strategy strategy, StrategyMode mode) { if (this.Status != StrategyStatus.Running) { this.strategy__0 = strategy; this.Mode = mode; this.method_39(StrategyStatusType.Started); this.method_40(); if (this.Persistence != StrategyPersistence.Full) { if (this.Persistence != StrategyPersistence.Save) { this.framework.orderManager_0.bool_0 = false; goto IL_74; } } this.framework.orderServer_0.SeriesName = strategy.Name; this.framework.orderManager_0.bool_0 = true; IL_74: if (this.Persistence == StrategyPersistence.Full || this.Persistence == StrategyPersistence.Load) { this.framework.portfolioManager_0.Load(strategy.Name); this.framework.orderManager_0.Load(strategy.Name, -1); } this.Status = StrategyStatus.Running; if (mode == StrategyMode.Backtest && !this.framework.bool_6) { this.framework.providerManager_0.idataSimulator_0.RunOnSubscribe = false; } strategy.icojrGfcqNm(); if ((this.Persistence == StrategyPersistence.Full || this.Persistence == StrategyPersistence.Save) && !strategy.Portfolio.iEcAijqtwI) { this.framework.portfolioManager_0.Save(strategy.Portfolio); } strategy.vmethod_0(mode); if (mode == StrategyMode.Backtest && !this.framework.bool_6) { this.framework.providerManager_0.idataSimulator_0.Run(); this.framework.providerManager_0.idataSimulator_0.RunOnSubscribe = true; } } }
internal void method_5(Strategy strategy__1) { if (strategy__1.Parent != null) { Console.WriteLine("Strategy::Add Can not add a startegy that already has a parent " + strategy__1); return; } if (strategy__1.Id == -1) { strategy__1.Id = StrategyManager.GetNextId(); } strategy__1.Parent = this; this.Strategies.Add(strategy__1); if (this.Status == StrategyStatus.Running) { strategy__1.icojrGfcqNm(); strategy__1.vmethod_0(this.Mode); } }