Exemplo n.º 1
0
        static void testMarket1()
        {
            AMarket   market = AMarket.GetInstance(MarketVendor.Exchange);
            ASecurity s1     = new ETF("510050", Exchange.SHE);   //50ETF
            ASecurity s2     = new ETF("510180", Exchange.SHE);   //100ETF
            ASecurity s3     = new Stock("601318", Exchange.SHE); //中国平安
            ASecurity s4     = new Stock("600104", Exchange.SHE); //上汽集团

            List <ASecurity> seclist = new List <ASecurity>();

            seclist.Add(s1);
            seclist.Add(s2);
            seclist.Add(s3);
            seclist.Add(s4);

            List <Option> optionlist = market.GetOptionSet(seclist);

            //ASecurity s = (ASecurity)market.htUnderlyingSets["510050"];
            //s.name = "更改";

            if (optionlist != null)
            {
                foreach (Option o in optionlist)
                {
                    o.DebugPrint();
                }
            }
            market.Dispose();
        }
Exemplo n.º 2
0
        static void testMM2()
        {
            AMarket   mkt = AMarket.GetInstance(MarketVendor.Exchange);
            ASecurity s   = mkt.GetOption("90000229", new ETF("510050", Exchange.SHE));

            AOptionMakeMarket mm = new OptionMakeMarket1();

            mm.AddOptions(s);
            mm.Run();
        }
Exemplo n.º 3
0
        static void testMarket4()
        {
            AMarket market = AMarket.GetInstance(MarketVendor.Exchange);
            ETF     etf    = new ETF("510050", Exchange.SHE);
            Stock   s      = new Stock("601318", Exchange.SHE);

            market.SubscribeBidAskBook(etf, 2);
            market.SubscribeBidAskBook(s, 2);
            market.Dispose();
        }
Exemplo n.º 4
0
        static void testMarket3()
        {
            AMarket market = AMarket.GetInstance(MarketVendor.Exchange);
            Option  o      = new Option("90000528", Exchange.SHE);

            market.SubscribeBidAskBook(o, 1);

            while (true)
            {
                o.bidaskbook.DebugPrint();
            }
        }
Exemplo n.º 5
0
        static void testMarket2()
        {
            AMarket market = AMarket.GetInstance(MarketVendor.Exchange);
            Option  o1     = new Option("90000528", Exchange.SHE);
            Option  o2     = new Option("90000526", Exchange.SHE);
            Option  o3     = new Option("90000543", Exchange.SHE);

            market.SubscribeBidAskBook(o1, 5);
            market.SubscribeBidAskBook(o2, 5);
            market.SubscribeBidAskBook(o3, 5);
            while (true)
            {
                o1.bidaskbook.DebugPrint();
                o2.bidaskbook.DebugPrint();
                o3.bidaskbook.DebugPrint();
            }
        }
Exemplo n.º 6
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();
        }
Exemplo n.º 7
0
        static void testMM1()
        {
            string acc   = "1104";
            string combi = "11040201";

            List <ASecurity> underlyinglist = new List <ASecurity>();

            //underlyinglist.Add(new ETF("510050", Exchange.SHE));
            underlyinglist.Add(new ETF("510180", Exchange.SHE));
            underlyinglist.Add(new Stock("601318", Exchange.SHE));
            //underlyinglist.Add(new Stock("600104", Exchange.SHE));

            AMarket       mkt        = AMarket.GetInstance(MarketVendor.Exchange);
            List <Option> optionlist = mkt.GetOptionSet(underlyinglist);

            foreach (Option o in optionlist)
            {
                QueryPara param = new QueryPara();
                param.fundcode     = acc;
                param.portfolio    = combi;
                param.securitycode = o.code;

                AEntrust et = AEntrust.GetInstance(EntrustVendor.Hundsun);
                et.OptionEntrustQuery(param, o.entrustbook);
                bool flg = o.makemarketstat.IsValid();

                if (o.entrustbook != null && o.entrustbook.Count > 0)
                {
                    foreach (EntrustBook eb in o.entrustbook)
                    {
                        eb.DebugPrint();
                    }
                }

                //Debug.Print(string.Format("spread, code={2},name={3},价差={0},{1}", o.makemarketstat.currminspreadpct.ToString("P2"), o.makemarketstat.message, o.code,o.name));
            }
        }
Exemplo n.º 8
0
        private void btnCheckExchange_Click(object sender, EventArgs e)
        {
            AMarket engine = AMarket.GetInstance(MarketVendor.Exchange);

            textBoxExchange.Text = engine.GetTradeTime();
        }