/// <summary>
        /// Gets the multiple option chain for automatic expiry.
        /// </summary>
        /// <param name="cmd">The command.</param>
        /// <returns>List of option chain.</returns>
        private static async Task <List <TradierOptionChain> > GetMultipleOptionChainForAutoExpiry(TradierOptionChainCommand cmd)
        {
            var expirationDates = await new TradierOptionExpirationRequest(
                new TradierOptionExpirationCommand(cmd, cmd.Symbol)).GetAsync();

            var tasks = expirationDates.Take(cmd.ExpiryDateRangeLimit.Value)
                        .Select(date => new TradierOptionChainRequest(
                                    new TradierOptionChainCommand(cmd, cmd.Symbol, date))
                                .GetAsync()).ToList();

            var wholeData = new List <TradierOptionChain>();

            await Task.WhenAll(tasks).ContinueWith(res =>
                                                   res.Result.ToList().ForEach(tResult => wholeData.AddRange(tResult)));

            return(wholeData);
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="TradierOptionChainRequest"/> class.
 /// </summary>
 /// <param name="command">The command.</param>
 /// <exception cref="ArgumentNullException">command</exception>
 private TradierOptionChainRequest(TradierOptionChainCommand command)
     : base(command?.BaseUrl, command.AccessKey)
 {
     Command = command ?? throw new ArgumentNullException(nameof(command));
 }