private void addToolStripMenuItem1_Click(object sender, EventArgs e) { if (toolStripTextBoxListName.Text.Length > 0) { WatchListManager.AddNewList(toolStripTextBoxListName.Text); } }
private void FillListBoxStocks() { listBoxStocks.Items.Clear(); foreach (string stock in WatchListManager.GetList(_activeStockList).Stocks) { listBoxStocks.Items.Add(stock); } }
private void removeStockToolStripMenuItem_Click(object sender, EventArgs e) { if (listBoxStocks.SelectedItem != null) { WatchListManager.RemoveFromList(_activeStockList, new Stock(listBoxStocks.SelectedItem.ToString())); FillListBoxStocks(); listBoxStocks.SelectedItem = null; } }
private void removeListToolStripMenuItem_Click(object sender, EventArgs e) { if (listBoxWatchLists.SelectedItem != null) { string list = listBoxWatchLists.SelectedItem.ToString(); WatchListManager.RemoveList(list); FillListBoxWatchLists(); listBoxWatchLists.SelectedItem = null; } }
private void removeToolStripMenuItem_Click(object sender, EventArgs e) { if (listBoxWatchList.SelectedItem != null) { Stock stock = new Stock(listBoxWatchList.SelectedItem.ToString()); WatchListManager.RemoveFromList(_activeWatchList, stock); FillListBoxWatchList(); listBoxWatchList.SelectedItem = null; } }
private void removeToolStripMenuItem1_Click(object sender, EventArgs e) { if (_activeWatchList != null) { if (MessageBox.Show("Are you sure you want to remove " + _activeWatchList, "", MessageBoxButtons.YesNo) == DialogResult.Yes) { WatchListManager.RemoveList(_activeWatchList); } } }
private void addToolStripMenuItemAddStock_Click(object sender, EventArgs e) { if (toolStripTextBoxStockName.Text.Length > 0 && _activeWatchList.Length > 0) { Stock stock = new Stock(toolStripTextBoxStockName.Text); WatchListManager.AddToList(_activeWatchList, stock); FillListBoxWatchList(); listBoxWatchList.SelectedItem = null; } }
private void toolStipItemAddToWatchList_Click(object sender, EventArgs e) { if (Linked) { if (_chart.Stock != null) { ToolStripMenuItem item = (ToolStripMenuItem)sender; WatchListManager.AddToList(item.Text, _chart.Stock); } } }
public FormMain() { GlobalObjects.Initialize(); Api.Initialize(File.ReadAllText("AlphavantageKey.txt")); StockDataBase.Initialize(TimeSpan.FromHours(5)); OptionDataBase.Initialize(); WatchListManager.Initialize(); InitializeComponent(); watchListUI.Link(GlobalObjects.Chart); chartControl.Link(GlobalObjects.Chart); watchListUI.LoadStockEvent += new WatchListUI.LoadStockHandler(LoadStock); chartControl.LoadStockEvent += new ChartControl.LoadStockHandler(LoadStockChart); }
private void FillListBoxWatchList() { string selected = ""; if (_activeWatchList != null) { selected = _activeWatchList; } StockList list = WatchListManager.GetList(selected); listBoxWatchList.Items.Clear(); if (list != null) { listBoxWatchList.Items.AddRange(list.Stocks); } }
public async void Load(Panel controlPanel, Panel variablePanel) { panelControl = controlPanel; panelVariable = variablePanel; string dataBasePath = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + "\\DataMAN\\Financial data\\Options\\HistoricalOptionData"; string listName = "Historical Data"; /*WatchListManager.AddNewList(listName); * foreach (string stockFolder in Directory.GetDirectories(dataBasePath)) * { * DirectoryInfo dInfo = new DirectoryInfo(stockFolder); * string symbol = dInfo.Name; * Stock stock = new Stock(symbol); * WatchListManager.AddToList(listName, stock); * }*/ if (MessageBox.Show("ready") == DialogResult.OK) { StockList list = WatchListManager.GetList("Historical Data"); foreach (string symbol in list.Stocks) { Stock stock = new Stock(symbol); StockData data = await StockDataBase.Get(stock, Api.Interval.Daily, TimeSpan.FromDays(200)); DateTime lastRefeshed; try { lastRefeshed = DateTime.Parse(data.MetaData.LastRefreshed); } catch { lastRefeshed = DateTime.MinValue; } if (DateTime.UtcNow - lastRefeshed < TimeSpan.FromMinutes(10)) { Thread.Sleep(new TimeSpan(0, 0, 25)); } } MessageBox.Show("Done"); } }
private void buttonAddStock_Click(object sender, EventArgs e) { WatchListManager.AddToList(_activeStockList, new Stock(textBoxStockName.Text)); FillListBoxStocks(); }
private void buttonAddNewList_Click(object sender, EventArgs e) { _activeStockList = textBoxWatchListName.Text; WatchListManager.AddNewList(_activeStockList); FillListBoxWatchLists(); }
private void AddToRecentList(Stock stock) { WatchListManager.AddToRecentList(stock); FillListBoxRecent(); }
private void FormMain_FormClosing(object sender, FormClosingEventArgs e) { PluginManager.UnloadPlugins(); WatchListManager.Save(); }