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); }
public async Task <DateTime> GetNextMarketClose() { var clock = await TradingClient.GetClockAsync(); return(clock.NextClose); }
public async Task <bool> IsMarketOpen() { var clock = await TradingClient.GetClockAsync(); return(clock.IsOpen); }