예제 #1
0
        /// <summary>
        /// take the string to save
        /// взять строку для сохранения
        /// </summary>
        public StringBuilder GetStringForSave()
        {
            if (_saveString != null)
            {
                return(_saveString);
            }

            StringBuilder result = new StringBuilder();

            result.Append(NumberUser + "@");

            result.Append(ServerType + "@");

            result.Append(NumberMarket.ToString(new CultureInfo("ru-RU")) + "@");
            result.Append(Side + "@");
            result.Append(Price.ToString(new CultureInfo("ru-RU")) + "@");
            result.Append(PriceReal.ToString(new CultureInfo("ru-RU")) + "@");
            result.Append(Volume.ToString(new CultureInfo("ru-RU")) + "@");
            result.Append(VolumeExecute.ToString(new CultureInfo("ru-RU")) + "@");
            result.Append(State + "@");
            result.Append(TypeOrder + "@");
            result.Append(TimeCallBack.ToString(new CultureInfo("ru-RU")) + "@");

            result.Append(SecurityNameCode + "@");
            result.Append(PortfolioNumber.Replace('@', '%') + "@");

            result.Append(TimeCreate.ToString(new CultureInfo("ru-RU")) + "@");
            result.Append(TimeCancel.ToString(new CultureInfo("ru-RU")) + "@");
            result.Append(TimeCallBack.ToString(new CultureInfo("ru-RU")) + "@");

            result.Append(LifeTime + "@");
            // deals with which the order was opened and the order execution price was calculated
            // сделки, которыми открывался ордер и рассчёт цены исполнения ордера

            if (_trades == null)
            {
                result.Append("null");
            }
            else
            {
                for (int i = 0; i < _trades.Count; i++)
                {
                    result.Append(_trades[i].GetStringFofSave() + "*");
                }
            }
            result.Append("@");

            result.Append(Comment + "@");

            result.Append(TimeDone.ToString(new CultureInfo("ru-RU")) + "@");

            if (State == OrderStateType.Done && Volume == VolumeExecute &&
                _trades != null && _trades.Count > 0)
            {
                _saveString = result;
            }

            return(result);
        }
예제 #2
0
파일: Order.cs 프로젝트: jmptrader/OsEngine
        /// <summary>
        /// взять строку для сохранения
        /// </summary>
        public StringBuilder GetStringForSave()
        {
            StringBuilder result = new StringBuilder();

            result.Append(NumberUser + "@");

            result.Append(ServerType + "@");

            result.Append(NumberMarket.ToString(new CultureInfo("ru-RU")) + "@");
            result.Append(Side + "@");
            result.Append(Price.ToString(new CultureInfo("ru-RU")) + "@");
            result.Append(PriceReal.ToString(new CultureInfo("ru-RU")) + "@");
            result.Append(Volume.ToString(new CultureInfo("ru-RU")) + "@");
            result.Append(VolumeExecute.ToString(new CultureInfo("ru-RU")) + "@");
            result.Append(State + "@");
            result.Append(TypeOrder + "@");
            result.Append(TimeCallBack.ToString(new CultureInfo("ru-RU")) + "@");

            result.Append(SecurityNameCode + "@");
            result.Append(PortfolioNumber.Replace('@', '%') + "@");

            result.Append(TimeCreate.ToString(new CultureInfo("ru-RU")) + "@");
            result.Append(TimeCancel.ToString(new CultureInfo("ru-RU")) + "@");
            result.Append(TimeCallBack.ToString(new CultureInfo("ru-RU")) + "@");

            result.Append(LifeTime + "@");
            // сделки, которыми открывался ордер и рассчёт цены исполнения ордера

            if (_trades == null)
            {
                result.Append("null");
            }
            else
            {
                for (int i = 0; i < _trades.Count; i++)
                {
                    result.Append(_trades[i].GetStringFofSave() + "*");
                }
            }
            result.Append("@");

            result.Append(Comment + "@");

            result.Append(TimeDone.ToString(new CultureInfo("ru-RU")) + "@");

            return(result);
        }
예제 #3
0
파일: Order.cs 프로젝트: vovamagik/project
        /// <summary>
        /// взять строку для сохранения
        /// </summary>
        public string GetStringForSave()
        {
            string result = "";

            result += NumberUser + "@";

            result += ServerType + "@";

            result += NumberMarket.ToString(new CultureInfo("ru-RU")) + "@";
            result += Side + "@";
            result += Price.ToString(new CultureInfo("ru-RU")) + "@";
            result += PriceReal.ToString(new CultureInfo("ru-RU")) + "@";
            result += Volume.ToString(new CultureInfo("ru-RU")) + "@";
            result += VolumeExecute.ToString(new CultureInfo("ru-RU")) + "@";
            result += State + "@";
            result += TypeOrder + "@";
            result += TimeCallBack.ToString(new CultureInfo("ru-RU")) + "@";

            result += SecurityNameCode + "@";
            result += PortfolioNumber.Replace('@', '%') + "@";

            result += TimeCreate.ToString(new CultureInfo("ru-RU")) + "@";
            result += TimeCancel.ToString(new CultureInfo("ru-RU")) + "@";
            result += TimeCallBack.ToString(new CultureInfo("ru-RU")) + "@";
            result += LifeTime + "@";
            // сделки, которыми открывался ордер и рассчёт цены исполнения ордера

            if (_trades == null)
            {
                result += "null";
            }
            else
            {
                for (int i = 0; i < _trades.Count; i++)
                {
                    result += _trades[i].GetStringFofSave() + "*";
                }
            }
            result += "@";

            result += Comment;

            return(result);
        }