예제 #1
0
		protected MetaStrategyBase(string name)
		{
			this.name = name;
			this.strategies = new StrategyList();
			this.SimulationManager = StrategyComponentManager.GetComponent("GetComponent", (object)this) as SimulationManager;
			this.OptimizationManager = StrategyComponentManager.GetComponent("GetComponent", (object)this) as OptimizationManager;
			this.ReportManager = StrategyComponentManager.GetComponent("GetComponent", (object)this) as ReportManager;
			this.MetaMoneyManager = StrategyComponentManager.GetComponent("GetComponent", (object)this) as MetaMoneyManager;
			this.portfolio = PortfolioManager.Portfolios[name];
			if (this.portfolio == null)
				this.portfolio = new Portfolio(name);
			this.resetPortfolio = true;
			this.tester = new LiveTester(this.portfolio);
			this.tester.FollowChanges = true;
			this.optimizer = (Optimizer)new BruteForce((IOptimizable)this);
			this.optimizer.BestObjectiveReceived += new EventHandler(this.OnBestObjectiveReceived);
			this.optimizerType = EOptimizerType.BruteForce;
//      this.wufWtLkISI = new J8EmIiFmOtaja37OfO(this);
//      this.ftRWdJyyOv = new cLHjLO4PpuI7TxofSw(this);
//      this.XY4Ww3QE51 = new TGZcynM7UfxwdxKdmx(this);
//      this.J37WmrcrSi = new FZ0WAbPUwn6OHn5Upr(this);
//      this.zVLWf0C4Mc = new ALxag60bMZlMBTZjqL(this);
			this.wH2We9sYJA = new Dictionary<IProvider, List<StrategyBase>>();
			this.vXRWgwkIPm = new Dictionary<IMarketDataProvider, Dictionary<Instrument, List<StrategyBase>>>();
			this.DKMWNa8OX5 = new Dictionary<SingleOrder, StrategyBase>();
			this.sbiWzb0PxN = new Dictionary<IService, List<StrategyBase>>();
			this.EdxRkK8EdT = new Dictionary<IExecutionService, List<StrategyBase>>();
			this.maxConnectionTime = 10;
			this.simulator = (ProviderManager.MarketDataSimulator as SimulationDataProvider).Simulator;
			this.simulator.StateChanged += new EventHandler(this.md8Wiw2OiW);
			this.isRunning = false;
			this.isOptimizing = false;
			this.optimizationParemeters = new ArrayList();
			this.drawingPrimitives = new Hashtable();
			this.portfolioStopList = new StopList();
			this.portfolios = new Dictionary<Instrument, Portfolio>();
			this.testers = new Dictionary<Instrument, LiveTester>();
			this.executionServicesEnabled = false;
			this.componentTypeList = new List<ComponentType>();
			this.componentTypeList.Add(ComponentType.SimulationManager);
			this.componentTypeList.Add(ComponentType.MetaMoneyManager);
			this.componentTypeList.Add(ComponentType.OptimizationManager);
			this.componentTypeList.Add(ComponentType.ReportManager);
		}
예제 #2
0
		public SimulationDataProvider(string name, int id) : base()
		{
			this.Simulator = new Simulator();
			this.Simulator.Error += (e) =>
			{
				if (this.Error != null)
				{
					this.Error(new ProviderErrorEventArgs(new ProviderError(DateTime.Now, this, -1, -1, e.Exception.ToString())));
				}
			};
			this.Simulator.NewObject += new SeriesObjectEventHandler(this.HandleNewObject);
			this.Simulator.LeaveInterval += (e) =>
			{
				this.iSFyRrCNfO.Clear();
			};
	
			this.IsConnected = false;
			this.Status = ProviderStatus.Unknown;
			this.BarFactory = new BarFactory(false);
			this.z1tyr7wr0l = new Hashtable();
			this.iSFyRrCNfO = new Dictionary<long, int>();
			this.Il6yEpdoR8 = new SortedList<DateTime, SimpleDataObject>();
			ProviderManager.Add(this);
			ProviderManager.MarketDataSimulator = this;
		}