예제 #1
0
        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 GetQuotes(Gateway apiGateway, string apiCall)
     : base(apiGateway, apiCall)
 {
     InitializeComponent();
     if (ApiCall.CompareTo("Market/Get Option Expirations") == 0)
     {
         label2.Text = "** Only one symbol may be used when fetching option expirations. **";
     }
 }
예제 #3
0
 public GetIntradayStatus(Gateway apiGateway, string apiCall)
     : base(apiGateway, apiCall)
 {
     InitializeComponent();
     if (ApiCall.CompareTo("Market/Get Intraday Status") == 0)
     {
         label1.Visible   = false;
         txtMonth.Visible = false;
         label2.Visible   = false;
         txtYear.Visible  = false;
     }
 }
예제 #4
0
        public GetTimeAndSales(Gateway apiGateway, string apiCall)
            : base(apiGateway, apiCall)
        {
            InitializeComponent();
            if (ApiCall.CompareTo("Market/Get Historical Pricing") == 0)
            {
                label3.Visible          = false;
                cmbSession.Visible      = false;
                cmbSession.SelectedItem = null;

                cmbInterval.Items.Clear();
                cmbInterval.Items.Add("daily");
                cmbInterval.Items.Add("weekly");
                cmbInterval.Items.Add("monthly");
            }
        }
예제 #5
0
 public CommandPanel(Gateway apiGateway, string apiCall)
     : base(apiGateway, apiCall)
 {
     InitializeComponent();
     //Putting the following in Designer.cs hoses the GUI
     txtAccountId.Text = CommandPanel.AccountId;
     if (ApiCall.CompareTo("Account/Get History") == 0)
     {
         label3.Visible      = true;
         txtOffset.Visible   = true;
         txtPageSize.Visible = true;
     }
     else if (ApiCall.CompareTo("Account/Get Order Status") == 0)
     {
         label2.Visible     = true;
         txtOrderId.Visible = true;
     }
 }
예제 #6
0
        private async void btnGo_Click(object sender, EventArgs e)
        {
            if (!ValidateInput())
            {
                return;
            }
            string responseText = "";

            if (ApiCall.CompareTo("Market/Get Intraday Status") == 0)
            {
                var response = await ApiGateway.MarketData.GetIntradayStatus();

                responseText = response.RawResponse.Content;
            }
            else if (ApiCall.CompareTo("Market/Get Market Calendar") == 0)
            {
                var request  = new GetMarketCalendarRequest(int.Parse(txtMonth.Text), int.Parse(txtYear.Text));
                var response = await ApiGateway.MarketData.GetMarketCalendar(request);

                responseText = response.RawResponse.Content;
            }

            txtResponse.Text = responseText;
        }
예제 #7
0
        private async void btnGo_Click(object sender, EventArgs e)
        {
            if (!ValidateInput())
            {
                return;
            }
            string responseText = "";

            if (ApiCall.CompareTo("Market/Get Quotes") == 0)
            {
                var request  = new GetQuotesRequest(txtSymbols.Text, ",");
                var response = await ApiGateway.MarketData.GetQuotes(request);

                responseText = response.RawResponse.Content;
            }
            else if (ApiCall.CompareTo("Market/Get Option Expirations") == 0)
            {
                var request  = new GetOptionExpirationRequest(txtSymbols.Text);
                var response = await ApiGateway.MarketData.GetOptionExpirations(request);

                responseText = response.RawResponse.Content;
            }
            txtResponse.Text = responseText;
        }
예제 #8
0
        private async void btnGo_Click(object sender, EventArgs e)
        {
            if (!ValidateInput())
            {
                return;
            }

            string   responseText  = "";
            string   interval      = "";
            string   sessionFilter = "";
            DateTime?dtEnd         = null;
            DateTime?dtStart       = null;


            if (cmbInterval.SelectedItem != null)
            {
                interval = cmbInterval.SelectedItem.ToString().ToLower();
            }

            if (cmbSession.SelectedItem != null)
            {
                if (cmbSession.SelectedItem.ToString() == "Include Pre/After Market")
                {
                    sessionFilter = "all";
                }
                else
                {
                    sessionFilter = "open";
                }
            }

            if (dateTimeEnd.Value.CompareTo(SqlDateTime.MinValue.Value) > 0)
            {
                dtEnd = dateTimeEnd.Value;
            }

            if (dateTimeStart.Value.CompareTo(SqlDateTime.MinValue.Value) > 0)
            {
                dtStart = dateTimeStart.Value;
            }

            if (ApiCall.CompareTo("Market/Get Historical Pricing") == 0)
            {
                var request = new GetHistoricalPricingRequest(txtSymbol.Text);
                request.Interval      = interval;
                request.StartDateTime = dtStart;
                request.EndDateTime   = dtEnd;
                var response = await ApiGateway.MarketData.GetHistoricalPricing(request);

                responseText = response.RawResponse.Content;
            }
            else if (ApiCall.CompareTo("Market/Get Time And Sales") == 0)
            {
                var request = new GetTimeAndSalesRequest(txtSymbol.Text);
                request.Interval      = interval;
                request.SessionFilter = sessionFilter;
                request.StartDateTime = dtStart;
                request.EndDateTime   = dtEnd;
                var response = await ApiGateway.MarketData.GetTimeAndSales(request);

                responseText = response.RawResponse.Content;
            }

            txtResponse.Text = responseText;
        }