private void AddIndicator2Xml(XDocument xdChart, IIndicator indicator) { var xnIndicators = xdChart.Root.Element("Indicators"); if (xnIndicators == null) { xnIndicators = new XElement("Indicators"); xdChart.Root.Add(xnIndicators); } var xdIndic = indicator.Serialize(); if (xdIndic != null) { xnIndicators.Add(xdIndic.Root); } }