예제 #1
0
        public override void SetComponent(ComponentType type, IComponentBase component)
        {
            switch (type)
            {
            case ComponentType.CrossEntry:
                this.CrossEntry = component as CrossEntry;
                break;

            case ComponentType.CrossExit:
                this.CrossExit = component as CrossExit;
                break;

            case ComponentType.MarketManager:
                this.MarketManager = component as MarketManager;
                break;

            case ComponentType.ReportManager:
                this.ReportManager = component as ReportManager;
                break;

            case ComponentType.MoneyManager:
                this.MoneyManager = component as MoneyManager;
                break;

            case ComponentType.RiskManager:
                this.RiskManager = component as RiskManager;
                break;

            case ComponentType.Entry:
                this.Entry = component as Entry;
                break;

            case ComponentType.Exit:
                this.Exit = component as Exit;
                break;

            case ComponentType.ExposureManager:
                this.ExposureManager = component as ExposureManager;
                break;

            default:
                throw new InvalidOperationException();
            }
        }
예제 #2
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);
 }
예제 #3
0
파일: Strategy.cs 프로젝트: heber/FreeOQ
 public override void SetComponent(ComponentType type, IComponentBase component)
 {
   switch (type)
   {
     case ComponentType.CrossEntry:
       this.CrossEntry = component as CrossEntry;
       break;
     case ComponentType.CrossExit:
       this.CrossExit = component as CrossExit;
       break;
     case ComponentType.MarketManager:
       this.MarketManager = component as MarketManager;
       break;
     case ComponentType.ReportManager:
       this.ReportManager = component as ReportManager;
       break;
     case ComponentType.MoneyManager:
       this.MoneyManager = component as MoneyManager;
       break;
     case ComponentType.RiskManager:
       this.RiskManager = component as RiskManager;
       break;
     case ComponentType.Entry:
       this.Entry = component as Entry;
       break;
     case ComponentType.Exit:
       this.Exit = component as Exit;
       break;
     case ComponentType.ExposureManager:
       this.ExposureManager = component as ExposureManager;
       break;
     default:
       throw new InvalidOperationException();
   }
 }
예제 #4
0
파일: Strategy.cs 프로젝트: heber/FreeOQ
    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);
    }