Ejemplo n.º 1
0
 public override String ToString()
 {
     if (_str == null)
     {
         if (Type == TradeOperation.OP_BUY || Type == TradeOperation.OP_SELL)
         {
             _str = "#" + TicketNumber
                    + (_wasLiveOrder ? "" : "*")
                    + " -> " + Type.ToString().Substring(3) + " " + Symbol
                    + (CloseTime != MT4.NotDefined &&
                       LotsBeforeClose > 0 && LotsClosed > 0 &&
                       (Math.Abs(LotsClosed - Lots) > 0 || Math.Abs(LotsBeforeClose - Lots) > 0)
                        ? $" ({LotsClosed} of {LotsBeforeClose})"
                        : " " + Lots)
                    + " @ " + OpenPrice + " at " + OpenTime + " profit=" +
                    Profit
                    + (CloseTime == MT4.NotDefined ? "" : " closed @ " + ClosePrice + " at " + CloseTime)
                    + (_prev > 0 ? " prev=" + _prev : "")
                    + (_next > 0 ? " next=" + _next : "")
                    + (_closedBy > 0 ? " cBy=" + _closedBy : "")
                    + (_closedHedgeOf > 0 ? " cHdg=" + _closedHedgeOf : "")
                    + (Magic != 0 ? " m=" + Magic : "")
                    + " " + Comment
             ;
         }
         else
         {
             _str = "#" + TicketNumber + " -> " + Type + " " + Symbol + " @ " + OpenPrice + ", SL=" + Sl + ", TP=" + Tp;
         }
     }
     //
     return(_str);
 }