示例#1
0
        private PortfolioNode ReloadPortfolio(ModelProperties properties)
        {
            PortfolioNode portfolio = new PortfolioNode(properties.Type, properties);

            portfolio.Name = properties.Name;
            string[] keys = properties.GetModelKeys();
            for (int i = 0; i < keys.Length; i++)
            {
                ModelProperties modelProperties = properties.GetModel(keys[i]);
                if (modelProperties.ModelType == ModelType.Indicator)
                {
                }
                else
                {
                    // type null for performance, positionsize, exitstrategy, etc.
                    if (modelProperties.Type == null)
                    {
//						HandlePropertySet( model, modelProperties);
                    }
                    else
                    {
                        PortfolioNode node = ReloadPortfolio(modelProperties);
                        portfolio.Nodes.Add(node);
                    }
                }
            }
            return(portfolio);
        }
示例#2
0
        public void Add(ModelProperties properties)
        {
            PortfolioNode node = new PortfolioNode(properties.Type, properties);

            node.Name = properties.Name;
            Nodes.Add(node);
        }
示例#3
0
        private void ReloadProjectModels(TickZoom.Api.ProjectProperties loadProjectProperties)
        {
            ModelProperties model      = loadProjectProperties.Model;
            TreeNode        project    = new TreeNode("New Portfolio Project");
            PropertyTable   properties = new PropertyTable(projectProperties);

            project.Tag = properties;
            PortfolioNode node = ReloadPortfolio(model);

            loadProjectProperties.Chart.CopyProperties(projectProperties.Chart);
            loadProjectProperties.Starter.CopyProperties(projectProperties.Starter);
            loadProjectProperties.Engine.CopyProperties(projectProperties.Engine);
            properties.UpdateAfterProjectFile();
            project.Nodes.Add(node);
            this.treeView.Nodes.Add(project);
            this.treeView.ExpandAll();
            this.treeView.SelectedNode = project;
            isInitialized = true;
        }
示例#4
0
        private void NewProject()
        {
            TreeNode      project   = new TreeNode("New Portfolio Project");
            PortfolioNode portfolio = null;

            try {
                project.Tag = new PropertyTable(projectProperties);
                portfolio   = new PortfolioNode("PortfolioCommon");
            } catch (Exception ex) {
                log.Debug(ex.ToString());
            }
            project.Nodes.Add(portfolio);
//	        portfolio.Add("ExampleReversalStrategy");
            portfolio.Add("ExampleSMAStrategy");
            this.treeView.Nodes.Add(project);
            this.treeView.ExpandAll();
            this.treeView.SelectedNode = project;
            isInitialized = true;
        }
示例#5
0
        public void Add(string name)
        {
            PortfolioNode node = new PortfolioNode(name);

            Nodes.Add(node);
        }