private string ValidateOrder(string username, NewSingleOrder order)
        {
            if (OrdersManager.CallbackHasReqOrdID(order.RequesterOrderID))
            {
                return("Requested Order ID already existed for this session.");
            }
            if (order.DateTime.Date != DateTime.Today.Date)
            {
                return("Invalid DateTime");
            }
            if (DateTime.Now.Subtract(order.DateTime).Milliseconds > m_allowableOrderDelayInMilliSeconds)
            {
                return("Delayed Order");
            }
            Dictionary <string, object> optionalParam = order.OptionalParam;

            if (optionalParam != null)
            {
                bool aon = false;
                if (optionalParam.ContainsKey("AON") && (optionalParam["AON"] == null || !bool.TryParse(optionalParam["AON"].ToString(), out aon)))
                {
                    return("Invalid AON");
                }
                if (aon)
                {
                    if (!optionalParam.ContainsKey("MinQty"))
                    {
                        return("Missing Min. Qty");
                    }
                    int minq = 0;
                    if (optionalParam["MinQty"] == null || !int.TryParse(optionalParam["MinQty"].ToString(), out minq))
                    {
                        return("Invalid Min. Qty");
                    }
                    if (minq <= 0)
                    {
                        return("Invalid Min. Qty");
                    }
                    if (minq > order.Quantity)
                    {
                        return("Min. quantity should be equal or less than order's quantity");
                    }
                }

                if (optionalParam.ContainsKey(ALLOC_REQ_FIELDS.ALLOC_TYPE) && order.OrderSide == "Buy")
                {
                    bool isAllowBuyAllocation = Convert.ToBoolean(SystemConfigurations.GetAppSetting("AllowBuyAllocation"));
                    if (isAllowBuyAllocation == false)
                    {
                        return("Mcsd Allocation for buy orders is not allowed");
                    }
                }
            }

            return("valid");
        }