Example #1
0
        public void Initialize()
        {
            depth = new MtGoxDepthInfo();
            tradeListInFiveMin = new List <MtGoxTrade>();
            tradeListInOneMin  = new List <MtGoxTrade>();
            ticker             = new MtGoxTickerItem();

            for (int i = 0; i < 100; i++)
            {
                MtGoxAsk a = new MtGoxAsk();
                a.amount = i + 1;
                a.price  = i + 1;
                depth.asks.Add(a);
                MtGoxBid b = new MtGoxBid();
                b.amount = i + 1;
                b.price  = i + 1;
                depth.bids.Add(b);
                MtGoxTrade t = new MtGoxTrade();
                t.amount = i + 1;
                t.price  = i + 1;
                tradeListInFiveMin.Add(t);
                tradeListInOneMin.Add(t);
            }
            ticker.last = 5;
        }
Example #2
0
 /// <summary>
 /// 0/data/getTrades.php
 /// </summary>
 public List <MtGoxTrade> getTrades(string sinceTradeID)
 {
     try
     {
         string url      = (this.baseURL) + "0/data/getTrades.php";
         string postData = "";
         if (sinceTradeID != "")
         {
             url += "?since=" + sinceTradeID;
         }
         string responseStr = (new MtGoxNetTools()).DoAuthenticatedAPIPost(url, apiKey, apiSecret, postData);
         return(MtGoxTrade.getObjects(responseStr));
     }
     catch (Exception ex)
     {
         return(null);
     }
 }