public static string ContingentConditionTypeString(CTPContingentConditionType type, double price) { switch (type) { case CTPContingentConditionType.Immediately: return("立即"); case CTPContingentConditionType.Touch: return("止损"); case CTPContingentConditionType.TouchProfit: return("止赢"); case CTPContingentConditionType.ParkedOrder: return("预埋单"); case CTPContingentConditionType.LastPriceGreaterThanStopPrice: return(string.Format("最新价>{0}", price)); case CTPContingentConditionType.LastPriceGreaterEqualStopPrice: return(string.Format("最新价>={0}", price)); case CTPContingentConditionType.LastPriceLesserThanStopPrice: return(string.Format("最新价<{0}", price)); case CTPContingentConditionType.LastPriceLesserEqualStopPrice: return(string.Format("最新价<={0}", price)); case CTPContingentConditionType.AskPriceGreaterThanStopPrice: return(string.Format("卖价>{0}", price)); case CTPContingentConditionType.AskPriceGreaterEqualStopPrice: return(string.Format("卖价>={0}", price)); case CTPContingentConditionType.AskPriceLesserThanStopPrice: return(string.Format("卖价<{0}", price)); case CTPContingentConditionType.AskPriceLesserEqualStopPrice: return(string.Format("卖价<={0}", price)); case CTPContingentConditionType.BidPriceGreaterThanStopPrice: return(string.Format("买价>{0}", price)); case CTPContingentConditionType.BidPriceGreaterEqualStopPrice: return(string.Format("买价>={0}", price)); case CTPContingentConditionType.BidPriceLesserThanStopPrice: return(string.Format("买价<{0}", price)); case CTPContingentConditionType.BidPriceLesserEqualStopPrice: return(string.Format("买价<={0}", price)); default: return(""); } }
public static string ContingentConditionTypeString(CTPContingentConditionType type) { switch (type) { case CTPContingentConditionType.Immediately: break; case CTPContingentConditionType.Touch: break; case CTPContingentConditionType.TouchProfit: break; case CTPContingentConditionType.ParkedOrder: break; default: break; } switch (type) { case CTPContingentConditionType.Immediately: return("立即"); case CTPContingentConditionType.Touch: return("止损"); case CTPContingentConditionType.TouchProfit: return("止赢"); case CTPContingentConditionType.ParkedOrder: return("预埋单"); case CTPContingentConditionType.LastPriceGreaterThanStopPrice: return("最新价>条件价"); case CTPContingentConditionType.LastPriceGreaterEqualStopPrice: return("最新价>=条件价"); case CTPContingentConditionType.LastPriceLesserThanStopPrice: return("最新价<条件价"); case CTPContingentConditionType.LastPriceLesserEqualStopPrice: return("最新价<=条件价"); case CTPContingentConditionType.AskPriceGreaterThanStopPrice: return("卖1价>条件价"); case CTPContingentConditionType.AskPriceGreaterEqualStopPrice: return("卖1价>=条件价"); case CTPContingentConditionType.AskPriceLesserThanStopPrice: return("卖1价<条件价"); case CTPContingentConditionType.AskPriceLesserEqualStopPrice: return("卖1价<=条件价"); case CTPContingentConditionType.BidPriceGreaterThanStopPrice: return("买1价>条件价"); case CTPContingentConditionType.BidPriceGreaterEqualStopPrice: return("买1价>=条件价"); case CTPContingentConditionType.BidPriceLesserThanStopPrice: return("买1价<条件价"); case CTPContingentConditionType.BidPriceLesserEqualStopPrice: return("买1价<=条件价"); default: return(""); } ///// //Touch = (byte)'2', ///// //TouchProfit = (byte)'3', ///// //ParkedOrder = (byte)'4', //StopPriceGreaterThanLastPrice = (byte)'5', ///// //StopPriceGreaterEqualLastPrice = (byte)'6', ///// //StopPriceLesserThanLastPrice = (byte)'7', ///// //StopPriceLesserEqualLastPrice = (byte)'8', ///// //StopPriceGreaterThanAskPrice = (byte)'9', ///// //StopPriceGreaterEqualAskPrice = (byte)'A', ///// //StopPriceLesserThanAskPrice = (byte)'B', ///// //StopPriceLesserEqualAskPrice = (byte)'C', ///// //StopPriceGreaterThanBidPrice = (byte)'D', ///// //StopPriceGreaterEqualBidPrice = (byte)'E', ///// //StopPriceLesserThanBidPrice = (byte)'F', ///// //StopPriceLesserEqualBidPrice = (byte)'a' }