Ejemplo n.º 1
0
        internal static async Task <OptionQuote[]> GetOptionQuote(string symbol, string expires, decimal strikePrice, int nRange)
        {
            try
            {
                _resultsLabel = $"{symbol} {expires} {strikePrice}";

                var rh = new RobinhoodClient(_token);

                _options = await rh.DownloadOptionQuotes(new string[] { symbol, expires, strikePrice.ToString(), nRange.ToString() })
                           .ConfigureAwait(continueOnCapturedContext: false);
            }
            catch { }

            //catch (Exception exc)
            //{
            //    Utils.MessageBoxModal(exc.ToString());
            //}
            return(new OptionQuote[1]);
        }
Ejemplo n.º 2
0
        internal static async Task <OptionQuote[]> AttemptToGetOptionQuote(string symbol, string expires, decimal strikePrice)
        {
            try
            {
                _resultsLabel = $"{symbol} {expires} {strikePrice}";
                Utils.MessageBoxModal($"Attempting to get Option Quote for {_resultsLabel}...");

                var rh = new RobinhoodClient(_token);

                _results = await rh.DownloadOptionQuotes(new string[] { symbol, expires, strikePrice.ToString(), "2" })
                           .ConfigureAwait(continueOnCapturedContext: false);

                Utils.MessageBoxModal("Option Quote succeeded.");
            }
            catch (Exception exc)
            {
                Utils.MessageBoxModal(exc.ToString());
            }
            return(null);
        }