public void TestSequence()
 {
     GetBalances();
     UpdatePrices();
     Spot.Symbol sym = BinanceSpot.RandomSymbol();
     GetKLines(sym);
     GetOrderBook(sym);
 }
    public Spot.BinanceOrder PlaceMinBuyOrder(Spot.Symbol sym)
    {
        double price = sym.avgPrice / 2;  // we are lucky enough to buy that cheap

        price = Math.Round((price - sym.priceFilter.minPrice) / sym.priceFilter.tickSize);
        price = price * sym.priceFilter.tickSize + sym.priceFilter.minPrice;

        double quantity = Math.Max(sym.lotFilter.minQty, sym.notionalFilter.minNotional / price);

        quantity = Math.Round((quantity - sym.lotFilter.minQty) / sym.lotFilter.stepSize) + 1;
        quantity = quantity * sym.lotFilter.stepSize + sym.lotFilter.minQty;

        return(PlaceBuyOrder(sym.symbol, quantity, price));
    }
 public void GetOrderBook(Spot.Symbol sym)
 {
     string rawData = DoRestRequest("depth", $"symbol={sym.symbol}&limit=100");
 }
 public void GetKLines(Spot.Symbol sym)
 {
     string rawData = DoRestRequest("klines", $"symbol={sym.symbol}&interval=5m");
 }