public override SqlParameter[] buildParameters(Order order_)
        {
            SqlParameter[] paras = new SqlParameter[19];
            AlgoTrading.Util.ClientOrder clientOrder = order_.getClientOrder();

            paras[0] = new SqlParameter("@orderId", order_.getOrderHandler().clOrdId);
            //todo:
            paras[1]  = new SqlParameter("@EnableCondition", Convert.ToInt32(clientOrder.useConditionControl));
            paras[2]  = new SqlParameter("@ReferenceIndex", clientOrder.referenceIndex);
            paras[3]  = new SqlParameter("@TradingCondition", clientOrder.tradingCondition);
            paras[4]  = new SqlParameter("@IsAbsolutePx", Convert.ToInt32(clientOrder.useAbsolutePx));
            paras[5]  = new SqlParameter("@RefPrice", clientOrder.refPrice);
            paras[6]  = new SqlParameter("@PxType", clientOrder.pxType);
            paras[7]  = new SqlParameter("@RelativePriceLimitOffset", clientOrder.relativePriceLimitOffset);
            paras[8]  = new SqlParameter("@EligibleToTrading", Convert.ToInt32(clientOrder.eligibleToTrading));
            paras[9]  = new SqlParameter("@AutoPauseResume", Convert.ToInt32(clientOrder.autoPauseResume));
            paras[10] = new SqlParameter("@BuyOnUpLimit", Convert.ToInt32(clientOrder.buyOnUpLimit));
            paras[11] = new SqlParameter("@SellOnUpLimit", Convert.ToInt32(clientOrder.sellOnUpLimit));
            paras[12] = new SqlParameter("@BuyOnDownLimit", Convert.ToInt32(clientOrder.buyOnDownLimit));
            paras[13] = new SqlParameter("@SellOnDownLimit", Convert.ToInt32(clientOrder.sellOnDownLimit));
            paras[14] = new SqlParameter("@CustomizedMinute", (int)clientOrder.customizedRollingIntervalInSecs);
            paras[15] = new SqlParameter("@CustomizedPctOfPx", clientOrder.customizedPctOfPx);
            paras[16] = new SqlParameter("@CancelRate", clientOrder.cancelRate);
            paras[17] = new SqlParameter("@lastUpdDt", DateTime.Now);
            paras[18] = new SqlParameter("@lastUpdId", lastUpdId);
            orderCount++;

            logSqlParas(paras, logger);
            return(paras);
        }
        public override SqlParameter[] buildParameters(Order order_)
        {
            SqlParameter[] paras = new SqlParameter[30];
            AlgoTrading.Util.ClientOrder clientOrder = order_.getClientOrder();

            paras[0]  = new SqlParameter("@accountId", order_.getAccountId());
            paras[1]  = new SqlParameter("@orderId", order_.getOrderHandler().clOrdId);
            paras[2]  = new SqlParameter("@instance", getEngineIndex(currentInstance));
            paras[3]  = new SqlParameter("@symbol", clientOrder.mdSymbol);
            paras[4]  = new SqlParameter("@tradingDay", order_.getTradingDay());
            paras[5]  = new SqlParameter("@exDestination", getDestinationValue(clientOrder.exDestination));
            paras[6]  = new SqlParameter("@orderStatus", (int)clientOrder.orderStatus);
            paras[7]  = new SqlParameter("@orderState", (int)clientOrder.orderState);
            paras[8]  = new SqlParameter("@side", (int)clientOrder.side);
            paras[9]  = new SqlParameter("@type", (int)clientOrder.type);
            paras[10] = new SqlParameter("@price", clientOrder.price);
            paras[11] = new SqlParameter("@avgPrice", clientOrder.avgPrice);
            paras[12] = new SqlParameter("@slipageInBps", order_.getOrderSlipage());
            paras[13] = new SqlParameter("@algo", (int)clientOrder.orderAlgo);
            paras[14] = new SqlParameter("@effectiveTime", base.getValidTime(clientOrder.effectiveTime));
            paras[15] = new SqlParameter("@expireTime", base.getValidTime(clientOrder.expireTime));
            paras[16] = new SqlParameter("@cumQty", clientOrder.cumQty);
            paras[17] = new SqlParameter("@leavesQty", clientOrder.leavesQty);
            paras[18] = new SqlParameter("@orderQty", clientOrder.orderQty);
            paras[19] = new SqlParameter("@iVWP", order_.getIVWP());
            paras[20] = new SqlParameter("@iVWPVS", order_.getIVWPVS());
            paras[21] = new SqlParameter("@actualPov", order_.getActualPov());
            paras[22] = new SqlParameter("@clientId", clientOrder.clientID);
            paras[23] = new SqlParameter("@pctAdv20", order_.getPctAdv20());
            paras[24] = new SqlParameter("@adv20", order_.getAdv20());
            paras[25] = new SqlParameter("@securityType", (int)clientOrder.securityType);

            // If not set in log, deserialized result is 0; need to set to -1, which means UNKNOWN in engine dll.
            int marginType = (int)clientOrder.marginType != 0 ? (int)clientOrder.marginType : -1;

            paras[26] = new SqlParameter("@marginType", marginType);
            paras[27] = new SqlParameter("@participationRate", clientOrder.participationRate);
            paras[28] = new SqlParameter("@lastUpdDt", DateTime.Now);
            paras[29] = new SqlParameter("@lastUpdId", lastUpdId);

            orderCount++;
            logSqlParas(paras, logger);
            return(paras);
        }