public CommentReportDlg(StockDictionary stockDictionary, GraphCloseControl graphCloseControl, StockSerie.Groups group) { InitializeComponent(); this.stockDictionary = stockDictionary; this.graphCloseControl = graphCloseControl; this.stockGroup = group; }
public BatchStrategySimulatorDlg(StockDictionary stockDictionary, StockPortofolioList stockPortofolioList, StockSerie.Groups group, StockSerie.StockBarDuration barDuration, ToolStripProgressBar progressBar) { InitializeComponent(); this.stockPortofolioList = stockPortofolioList; this.stockDictionary = stockDictionary; this.progressBar = progressBar; this.group = group; this.BarDuration = barDuration; }
public MTFViewModel() { indicatorName = "TRAILHL(2)"; this.group = StockSerie.Groups.EURONEXT; this.stockSeries = StockDictionary.StockDictionarySingleton.Values.Where(s => s.BelongsToGroup(group)).ToList(); this.NbStocks = stockSeries.Count(); this.Trends = new ObservableCollection<MTFTrend>(); this.barDuration1 = StockSerie.StockBarDuration.Daily; this.barDuration2 = StockSerie.StockBarDuration.TLB; this.BarDuration3 = StockSerie.StockBarDuration.TLB_3D; dispatcher = Dispatcher.CurrentDispatcher; }
public SarexCustomTuningDlg(StockDictionary stockDictionary, StockSerie.Groups group, StockPortofolioList stockPortofolioList, ToolStripProgressBar progressBar) { InitializeComponent(); this.stockPortofolioList = stockPortofolioList; this.stockDictionary = stockDictionary; this.group = group; // Initialize stock combo this.stockComboBox.Enabled = true; this.stockComboBox.Items.Clear(); // Count the stock to simulate to initialise the progress bar foreach (StockSerie stockSerie in this.stockDictionary.Values) { if (!stockSerie.StockAnalysis.Excluded && !stockSerie.IsPortofolioSerie && stockSerie.BelongsToGroup(this.group)) { this.stockComboBox.Items.Add(stockSerie.StockName); } } this.stockComboBox.SelectedItem = this.stockComboBox.Items[0]; this.progressBar = progressBar; }
private void OnSelectedStockGroupChanged(string stockGroup) { StockSerie.Groups newGroup = (StockSerie.Groups)Enum.Parse(typeof(StockSerie.Groups), stockGroup); if (this.selectedGroup != newGroup) { // In order to speed the intraday display. switch (newGroup) { case StockSerie.Groups.TURBO: this.ForceBarDuration(StockSerie.StockBarDuration.TLB_3D, true); break; case StockSerie.Groups.INTRADAY: this.ForceBarDuration(StockSerie.StockBarDuration.TLB_6D, true); break; default: this.ForceBarDuration(StockSerie.StockBarDuration.Daily, true); break; } this.selectedGroup = newGroup; foreach (ToolStripMenuItem groupSubMenuItem in this.groupMenuItem.DropDownItems) { groupSubMenuItem.Checked = groupSubMenuItem.Text == stockGroup; } InitialiseStockCombo(); } }
private void CreateGroupMenuItem() { if (!Enum.TryParse<StockSerie.Groups>(Settings.Default.SelectedGroup, out this.selectedGroup)) { this.selectedGroup = StockSerie.Groups.INDICES; Settings.Default.SelectedGroup = StockSerie.Groups.INDICES.ToString(); Settings.Default.Save(); } // Clean existing menus this.groupMenuItem.DropDownItems.Clear(); List<ToolStripItem> groupMenuItems = new List<ToolStripItem>(); ToolStripMenuItem groupSubMenuItem; List<string> validGroups = this.StockDictionary.GetValidGroupNames(); bool selectedGroupFound = false; foreach (string groupName in validGroups) { // Create group menu items groupSubMenuItem = new ToolStripMenuItem(groupName); groupSubMenuItem.Click += new EventHandler(groupSubMenuItem_Click); if (groupName == this.selectedGroup.ToString()) { groupSubMenuItem.Checked = true; selectedGroupFound = true; } else { groupSubMenuItem.Checked = false; } groupMenuItems.Add(groupSubMenuItem); } if (!selectedGroupFound) { // Set default group ((ToolStripMenuItem)groupMenuItems[0]).Checked = true; this.selectedGroup = (StockSerie.Groups)Enum.Parse(typeof(StockSerie.Groups), groupMenuItems[0].ToString()); Settings.Default.SelectedGroup = this.selectedGroup.ToString(); Settings.Default.Save(); } this.groupMenuItem.DropDownItems.AddRange(groupMenuItems.ToArray()); }