示例#1
0
            public string GetCheckResultDescription()
            {
                string priceFormat = PriceFormatter.GetPriceFormat(Pattern.Instrument);

                return(CheckStartPrice.ToString(priceFormat) + "[" + Pattern.CheckStartTime + "]→"
                       + CheckEndPrice.ToString(priceFormat) + "[" + Pattern.CheckEndTime + "](" +
                       (CheckStartPrice < CheckEndPrice ? "+" : "") + (CheckEndPrice - CheckStartPrice).ToString(priceFormat) + ")");
            }
示例#2
0
        public string GetTradeDescription(TradeContext tradeContext)
        {
            DateTime priceGettableTime = DateTime.Now.AddSeconds(-5);
            float    tradeStartPrice   = float.NaN;
            var      builder           = new StringBuilder();

            builder.Append(Time.ToString());
            builder.Append(" ");
            builder.Append(this.TradeType);
            builder.Append(" ");

            DateTime tradeStartDateTime = tradeContext.Date.AddTicks(this.Time.Ticks);

            if (tradeStartDateTime < priceGettableTime)
            {
                tradeStartPrice = tradeContext.GetPrice(tradeStartDateTime);
                builder.Append(PriceFormatter.Format(tradeStartPrice, Instrument));
            }
            else
            {
                builder.Append("???");
            }
            return(builder.ToString());
        }