public static OrderAgent GetUfxAgent(this ProviderManager manager)
        {
            var ufx   = GetUfx(manager);
            var agent = GetAgent(manager, OrderAgent.DefaultName);

            if (agent == null)
            {
                agent = new OrderAgent(ProviderManagerFrameworkField.Getter(manager));
                manager.AddNew(agent);
            }
            agent.ExecutionProvider = ufx;
            return(agent);
        }
        /// <summary>
        /// 获取订单助手,使用指定默认的CTP插件
        /// </summary>
        /// <returns></returns>
        public static OrderAgent GetCtpAgent(this ProviderManager manager)
        {
            var ctp = (XProvider)manager.GetExecutionProvider(QuantBoxConst.PIdCtp);

            ctp.ConnectTrader = true;
            var agent = GetAgent(manager, OrderAgent.DefaultName);

            if (agent == null)
            {
                agent = new OrderAgent(ProviderManagerFrameworkField.Getter(manager));
                manager.AddNew(agent);
            }
            agent.ExecutionProvider = ctp;
            return(agent);
        }
        /// <summary>
        /// 获取订单助手,使用指定服务器、用户的CTP插件
        /// </summary>
        /// <returns></returns>
        public static (OrderAgent, XProvider) NewCtpAgent(this ProviderManager manager, string server, string user, string password)
        {
            var name  = OrderAgent.DefaultName + $"({server}_{user})";
            var agent = GetAgent(manager, name);

            if (agent == null)
            {
                agent = new OrderAgent(ProviderManagerFrameworkField.Getter(manager), name);
                manager.AddNew(agent);
            }
            var ctp = NewCtp(manager, server, user, password);

            agent.ExecutionProvider = ctp;
            return(agent, ctp);
        }