public int CloseAllOrders(BinanceApiClient client, string symbol) { var orders = client.GetCurrentOpenOrders(symbol); foreach (var order in orders) { if (order.Side == "BUY") { client.PostNewOrder(m_Symbol, order.ExecutedQty, 0.0m, OrderSide.SELL, OrderType.MARKET); } else if (order.Side == "SELL") { client.PostNewOrder(m_Symbol, order.ExecutedQty, 0.0m, OrderSide.BUY, OrderType.MARKET); } } return(0); }