private async void btnGo_Click(object sender, EventArgs e)
        {
            if (!ValidateInput()) return;

            string responseText = "";
            if (ApiCall.CompareTo("Market/Get Option Strikes") == 0)
            {
                var request = new GetOptionStrikeRequest(txtSymbol.Text, dateTimeExpiration.Value);
                var response = await ApiGateway.MarketData.GetOptionStrikes(request);
                responseText = response.RawResponse.Content;
            }
            else //execute get option chain by default
            {
                var request = new GetOptionChainRequest(txtSymbol.Text, dateTimeExpiration.Value);
                var response = await ApiGateway.MarketData.GetOptionChain(request);
                responseText = response.RawResponse.Content;
            }

            txtResponse.Text = responseText;
        }
示例#2
0
        public async Task<GetOptionChainResponse> GetOptionChain(GetOptionChainRequest request)
        {
            var command = new GetOptionChainCommand(request.Symbol, request.Expiration, Gateway.AccesToken);

            //Send command to API
            await MakeApiCall(command);

            //Some handling of the response
            var response = new GetOptionChainResponse(command.RawResponse, command.MessageFormat);
            return response;
        }