示例#1
0
        public async Task Run()
        {
            var clock = await TradingClient.GetClockAsync();

            string openStr;

            if (clock.IsOpen)
            {
                openStr = "Markets are currently open";
            }
            else
            {
                openStr = "Markets are currently closed";
            }
            LoggerService.LogInfo($"Bot is ready...");
            LoggerService.LogInfo($"[{openStr}] Type a command to start.");

            CommandService.Listen();

            await Task.WhenAll(RunningTasks);
        }
示例#2
0
        public async Task <DateTime> GetNextMarketClose()
        {
            var clock = await TradingClient.GetClockAsync();

            return(clock.NextClose);
        }
示例#3
0
        public async Task <bool> IsMarketOpen()
        {
            var clock = await TradingClient.GetClockAsync();

            return(clock.IsOpen);
        }