Click or drag to resize
Get Quote Example

Note: This is preliminary documentation provided only as a preview, and is subject to change. Please contact the author for pricing and licensing information.

This topic demonstrates how quote data can be retrieved.

  1. Import the following namespaces:

    C#
    using ETradeNet.Market;
    using ETradeNet.Market.Quote.Data;
  2. Implement the following method:

    C#
    async Task<IEnumerable<QuoteData>> GetQuoteAsync(string[] symbols, IMarketInitializer init)
    {
        using (var market = new MarketService(init))
        {
            var response = await market.Quote.GetAsync(symbols);
            return response.QuoteData;
        }
    }
We recommend that you accommodate for cancellation by passing a CancellationToken wherever possible (i.e., in all calls that don't result in a Stream). The example above only omits it for clarity.
See Also