Пример #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;
 }
Пример #2
0
 public ATSStrategy(string name, string description)
     : base(name, description)
 {
     this.ATSCrossComponent = StrategyComponentManager.GetComponent("componentname", this) as ATSCrossComponent;
     this.ATSComponent      = StrategyComponentManager.GetComponent("componentname", this) as ATSComponent;
     this.csNiLdTRqH        = new Dictionary <Instrument, ATSComponent>();
     this.componentTypeList.Add(ComponentType.ATSComponent);
     this.componentTypeList.Add(ComponentType.ATSCrossComponent);
 }
Пример #3
0
        public static IComponentBase GetDefaultComponent(ComponentType type, object issuer)
        {
            switch (type)
            {
            case ComponentType.CrossEntry:
                return(StrategyComponentManager.GetComponent("getCom", issuer));

            case ComponentType.ATSCrossComponent:
                return(StrategyComponentManager.GetComponent("getCom", issuer));

            case ComponentType.ReportManager:
                return(StrategyComponentManager.GetComponent("getCom", issuer));

            case ComponentType.ATSComponent:
                return(StrategyComponentManager.GetComponent("getCom", issuer));

            case ComponentType.MetaMoneyManager:
                return(StrategyComponentManager.GetComponent("getCom", issuer));

            case ComponentType.MetaRiskManager:
                return(StrategyComponentManager.GetComponent("getCom", issuer));

            case ComponentType.SimulationManager:
                return(StrategyComponentManager.GetComponent("getCom", issuer));

            case ComponentType.ExecutionManager:
                return(StrategyComponentManager.GetComponent("getCom", issuer));

            case ComponentType.OptimizationManager:
                return(StrategyComponentManager.GetComponent("getCom", issuer));

            case ComponentType.MetaExposureManager:
                return(StrategyComponentManager.GetComponent("getCom", issuer));

            case ComponentType.RiskManager:
                return(StrategyComponentManager.GetComponent("getCom", issuer));

            case ComponentType.MarketManager:
                return(StrategyComponentManager.GetComponent("getCom", issuer));

            case ComponentType.Entry:
                return(StrategyComponentManager.GetComponent("getCom", issuer));

            case ComponentType.Exit:
                return(StrategyComponentManager.GetComponent("getCom", issuer));

            case ComponentType.ExposureManager:
                return(StrategyComponentManager.GetComponent("getCom", issuer));

            case ComponentType.MoneyManager:
                return(StrategyComponentManager.GetComponent("getCom", issuer));

            default:
                return((IComponentBase)null);
            }
        }
Пример #4
0
 public MetaStrategy(string name) : base(name)
 {
     this.MetaExposureManager = StrategyComponentManager.GetComponent("GetComponent", (object)this) as MetaExposureManager;
     this.ExecutionManager    = StrategyComponentManager.GetComponent("GetComponent", (object)this) as ExecutionManager;
     this.MetaRiskManager     = StrategyComponentManager.GetComponent("GetComponent", (object)this) as MetaRiskManager;
     this.aNKR2wRnBL          = new SignalList();
     this.componentTypeList.Add(ComponentType.MetaRiskManager);
     this.componentTypeList.Add(ComponentType.MetaExposureManager);
     this.componentTypeList.Add(ComponentType.ExecutionManager);
 }
Пример #5
0
 public Strategy(string name, string description)
     : base(name, description)
 {
     this.CrossExit       = StrategyComponentManager.GetComponent("GetComponent", (object)this) as CrossExit;
     this.CrossEntry      = StrategyComponentManager.GetComponent("GetComponent", (object)this) as CrossEntry;
     this.Entry           = StrategyComponentManager.GetComponent("GetComponent", (object)this) as Entry;
     this.Exit            = StrategyComponentManager.GetComponent("GetComponent", (object)this) as Exit;
     this.MoneyManager    = StrategyComponentManager.GetComponent("GetComponent", (object)this) as MoneyManager;
     this.RiskManager     = StrategyComponentManager.GetComponent("GetComponent", (object)this) as RiskManager;
     this.ExposureManager = StrategyComponentManager.GetComponent("GetComponent", (object)this) as ExposureManager;
     this.entries         = new Dictionary <Instrument, Entry>();
     this.exits           = new Dictionary <Instrument, Exit>();
     this.moneyManagers   = new Dictionary <Instrument, MoneyManager>();
     this.riskManagers    = new Dictionary <Instrument, RiskManager>();
     this.componentTypeList.Add(ComponentType.Entry);
     this.componentTypeList.Add(ComponentType.Exit);
     this.componentTypeList.Add(ComponentType.CrossEntry);
     this.componentTypeList.Add(ComponentType.CrossExit);
     this.componentTypeList.Add(ComponentType.RiskManager);
     this.componentTypeList.Add(ComponentType.MoneyManager);
     this.componentTypeList.Add(ComponentType.ExposureManager);
 }
Пример #6
0
 public static IComponentBase GetComponent(string guid, object issuer)
 {
     return(StrategyComponentManager.GetComponent(new Guid(guid), issuer));
 }