예제 #1
0
 public ModuleFramework(IUnityContainer container, IRegionManager regionManager, IEventAggregator eventAggregator, 
     IQuoteUpdateService quoteserviceupdate, IStrategyQuoteFeedService feedstrategyservice, ILoggerFacade logger)
 {
     this._container = container;
     this._regionManager = regionManager;
     this._eventAggregator = eventAggregator;
     this._logger = logger;
     this._quoteupdateservice = quoteserviceupdate;
     this._feedstrategyservice = feedstrategyservice;
     this._configmanagerservice = ServiceLocator.Current.GetInstance<IConfigManager>() as ConfigManager;
     this._globalidservice = ServiceLocator.Current.GetInstance<IGlobalIdService>();
 }
        public OrderAndPositionViewModel()
        {
            _eventaggregator = ServiceLocator.Current.GetInstance<EventAggregator>();
            _logger = ServiceLocator.Current.GetInstance<ILoggerFacade>();
            _configmanager = ServiceLocator.Current.GetInstance<IConfigManager>() as ConfigManager;

            _ordertracker = new OrderTracker(_configmanager.DailyOrderCapacity);
            _ordertracker.SendDebugEvent += OnDebug;
            _positiontracker = new PositionTracker(_configmanager.DailyOrderCapacity);

            _eventaggregator.GetEvent<InitialPositionEvent>().Subscribe(ClientGotInitialPosition);
            //_eventaggregator.GetEvent<SendOrderEvent>().Subscribe(ClientGotOrder);
            _eventaggregator.GetEvent<OrderConfirmationEvent>().Subscribe(ClientGotOrder);
            _eventaggregator.GetEvent<OrderCancelConfirmationEvent>().Subscribe(ClientGotOrderCancelConfirmation);
            _eventaggregator.GetEvent<OrderFillEvent>().Subscribe(ClientGotOrderFilled);
            _eventaggregator.GetEvent<GenerateReportEvent>().Subscribe(GeneratePerformanceReport);

            _resultstable.Columns.Add("Statistics");
            _resultstable.Columns.Add("Result");
        }
예제 #3
0
 public void LoadConfig()
 {
     _config = ConfigManager.Deserialize(_rootpath + "\\Config\\mainsettings.xml");
 }
예제 #4
0
 public static void SaveConfig(ConfigManager config)
 {
     ConfigManager.Serialize(config, @"c:\quanttrading\config\mainsettings.xml");
 }