示例#1
0
        public void handleDailyReset(AppTimeEvent timeEvent)
        {
            ConcurrentDictionary <String, String> stgNamesMap = stgManager.getActiveStgNamesMap();

            stgNamesMap.Keys.ToArray();
            IAppEventManager eventManager = stgManager.getAppEventManager();

            foreach (String name in stgNamesMap.Keys)
            {
                eventManager.storeEventQueue[name].Add(new AppDailyResetEvent());
            }
            stgManager.dailyReset();
        }
        public override void UpdateUI(IBMessage message)
        {
            IAppMDManager     appMDMManager   = appStrategyManager.getAppMDManager();
            IAppEventManager  appEventManager = appStrategyManager.getAppEventManager();
            MarketDataMessage dataMessage     = (MarketDataMessage)message;

            checkToAddRow(dataMessage.RequestId);
            DataGridView grid = (DataGridView)uiControl;

            if (grid.Rows.Count >= dataMessage.RequestId - TICK_ID_BASE)
            {
                if (message is TickPriceMessage)
                {
                    TickPriceMessage priceMessage = (TickPriceMessage)message;
                    switch (dataMessage.Field)
                    {
                    case 1:
                    {
                        //BID
                        appEventManager.putTickPriceEvents(priceMessage, dataMessage);
                        //stgManager.handleTickMessage(message);
                        grid[BID_PRICE_INDEX, GetIndex(dataMessage.RequestId)].Value = priceMessage.Price;
                        break;
                    }

                    case 2:
                    {
                        //ASK
                        appEventManager.putTickPriceEvents(priceMessage, dataMessage);
                        //stgManager.handleTickMessage(message);
                        grid[ASK_PRICE_INDEX, GetIndex(dataMessage.RequestId)].Value = priceMessage.Price;
                        break;
                    }

                    case 4:
                    {
                        //LAST
                        appEventManager.putTickPriceEvents(priceMessage, dataMessage);
                        //stgManager.handleTickMessage(message);
                        grid[LAST_PRICE_INDEX, GetIndex(dataMessage.RequestId)].Value = priceMessage.Price;
                        break;
                    }

                    case 6:
                    {
                        //HIGH
                        grid[HIGH_PRICE_INDEX, GetIndex(dataMessage.RequestId)].Value = priceMessage.Price;
                        break;
                    }

                    case 7:
                    {
                        //LOW
                        grid[LOW_PRICE_INDEX, GetIndex(dataMessage.RequestId)].Value = priceMessage.Price;
                        break;
                    }

                    case 9:
                    {
                        //CLOSE
                        grid[CLOSE_PRICE_INDEX, GetIndex(dataMessage.RequestId)].Value = priceMessage.Price;
                        break;
                    }
                    }
                }
                else if (dataMessage is TickSizeMessage)
                {
                    TickSizeMessage sizeMessage = (TickSizeMessage)message;
                    switch (dataMessage.Field)
                    {
                    case 0:
                    {
                        //BID SIZE
                        grid[BID_SIZE_INDEX, GetIndex(dataMessage.RequestId)].Value = sizeMessage.Size;
                        break;
                    }

                    case 3:
                    {
                        //ASK SIZE
                        grid[ASK_SIZE_INDEX, GetIndex(dataMessage.RequestId)].Value = sizeMessage.Size;
                        break;
                    }

                    case 5:
                    {
                        //LAST SIZE

                        grid[LAST_SIZE_INDEX, GetIndex(dataMessage.RequestId)].Value = sizeMessage.Size;
                        break;
                    }

                    case 8:
                    {
                        //VOLUME
                        //stgManager.handleTickMessage(message);
                        grid[VOLUME_SIZE_INDEX, GetIndex(dataMessage.RequestId)].Value = sizeMessage.Size;
                        break;
                    }
                    }
                }
            }
        }