Ejemplo n.º 1
0
        public override string GenerateNameBySettings()
        {
            string colorStr;

            GetKnownColor(ColorLine.ToArgb(), out colorStr);
            return(string.Format("CCI[{0}]{1}",
                                 Period, string.IsNullOrEmpty(colorStr) ? "" : string.Format("({0})", colorStr)));
        }
Ejemplo n.º 2
0
        /// <summary>
        /// save to file
        /// сохранить в файл
        /// </summary>
        public void Save()
        {
            try
            {
                using (StreamWriter writer = new StreamWriter(@"Engine\" + Name + @"Alert.txt", false))
                {
                    writer.WriteLine(Type);

                    string saveLineString = "";

                    for (int i = 0; i < Lines.Length; i++)
                    {
                        saveLineString += Lines[i].GetStringToSave() + "%";
                    }

                    writer.WriteLine(saveLineString);

                    writer.WriteLine(Label);
                    writer.WriteLine(Message);
                    writer.WriteLine(BorderWidth);
                    writer.WriteLine(IsOn);
                    writer.WriteLine(IsMusicOn);
                    writer.WriteLine(IsMessageOn);
                    writer.WriteLine(ColorLine.ToArgb());
                    writer.WriteLine(ColorLabel.ToArgb());
                    writer.WriteLine(Music);
                    writer.WriteLine(SignalType);
                    writer.WriteLine(VolumeReaction);
                    writer.WriteLine(Slippage);
                    writer.WriteLine(NumberClosePosition);
                    writer.WriteLine(OrderPriceType);
                    writer.Close();
                }
            }
            catch (Exception)
            {
                // ignore
            }
        }
Ejemplo n.º 3
0
        public void SaveInXML(XmlElement parentNode, CandleChartControl owner)
        {
            var node = parentNode.AppendChild(parentNode.OwnerDocument.CreateElement("Asterisk"));

            node.Attributes.Append(parentNode.OwnerDocument.CreateAttribute("Name")).Value = Name;

            node.Attributes.Append(parentNode.OwnerDocument.CreateAttribute("Text")).Value  = Text;
            node.Attributes.Append(parentNode.OwnerDocument.CreateAttribute("Sign")).Value  = Sign;
            node.Attributes.Append(parentNode.OwnerDocument.CreateAttribute("magic")).Value = Magic.ToString();

            node.Attributes.Append(parentNode.OwnerDocument.CreateAttribute("ColorLine")).Value = ColorLine.ToArgb().ToString();
            node.Attributes.Append(parentNode.OwnerDocument.CreateAttribute("ColorFill")).Value = ColorFill.ToArgb().ToString();
            node.Attributes.Append(parentNode.OwnerDocument.CreateAttribute("ColorText")).Value = ColorText.ToArgb().ToString();

            node.Attributes.Append(parentNode.OwnerDocument.CreateAttribute("Price")).Value = Price.ToString(CultureProvider.Common);
            if (DateStart.HasValue)
            {
                node.Attributes.Append(parentNode.OwnerDocument.CreateAttribute("PivotTime")).Value =
                    DateStart.Value.ToString("ddMMyyyy HHmmss", CultureProvider.Common);
            }
            node.Attributes.Append(parentNode.OwnerDocument.CreateAttribute("Shape")).Value        = Shape.ToString();
            node.Attributes.Append(parentNode.OwnerDocument.CreateAttribute("Transparency")).Value =
                Transparency.ToString();
            node.Attributes.Append(parentNode.OwnerDocument.CreateAttribute("TransparencyText")).Value =
                TransparencyText.ToString();
            node.Attributes.Append(parentNode.OwnerDocument.CreateAttribute("Radius")).Value =
                Radius.ToString();
            node.Attributes.Append(parentNode.OwnerDocument.CreateAttribute("magic")).Value = Magic.ToString();
        }