示例#1
0
        public void Show(AssetAllocation alloc)
        {
            //I create a form for every request because maybe the user want to see several asset details at the same time
            APIResponse <Stock> response            = DataSourcesAPICaller.GetCompleteStockData(alloc.Asset.Ticker, alloc.Asset.Exchange, alloc.Asset.AssetClass, true, true);
            AssetDetailForm     showAssetDetailForm = new AssetDetailForm(response);

            showAssetDetailForms.Add(showAssetDetailForm);
            //showAssetDetailForm.MdiParent = this.ParentForm;
            showAssetDetailForm.Show();
        }
示例#2
0
        private void StandardAndPoors_Load(object sender, EventArgs e)
        {
            string ticker = "^GSPC";
            APIResponse <PriceList> pricesResponse = DataSourcesAPICaller.GetPrices(ticker, null, DateTime.Now.AddYears(-50), DateTime.Now, PriceInterval.Monthly);

            chartSP.Series.Clear();
            chartSP.Titles.Add("S&P 500");

            //for volume
            //https://stackoverflow.com/questions/17303378/creating-multiple-charts-and-the-relation-between-chart-series-chartarea

            Series priceSeries = this.chartSP.Series.Add("Prices");

            priceSeries.ChartType = SeriesChartType.Spline;
            foreach (HistoricalPrice p in pricesResponse.Content)
            {
                priceSeries.Points.AddXY(p.Date, p.Close);
            }
        }