예제 #1
0
        static void RunCommand_04()
        {
            Console.Write("請輸入指定日期(YYYY-MM-DD):");
            string sDate = Console.ReadLine();

            MitakeSourceAdapter cAdapter = new MitakeSourceAdapter();

            cAdapter.Load(DateTime.Parse(sDate));
        }
예제 #2
0
        static void Main(string[] args)
        {
            XmlConfigurator.ConfigureAndWatch(new System.IO.FileInfo("log4net_config.xml"));

            ServicePointManager.DefaultConnectionLimit = 1024;

            ProductManager.Load("exchanges");
            QuoteManager.Manager.Refresh("plugins\\quotes");

            QuoteServiceInformation[] cQuoteServiceInfos = QuoteManager.Manager.GetQuoteServiceInformations();
            QuoteManager.Manager.StartQuoteService(cQuoteServiceInfos[0]);
            AbstractQuoteService cService = QuoteManager.Manager.GetQuoteService(cQuoteServiceInfos[0].DataSource);

            cService.Load();
            cService.onLoginCompleted += Service_onLoginCompleted;

            Zeghs.Settings.GlobalSettings.Load();

            //*
            //轉換三竹資訊源即時資料
            if (args.Length > 0 && args[0].Equals("/admin"))
            {
                int iCommand = PrintMenu();
                if (iCommand > 0)
                {
                    ExcuteCommand(iCommand);
                }
            }
            else
            {
                MitakeSourceAdapter cAdapter = new MitakeSourceAdapter();
                cAdapter.Load(DateTime.Today);
            }
            // */

            /* 轉換期交所指數期貨 RPT 資料
             * if (args.Length > 0 && args[0].Equals("/admin")) {
             *      int iCommand = PrintMenu();
             *      if (iCommand > 0) {
             *              ExcuteCommand(iCommand);
             *      }
             * } else {
             *      bool bEvent = __cManualEvent.WaitOne(60000);
             *      FuturesRptAdapter.Convert(DateTime.Now);
             * }
             * // */

            //DumpDataUtil.Load("TXF0.tw", true, new DateTime(2017, 12, 22, 8, 45, 0), new DateTime(2017, 12, 26, 13, 45, 0));
            //DumpDataUtil.Save("TXF0.tw", true, "abc.txt", new DateTime(2013,11,20,8,45,0));

            //FuturesCsvAdapter.Convert();  //轉換CSV使用

            //bool bEvent = __cManualEvent.WaitOne(60000);

            /*
             * MitakeSourceAdapter cAdapter = new MitakeSourceAdapter();
             * DateTime cStartDate = new DateTime(2012, 1, 1);
             * DateTime cEndDate = new DateTime(2014, 12, 31);
             *
             * while (cStartDate <= cEndDate) {
             *      cAdapter.Load(cStartDate);
             *      cStartDate = cStartDate.AddSeconds(86400);
             * }
             * cAdapter.Dispose();
             *
             * //*/
            //System.Console.WriteLine("Completed...");
            //System.Console.ReadLine();
            //return;

            __cManualEvent.Dispose();
            QuoteManager.Manager.CloseAll();
        }