Example #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();
        }
Example #2
0
        public static AMarket GetInstance(MarketVendor vendor)
        {
            try
            {
                if (_htmarketengines.Contains(vendor))
                {
                    return((AMarket)_htmarketengines[vendor]);
                }

                AMarket marketengine = null;
                switch (vendor)
                {
                case MarketVendor.Exchange:
                    marketengine = new MarketSHE();
                    break;

                case MarketVendor.Wind:
                    marketengine = new MarketWind();
                    break;

                default:
                    break;
                }

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

                _htmarketengines.Add(vendor, marketengine);
                return(marketengine);
            }
            catch (Exception e)
            {
                throw e;
            }
        }