Exemple #1
0
        public async void ProcessStockAndOptionQuote()
        {
            var controller = new IBController();

            Assert.True(controller.Connect(), "Connection setup failed!");

            var taskHandler = new IBDTaskHandler(controller);

            //try getting data for a VIX option contract
            taskHandler.AddTask(new IBDTaskInstruction("DownloadStockAndOptionHistoricalData")
            {
                ConId = 308395806
            });

            var storage = new Stdout(new DataStorage.Processors.StockOptionQuoteProcessor());

            taskHandler.OnTaskResult += storage.ProcessTaskResult;

            await taskHandler.BeginAsync();

            await storage.FlushAsync();
        }
Exemple #2
0
        public async void GenerateOptionHistoricalDataTasks()
        {
            var controller = new IBController();

            Assert.True(controller.Connect(), "Connection setup failed!");

            var taskHandler = new IBDTaskHandler(controller);

            var instruction = new IBDTaskInstruction("BuildOptionDownloadTasks")
            {
                Symbol = "VIX", SecType = "OPT"
            };

            instruction.parameters["filter.expirytype"] = OptionChain.Expiration.Type.any.ToString();
            taskHandler.AddTask(instruction);

            var storage = new JSONFile();

            taskHandler.OnTaskResult += storage.ProcessTaskResult;

            await taskHandler.BeginAsync();

            await storage.FlushAsync();
        }
Exemple #3
0
        public async void DownloadHistoricalData()
        {
            var controller = new IBController();

            Assert.True(controller.Connect(), "Connection setup failed!");

            var taskHandler = new IBDTaskHandler(controller);

            taskHandler.AddTask(new IBDTaskInstruction("DownloadHistoricalData")
            {
                contract = new IBApi.Contract()
                {
                    Symbol = "VIX", SecType = "IND", Exchange = "CBOE"
                }
            });

            var storage = new JSONFile();

            taskHandler.OnTaskResult += storage.ProcessTaskResult;

            await taskHandler.BeginAsync();

            await storage.FlushAsync();
        }