Ejemplo n.º 1
0
        public void CreateMarketApi(BrokerType type)
        {
            switch (type)
            {
            case BrokerType.XSpeed:
                IMarketApi = new XMduserApi();
                break;

            case BrokerType.QDP:
                //MarketApi =
                break;

            default:
                throw new NotImplementedException();
            }
            ProgramTradeEvents.AddRspHandler(RspSpiModules.RtnMarket, OnMarketDataReturn);
        }
Ejemplo n.º 2
0
        public void CreateTradeApi(BrokerType type)
        {
            switch (type)
            {
            case BrokerType.XSpeed:
                ITradeApi = new XTradeApi();
                break;

            case BrokerType.QDP:
                ITradeApi = new QTradeApi();
                break;

            default:
                throw new NotImplementedException();
            }

            ProgramTradeEvents.AddRspHandler(RspSpiModules.FrontConnected, OnFrontConnected);
            ProgramTradeEvents.AddRspHandler(RspSpiModules.UserLogin, OnUserLogin);
            ProgramTradeEvents.AddRspHandler(RspSpiModules.QryPosition, OnRspQryPosition);
            ProgramTradeEvents.AddRspHandler(RspSpiModules.QryOrders, OnRspQryOrder);
            ProgramTradeEvents.AddRspHandler(RspSpiModules.OrderDeal, OnOrderDeal);
            ProgramTradeEvents.AddRspHandler(RspSpiModules.RtnOrder, OnOrderReturn);
        }