コード例 #1
0
 public ServerBlackwood(TLServer tls)
 {
     tl = tls;
     // broker stuff
     m_Session = new BWSession();
     m_Session.OnAccountMessage += new BWSession.AccountMessageHandler(m_Session_OnAccountMessage);
     //m_Session.OnNYSEImbalanceMessage += new BWSession.NYSEImbalanceMessageHandler(m_Session_OnNYSEImbalanceMessage);
     m_Session.OnExecutionMessage += new BWSession.ExecutionMessageHandler(m_Session_OnExecutionMessage);
     //m_Session.OnOrderMessage += new BWSession.OrderMessageHandler(m_Session_OnOrderMessage);
     m_Session.OnPositionMessage += new BWSession.PositionMessageHandler(m_Session_OnPositionMessage);
     m_Session.OnHistMessage += new BWSession.HistoricMessageHandler(m_Session_OnHistMessage);
     m_Session.OnTimeMessage += new BWSession.TimeMessageHandler(m_Session_OnTimeMessage);
     // tradelink stuff
     tl.newProviderName = Providers.Blackwood;
     tl.newAcctRequest += new StringDelegate(ServerBlackwood_newAccountRequest);
     tl.newUnknownRequest += new UnknownMessageDelegate(ServerBlackwood_newUnknownRequest);
     tl.newFeatureRequest += new MessageArrayDelegate(ServerBlackwood_newFeatureRequest);
     tl.newOrderCancelRequest += new LongDelegate(ServerBlackwood_newOrderCancelRequest);
     tl.newSendOrderRequest += new OrderDelegateStatus(ServerBlackwood_newSendOrderRequest);
     tl.newRegisterSymbols += new SymbolRegisterDel(tl_newRegisterSymbols);
     tl.newPosList += new PositionArrayDelegate(ServerBlackwood_newPosList);
     //tl.newImbalanceRequest += new VoidDelegate(ServerBlackwood_tl.newImbalanceRequest);
     //DOMRequest += new IntDelegate(ServerBlackwood_DOMRequest);
     
     
 }
        /// <summary>
        /// Invoked when a change in connection occurs
        /// </summary>
        private void InternetConnectionStatusChanged(object sender, NetworkAvailabilityEventArgs e)
        {
            try
            {
                if (!e.IsAvailable)
                {
                    // Raise Logout Event
                    if (LogoutArrived != null)
                    {
                        LogoutArrived(_marketDataProviderName);
                    }

                    // Unhook Blackwood events
                    RegisterBlackWoodEvents(false);

                    // Notify connection loss
                    ConnectionErrorNotification();
                }

                else
                {
                    // End Blackwood Session
                    _session = null;

                    // Restart Blackwood Session
                    Start();
                }
            }
            catch (Exception exception)
            {
                Logger.Error(exception, _type.FullName, "InternetConnectionStatusChanged");
            }
        }
コード例 #3
0
        /// <summary>
        /// Arguement Constructor
        /// </summary>
        /// <param name="session">Blackwood Session</param>
        /// <param name="parameters">Parameters required for maintaining connection</param>
        public BlackwoodOrderExecutionProvider(BWSession session, ConnectionParameters parameters)
        {
            _session    = session;
            _parameters = parameters;

            // Initialize
            _bwOrders                  = new ConcurrentDictionary <string, BWOrder>();
            _locateOrders              = new ConcurrentDictionary <string, BWOrder>();
            _localToBlackwoodIdsMap    = new ConcurrentDictionary <string, string>();
            _locateOrdersToLocalIdsMap = new ConcurrentDictionary <string, string>();
        }
コード例 #4
0
 public ServerBlackwood(TLServer tls)
 {
     tl = tls;
     // broker stuff
     m_Session = new BWSession();
     m_Session.OnAccountMessage += new BWSession.AccountMessageHandler(m_Session_OnAccountMessage);
     //m_Session.OnNYSEImbalanceMessage += new BWSession.NYSEImbalanceMessageHandler(m_Session_OnNYSEImbalanceMessage);
     m_Session.OnExecutionMessage += new BWSession.ExecutionMessageHandler(m_Session_OnExecutionMessage);
     //m_Session.OnOrderMessage += new BWSession.OrderMessageHandler(m_Session_OnOrderMessage);
     m_Session.OnPositionMessage += new BWSession.PositionMessageHandler(m_Session_OnPositionMessage);
     m_Session.OnHistMessage     += new BWSession.HistoricMessageHandler(m_Session_OnHistMessage);
     m_Session.OnTimeMessage     += new BWSession.TimeMessageHandler(m_Session_OnTimeMessage);
     // tradelink stuff
     tl.newProviderName        = Providers.Blackwood;
     tl.newAcctRequest        += new StringDelegate(ServerBlackwood_newAccountRequest);
     tl.newUnknownRequest     += new UnknownMessageDelegate(ServerBlackwood_newUnknownRequest);
     tl.newFeatureRequest     += new MessageArrayDelegate(ServerBlackwood_newFeatureRequest);
     tl.newOrderCancelRequest += new LongDelegate(ServerBlackwood_newOrderCancelRequest);
     tl.newSendOrderRequest   += new OrderDelegateStatus(ServerBlackwood_newSendOrderRequest);
     tl.newRegisterSymbols    += new SymbolRegisterDel(tl_newRegisterSymbols);
     tl.newPosList            += new PositionArrayDelegate(ServerBlackwood_newPosList);
     //tl.newImbalanceRequest += new VoidDelegate(ServerBlackwood_tl.newImbalanceRequest);
     //DOMRequest += new IntDelegate(ServerBlackwood_DOMRequest);
 }
 /// <summary>
 /// Argument Constructor
 /// </summary>
 /// <param name="session">Blackwood Session</param>
 /// <param name="parameters">Parameters required for maintaining connection</param>
 public BlackwoodMarketDataProvider(BWSession session, ConnectionParameters parameters)
 {
     _session    = session;
     _parameters = parameters;
 }