Exemple #1
0
        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);
        }
Exemple #2
0
 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;
 }