示例#1
0
        public AOptionMakeMarket()
        {
            instanceid++;

            //行情引擎
            MarketVendor mvendor = (MarketVendor)Config.GetInstance().GetParameter(Config.C_MARKETENGINE_OPTION);

            _optionengine = AMarket.GetInstance(mvendor);
            //委托引擎
            EntrustVendor evendor = (EntrustVendor)Config.GetInstance().GetParameter(Config.C_ENTRUSTENGINE_OPTION);

            _entrustengine = AEntrust.GetInstance(evendor);
            _entrustengine.Logon();

            //参数
            c_min_entrust_volume = (int)Config.GetInstance().GetParameter(Config.C_PARA_MM_MIN_ENTRUST_VOLUME);

            _queryparam           = new QueryPara();
            _queryparam.fundcode  = Config.GetInstance().GetParameter(Config.C_PARA_MM_FUNDCODE).ToString();
            _queryparam.portfolio = Config.GetInstance().GetParameter(Config.C_PARA_MM_PORTFOLIO).ToString();
        }
示例#2
0
        public static AEntrust GetInstance(EntrustVendor vendor)
        {
            try
            {
                if (_htentrustengines.Contains(vendor))
                {
                    return((AEntrust)_htentrustengines[vendor]);
                }

                AEntrust entrustengine = null;
                switch (vendor)
                {
                case EntrustVendor.Hundsun:
                    entrustengine = new EntrustHundsun();
                    break;

                case EntrustVendor.Wind:
                    break;

                default:
                    break;
                }

                if (entrustengine == null)
                {
                    MessageManager.GetInstance().Add(MessageType.Error, string.Format("未找到委托接口:{0}", vendor.ToString()));
                    return(null);
                }

                _htentrustengines.Add(vendor, entrustengine);
                return(entrustengine);
            }
            catch (Exception e)
            {
                throw e;
            }
        }