コード例 #1
0
ファイル: MtGoxAPIV0.cs プロジェクト: iamapi/MtgoxTrader
 /// <summary>
 /// 0/buyBTC.php 
 /// </summary>
 public List<MtGoxOrder> buyBTC(double amount, MtGoxCurrencySymbol currency, double price = 0.0)
 {
     try
     {
         string url = (this.baseURL) + "0/buyBTC.php";
         string postData;
         if (price == 0.0)
             postData = "amount=" + amount + "&currency=" + currency.ToString();
         else
             postData = "amount=" + amount + "&price=" + price + "&currency=" + currency.ToString();
         string responseStr = (new MtGoxNetTools()).DoAuthenticatedAPIPost(url, apiKey, apiSecret, postData);
         return MtGoxOrder.getObjects(responseStr);
     }
     catch (Exception ex)
     {
         return null;
     }
 }
コード例 #2
0
 /// <summary>
 /// 0/history_[CUR].csv
 /// </summary>
 public string history_CUR(MtGoxCurrencySymbol currency)
 {
     try
     {
         string url         = (this.baseURL) + "0/history_" + currency.ToString() + ".csv";
         string postData    = "";
         string responseStr = (new MtGoxNetTools()).DoAuthenticatedAPIPost(url, apiKey, apiSecret, postData);
         return(responseStr);
     }
     catch (Exception ex)
     {
         return(null);
     }
 }
コード例 #3
0
 /// <summary>
 /// 0/buyBTC.php
 /// </summary>
 public List <MtGoxOrder> buyBTC(double amount, MtGoxCurrencySymbol currency, double price = 0.0)
 {
     try
     {
         string url = (this.baseURL) + "0/buyBTC.php";
         string postData;
         if (price == 0.0)
         {
             postData = "amount=" + amount + "&currency=" + currency.ToString();
         }
         else
         {
             postData = "amount=" + amount + "&price=" + price + "&currency=" + currency.ToString();
         }
         string responseStr = (new MtGoxNetTools()).DoAuthenticatedAPIPost(url, apiKey, apiSecret, postData);
         return(MtGoxOrder.getObjects(responseStr));
     }
     catch (Exception ex)
     {
         return(null);
     }
 }
コード例 #4
0
        /// <summary>
        /// 0/data/getDepth.php
        /// </summary>
        public MtGoxDepthInfo getDepth(MtGoxCurrencySymbol currency)
        {
            try
            {
                string url         = (this.baseURL) + "0/data/getDepth.php?currency=" + currency.ToString();
                string postData    = "";
                string responseStr = (new MtGoxNetTools()).DoAuthenticatedAPIPost(url, apiKey, apiSecret, postData);

                MtGoxDepthInfo returnValue = MtGoxDepthInfo.getObjects(responseStr);

                return(returnValue);
            }
            catch (Exception ex)
            {
                return(null);
            }
        }
コード例 #5
0
ファイル: MtGoxAPIV0.cs プロジェクト: iamapi/MtgoxTrader
 /// <summary>
 /// 0/history_[CUR].csv
 /// </summary>
 public string history_CUR(MtGoxCurrencySymbol currency)
 {
     try
     {
         string url = (this.baseURL) + "0/history_" + currency.ToString() + ".csv";
         string postData = "";
         string responseStr = (new MtGoxNetTools()).DoAuthenticatedAPIPost(url, apiKey, apiSecret, postData);
         return responseStr;
     }
     catch (Exception ex)
     {
         return null;
     }
 }
コード例 #6
0
ファイル: MtGoxAPIV0.cs プロジェクト: iamapi/MtgoxTrader
        /// <summary>
        /// 0/data/getDepth.php 
        /// </summary>
        public MtGoxDepthInfo getDepth(MtGoxCurrencySymbol currency)
        {
            try
            {
                string url = (this.baseURL) + "0/data/getDepth.php?currency=" + currency.ToString();
                string postData = "";
                string responseStr = (new MtGoxNetTools()).DoAuthenticatedAPIPost(url, apiKey, apiSecret, postData);

                MtGoxDepthInfo returnValue = MtGoxDepthInfo.getObjects(responseStr);

                return returnValue;

            }
            catch (Exception ex)
            {
                return null;
            }
        }