Exemple #1
0
 protected StrategyBase(string name, string description)
 {
     this.metaStrategyBase = (MetaStrategyBase)null;
     this.name             = name;
     this.description      = description;
     this.isEnabled        = true;
     this.isActive         = true;
     this.ReportManager    = StrategyComponentManager.GetComponent("getcom", (object)this) as ReportManager;
     this.MarketManager    = StrategyComponentManager.GetComponent("getcom", (object)this) as MarketManager;
     this.portfolio        = PortfolioManager.Portfolios[name];
     if (this.portfolio == null)
     {
         this.portfolio = new Portfolio(name);
     }
     this.tester             = new LiveTester(this.portfolio);
     this.stops              = new StopList();
     this.triggers           = new TriggerList();
     this.marketDataProvider = (IMarketDataProvider)null;
     this.executionProvider  = (IExecutionProvider)null;
     this.newsProvider       = (INewsProvider)null;
     this.executionService   = (IExecutionService)null;
     this.orders             = new OrderTable();
     this.global             = new Hashtable();
     this.activeInstruments  = new InstrumentList();
     this.barSliceManager    = new BarSliceManager();
     this.componentTypeList  = new List <ComponentType>();
     this.componentTypeList.Add(ComponentType.MarketManager);
     this.componentTypeList.Add(ComponentType.ReportManager);
     this.activeStops = new Dictionary <Instrument, List <StopBase> >();
     this.portfolios  = new Dictionary <Instrument, Portfolio>();
     this.testers     = new Dictionary <Instrument, LiveTester>();
     this.statisticsPerInstrumentEnabled = false;
 }
Exemple #2
0
    protected StrategyBase(string name, string description)
    {
      this.metaStrategyBase = (MetaStrategyBase) null;
      this.name = name;
      this.description = description;
      this.isEnabled = true;
      this.isActive = true;
			this.ReportManager = StrategyComponentManager.GetComponent("getcom", (object) this) as ReportManager;
			this.MarketManager = StrategyComponentManager.GetComponent("getcom", (object) this) as MarketManager;
      this.portfolio = PortfolioManager.Portfolios[name];
      if (this.portfolio == null)
        this.portfolio = new Portfolio(name);
      this.tester = new LiveTester(this.portfolio);
      this.stops = new StopList();
      this.triggers = new TriggerList();
      this.marketDataProvider = (IMarketDataProvider) null;
      this.executionProvider = (IExecutionProvider) null;
      this.newsProvider = (INewsProvider) null;
      this.executionService = (IExecutionService) null;
      this.orders = new OrderTable();
      this.global = new Hashtable();
      this.activeInstruments = new InstrumentList();
      this.barSliceManager = new BarSliceManager();
      this.componentTypeList = new List<ComponentType>();
      this.componentTypeList.Add(ComponentType.MarketManager);
      this.componentTypeList.Add(ComponentType.ReportManager);
      this.activeStops = new Dictionary<Instrument, List<StopBase>>();
      this.portfolios = new Dictionary<Instrument, Portfolio>();
      this.testers = new Dictionary<Instrument, LiveTester>();
      this.statisticsPerInstrumentEnabled = false;
    }
Exemple #3
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);
		}