public StreamingAccountData StreamingAccountDataUpdates(int itemPos, string itemName, IUpdateInfo update)
        {
            var streamingAccountData = new StreamingAccountData();

            try
            {
                var pnl           = update.GetNewValue("PNL");
                var deposit       = update.GetNewValue("DEPOSIT");
                var usedMargin    = update.GetNewValue("USED_MARGIN");
                var amountDue     = update.GetNewValue("AMOUNT_DUE");
                var availableCash = update.GetNewValue("AVAILABLE_CASH");

                if (!String.IsNullOrEmpty(pnl))
                {
                    streamingAccountData.ProfitAndLoss = Convert.ToDecimal(pnl);
                }
                if (!String.IsNullOrEmpty(deposit))
                {
                    streamingAccountData.Deposit = Convert.ToDecimal(deposit);
                }
                if (!String.IsNullOrEmpty(usedMargin))
                {
                    streamingAccountData.UsedMargin = Convert.ToDecimal(usedMargin);
                }
                if (!String.IsNullOrEmpty(amountDue))
                {
                    streamingAccountData.AmountDue = Convert.ToDecimal(amountDue);
                }
                if (!String.IsNullOrEmpty(availableCash))
                {
                    streamingAccountData.AmountDue = Convert.ToDecimal(availableCash);
                }
            }
            catch (Exception)
            {
            }
            return(streamingAccountData);
        }
Ejemplo n.º 2
0
        public StreamingAccountData StreamingAccountDataUpdates(ItemUpdate update)
        {
            var streamingAccountData = new StreamingAccountData();

            try
            {
                var pnl           = update.getValue("PNL");
                var deposit       = update.getValue("DEPOSIT");
                var usedMargin    = update.getValue("USED_MARGIN");
                var amountDue     = update.getValue("AMOUNT_DUE");
                var availableCash = update.getValue("AVAILABLE_CASH");

                if (!string.IsNullOrEmpty(pnl))
                {
                    streamingAccountData.ProfitAndLoss = Convert.ToDecimal(pnl, CultureInfo.InvariantCulture);
                }
                if (!string.IsNullOrEmpty(deposit))
                {
                    streamingAccountData.Deposit = Convert.ToDecimal(deposit, CultureInfo.InvariantCulture);
                }
                if (!string.IsNullOrEmpty(usedMargin))
                {
                    streamingAccountData.UsedMargin = Convert.ToDecimal(usedMargin, CultureInfo.InvariantCulture);
                }
                if (!string.IsNullOrEmpty(amountDue))
                {
                    streamingAccountData.AmountDue = Convert.ToDecimal(amountDue, CultureInfo.InvariantCulture);
                }
                if (!string.IsNullOrEmpty(availableCash))
                {
                    streamingAccountData.AmountDue = Convert.ToDecimal(availableCash, CultureInfo.InvariantCulture);
                }
            }
            catch (Exception)
            {
            }
            return(streamingAccountData);
        }