예제 #1
0
        private void ProviderEventHappened(XProvider s, XProviderEventType type)
        {
            switch (type)
            {
            case XProviderEventType.TraderCreated:
                LoadPositions();
                break;

            case XProviderEventType.ConnectDone:
                break;

            case XProviderEventType.DisconnectDone:
                break;

            case XProviderEventType.AutoDisconnect:
                break;

            default:
                _logger.Debug($"{AgentId}, status={type}");
                TradingStatus = type;
                var reminder = new Reminder(OnMarketStatusEvent, DateTime.Now, type);
                reminder.SetClock(_eventClock);
                _eventQueue.Enqueue(reminder);
                break;
            }
        }
예제 #2
0
        private void AddProviderEventReminder(XProviderEventType type)
        {
            _logger.Debug($"{AgentId}, status={type}");
            TradingStatus = type;
            var reminder = new Reminder(OnMarketStatusEvent, DateTime.Now, type);

            reminder.SetClock(_eventClock);
            _eventQueue.Enqueue(reminder);
        }
예제 #3
0
        private void ProviderEventHappened(XProvider s, XProviderEventType type)
        {
            switch (type)
            {
            case XProviderEventType.ConnectDone:
                InitProcessor();
                break;

            case XProviderEventType.DisconnectDone:
                break;

            case XProviderEventType.AutoDisconnect:
                break;

            case XProviderEventType.TraderCreated:
                break;

            default:
                AddProviderEventReminder(type);
                break;
            }
        }