示例#1
0
    private void Run()
    {
        Random rnd = new Random();

        Thread.Sleep(rnd.Next(100, 1500));          // dont push all orders at once

        BinanceClient bClient = new BinanceClient();

        Spot.BinanceOrder order = bClient.PlaceMinBuyOrder(BinanceSpot.RandomSymbol());
        if (order == null)
        {
            return;
        }

        Interlocked.Increment(ref workersCount);

        for (int i = 0; i < 50; i++)
        {
            if (!Terminated)
            {
                DoSleep(6000);
                bClient.CheckOrder(order);
            }
        }

        bClient.CancelOrder(order);
        Thread.Sleep(500);

        Interlocked.Decrement(ref workersCount);
    }
 public void TestSequence()
 {
     GetBalances();
     UpdatePrices();
     Spot.Symbol sym = BinanceSpot.RandomSymbol();
     GetKLines(sym);
     GetOrderBook(sym);
 }