private static string makeExchangeOutOfSymbol(string symbol, FinanceAPI.FinanceStrategies strategy) { string result = null; if (symbol != null) { string[] tmp = symbol.Split('.'); if (tmp.Length > 1) { ExchangeCode exch = exchanges.FirstOrDefault(x => x.YahooSuffix == tmp[1]); if (exch != null) { switch (strategy) { case FinanceAPI.FinanceStrategies.Google: result = exch.GoogleExch; break; case FinanceAPI.FinanceStrategies.Yahoo: result = exch.YahooExch; break; } } } } return(result); }
public StockChartView(StockListitem stock, FinanceAPI.FinanceStrategies webFinanceStrategy) { InitializeComponent(); this.stock = stock; this.webFinanceStrategy = webFinanceStrategy; setParameters(); drawChartAsync(); getAllLinesAsync(); }
public StockChartView(StockListitem stock, FinanceAPI.FinanceStrategies webFinanceStrategy, DateTime startDate, DateTime endDate) { InitializeComponent(); this.stock = stock; this.webFinanceStrategy = webFinanceStrategy; this.startDate = startDate; this.endDate = endDate; setParameters(); drawChartAsync(); getAllLinesAsync(); }
public FinanceAPI.FinanceStrategies getFinanceDataProvider() { if (ConnectionState == true) { var check = getSettingByKey("dataprovider"); if (check == null) { financeDataProvider = FinanceAPI.FinanceStrategies.Yahoo; } else { financeDataProvider = (FinanceAPI.FinanceStrategies)Enum.Parse(typeof(FinanceAPI.FinanceStrategies), check.value); } } return(financeDataProvider); }
public void setFinanceDataProvider(FinanceAPI.FinanceStrategies selected) { if (ConnectionState == true) { var check = getSettingByKey("dataprovider"); if (check == null) { db.Settings.InsertOnSubmit(new Settings() { key = "dataprovider", value = selected.ToString(), }); } else { check.value = selected.ToString(); } db.SubmitChanges(); } }
/// <summary> /// Changes the data provider /// </summary> private void cbxDataProvider_SelectedIndexChanged(object sender, EventArgs e) { webFinanceStrategy = (FinanceAPI.FinanceStrategies)cbxDataProvider.SelectedItem; loadChartDataAsync(selectedStock); }