private void ChangeParent(SmartQuant.Portfolio portfolio) { if (!this.nodes.ContainsKey(portfolio.Name)) { return; } PortfolioNode portfolioNode = this.nodes[portfolio.Name]; portfolioNode.Remove(); this.nodes[portfolio.Parent.Name].Nodes.Add((TreeNode)portfolioNode); }
private void Reset() { this.portfolio = Framework.Current.PortfolioManager.Portfolios[this.name]; if (this.portfolio == null) return; PortfolioPerformance performance = this.portfolio.Performance; this.chart.Reset(); this.chart.SetMainSeries((ISeries) performance.EquitySeries, false, Color.White); this.chart.AddPad(); this.chart.DrawSeries(performance.DrawdownSeries, 2, Color.White, SimpleDSStyle.Line, SearchOption.ExactFirst, SmoothingMode.HighSpeed); this.chart.UpdateStyle = ChartUpdateStyle.WholeRange; performance.Updated += new EventHandler(this.performance_Updated); }
private void Reset() { this.portfolio = Framework.Current.PortfolioManager.Portfolios[this.name]; if (this.portfolio == null) { return; } PortfolioPerformance performance = this.portfolio.Performance; this.chart.Reset(); this.chart.SetMainSeries((ISeries)performance.EquitySeries, false, Color.White); this.chart.AddPad(); this.chart.DrawSeries(performance.DrawdownSeries, 2, Color.White, SimpleDSStyle.Line, SearchOption.ExactFirst, SmoothingMode.HighSpeed); this.chart.UpdateStyle = ChartUpdateStyle.WholeRange; performance.Updated += new EventHandler(this.performance_Updated); }
private void AddPortfolio(SmartQuant.Portfolio portfolio) { if (this.nodes.ContainsKey(portfolio.Name)) { return; } PortfolioNode portfolioNode = new PortfolioNode(portfolio.Name); this.nodes[portfolio.Name] = portfolioNode; if (portfolio.Parent == null) { this.trvPortfolios.Nodes.Add((TreeNode)portfolioNode); } else { this.nodes[portfolio.Parent.Name].Nodes.Add((TreeNode)portfolioNode); } }
private void RemovePortfolio(SmartQuant.Portfolio portfolio) { this.nodes[portfolio.Name].Remove(); this.nodes.Remove(portfolio.Name); }