コード例 #1
0
ファイル: IGStreamingApi.cs プロジェクト: w1r2p1/MiDax
        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);
        }
コード例 #2
0
ファイル: IGStreamingApi.cs プロジェクト: Laurent27/IGScalp
 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;
 }