public static string ShortenOrderOrigin(OrderOrigin orderOrigin) { switch (orderOrigin) { case OrderOrigin.PositionOpen: return("PO"); case OrderOrigin.PositionClose: return("PC"); case OrderOrigin.PositionClose_ContStop: return("PCS"); case OrderOrigin.PositionClose_ContLimit: return("PCL"); case OrderOrigin.PositionClose_TE: return("PCT"); case OrderOrigin.PositionClose_CircuitBreaker: return("PCB"); case OrderOrigin.PositionReverse_Close: return("PRC"); case OrderOrigin.PositionReverse_Open: return("PRO"); case OrderOrigin.PositionDouble: return("PD"); default: return(orderOrigin.ToString()); } }
/// <summary> /// Represents the position. /// </summary> public override string ToString() { string orderd = ""; string NL = Environment.NewLine; orderd += "Number " + (ordNumb + 1).ToString() + NL; orderd += "Direction " + ordDir.ToString() + NL; orderd += "Type " + ordType.ToString() + NL; orderd += "Condition " + ordCond.ToString() + NL; orderd += "Status " + ordStatus.ToString() + NL; orderd += "Sender " + ordSender.ToString() + NL; orderd += "Origin " + ordOrigin.ToString() + NL; orderd += "If order " + (ordIF + 1).ToString() + NL; orderd += "To pos " + (ordPos + 1).ToString() + NL; orderd += "Lots " + ordLots.ToString() + NL; orderd += "Price " + ordPrice.ToString() + NL; orderd += "Price2 " + ordPrice2.ToString() + NL; orderd += "Note " + ordNote.ToString() + NL; return(orderd); }