Exemplo n.º 1
0
        /// <summary>
        ///
        /// </summary>
        public bool SetInitialParameters(TradePlatformComponent manager, ComponentId sourceId,
                                         ComponentId dataSourced)
        {
            SystemMonitor.CheckError(_manager == null, "Session member already assigned.");
            _manager     = manager;
            _dataSourced = dataSourced;

            _tradeEntities.SetInitialParameters(manager, this, manager.GetDataDelivery(_dataSourced));

            SourceInfo?info = _manager.GetSourceInfo(sourceId, SourceTypeEnum.OrderExecution);

            if (info.HasValue)
            {
                return(base.SetInitialParameters(sourceId, info.Value.TransportInfo));
            }

            SystemMonitor.Warning("Failed to establish source information [" + sourceId.Print() + "]");
            return(false);
        }
Exemplo n.º 2
0
        void PlatformSourceOrderExecutionProvider_OperationalStateChangedEvent(IOperational operational, OperationalStateEnum previousOperationState)
        {
            if (OperationalState == OperationalStateEnum.Operational && _accounts.Length == 0)
            {
                if (base.SubscribeToAccounts() == false)
                {
                    SystemMonitor.Error("Failed to subscribe to source. Further operations will not proceed as expected.");
                }

                AccountInfo[] accountInfos;
                if (base.GetAvailableAccountInfos(out accountInfos) && accountInfos.Length > 0)
                {
                    lock (this)
                    {
                        _accounts = new Account[accountInfos.Length];
                        for (int i = 0; i < accountInfos.Length; i++)
                        {
                            _accounts[i] = new RemoteExecutionAccount(accountInfos[i]);
                            _accounts[i].SetInitialParameters(_manager, this, _manager.GetDataDelivery(_dataSourced));
                            _accounts[i].Initialize(this);
                        }

                        if (_accounts.Length > 0)
                        {
                            _defaultAccount = _accounts[0];
                        }
                        else
                        {
                            _defaultAccount = null;
                        }
                    }
                }
                else
                {
                    SystemMonitor.Warning("Failed to establish accounts (default account) on Order Execution Provider.");
                }
            }
        }
        /// <summary>
        /// 
        /// </summary>
        public bool SetInitialParameters(TradePlatformComponent manager, ComponentId sourceId,
            ComponentId dataSourced)
        {
            SystemMonitor.CheckError(_manager == null, "Session member already assigned.");
            _manager = manager;
            _dataSourced = dataSourced;

            _tradeEntities.SetInitialParameters(manager, this, manager.GetDataDelivery(_dataSourced));

            SourceInfo? info = _manager.GetSourceInfo(sourceId, SourceTypeEnum.OrderExecution);
            if (info.HasValue)
            {
                return base.SetInitialParameters(sourceId, info.Value.TransportInfo);
            }

            SystemMonitor.Warning("Failed to establish source information [" + sourceId.Print() + "]");
            return false;
        }