/// <summary>
        /// 
        /// </summary>
        /// <param name="Command"></param>
        /// <returns></returns>
        public bool CheckValidAccountInvestor(Business.OpenTrade Command)
        {
            bool Result = false;
            if (Command != null)
            {
                //Calculator Margin Level
                double tempMarginLevel = 0;
                double tempProfit = 0;
                double tempTotalMargin = 0;
                double tempEquity = 0;
                double tempFreeMargin = 0;
                double marginPending = 0;
                double marginCommand = 0;
                bool isExits = false;

                List<Business.OpenTrade> tempOpenTrade = new List<OpenTrade>();
                List<Business.OpenTrade> listPending = new List<OpenTrade>();
                if (Command.Investor.CommandList != null)
                {
                    int count = Command.Investor.CommandList.Count;
                    for (int i = 0; i < count; i++)
                    {
                        if (Command.Investor.CommandList[i].ID == Command.ID)
                            isExits = true;

                        bool isPending = TradingServer.Model.TradingCalculate.Instance.CheckIsPendingPosition(Command.Investor.CommandList[i].Type.ID);
                        if (isPending)
                        {
                            Command.CalculatorMarginCommand(Command.Investor.CommandList[i]);
                            listPending.Add(Command.Investor.CommandList[i]);
                        }
                        else
                        {
                            Command.CalculatorMarginCommand(Command.Investor.CommandList[i]);
                            tempOpenTrade.Add(Command.Investor.CommandList[i]);
                        }

                        //if (Command.Investor.CommandList[i].Type.ID == 7 ||
                        //    Command.Investor.CommandList[i].Type.ID == 8 ||
                        //    Command.Investor.CommandList[i].Type.ID == 9 ||
                        //    Command.Investor.CommandList[i].Type.ID == 10 ||
                        //    Command.Investor.CommandList[i].Type.ID == 17 ||
                        //    Command.Investor.CommandList[i].Type.ID == 18 ||
                        //    Command.Investor.CommandList[i].Type.ID == 19 ||
                        //    Command.Investor.CommandList[i].Type.ID == 20)
                        //{
                        //    if (Command.Type.ID == 7 || Command.Type.ID == 8 || Command.Type.ID == 9 || Command.Type.ID == 10 ||
                        //        Command.Type.ID == 17 || Command.Type.ID == 18 || Command.Type.ID == 19 || Command.Type.ID == 20)
                        //    {
                        //        Command.CalculatorMarginCommand(Command.Investor.CommandList[i]);
                        //        listPending.Add(Command.Investor.CommandList[i]);
                        //        marginPending += Command.Investor.CommandList[i].Margin;
                        //    }
                        //}
                        //else
                        //{
                        //tempOpenTrade.Add(Command.Investor.CommandList[i]);
                        //}
                    }
                }

                Command.CalculatorMarginCommand(Command);

                if (!isExits)
                {
                    bool isPendingCommand = TradingServer.Model.TradingCalculate.Instance.CheckIsPendingPosition(Command.Type.ID);
                    if (isPendingCommand)
                        listPending.Add(Command);
                    else
                        tempOpenTrade.Add(Command);
                }

                //Business.Margin newMargin = new Business.Margin();
                //newMargin = Command.Symbol.CalculationTotalMargin(tempOpenTrade);
                ////marginCommand = newMargin.TotalMargin + newMargin.TotalFreezeMargin;
                //marginCommand = newMargin.TotalFreezeMargin;

                Business.Margin newMargin = new Business.Margin();
                newMargin = Command.Symbol.CalculationTotalMarginPending(listPending, tempOpenTrade);
                //tempTotalMargin = marginCommand + marginPending;
                tempTotalMargin = newMargin.TotalMargin + newMargin.TotalFreezeMargin;

                //if (Command.Type.ID == 7 || Command.Type.ID == 8 || Command.Type.ID == 9 || Command.Type.ID == 10 ||
                //    Command.Type.ID == 17 || Command.Type.ID == 18 || Command.Type.ID == 19 || Command.Type.ID == 20)
                //{
                //    tempTotalMargin = marginCommand + Command.Margin + marginPending;
                //}
                //else
                //{
                //    tempTotalMargin = marginCommand;
                //}

                tempProfit = Command.Investor.Profit + Command.Profit;
                tempEquity = Command.Investor.Balance + Command.Investor.Credit + tempProfit;
                tempFreeMargin = tempEquity - tempTotalMargin;
                tempMarginLevel = (tempEquity * 100) / tempTotalMargin;

                if (tempMarginLevel >= 100)
                {
                    Result = true;
                }
                else
                {
                    Result = false;
                }
            }

            return Result;
        }