public void should_amend_sell_limit_orders_bulk() { // arrange var @params = new OrderBulkPOSTRequestParams { Orders = new[] { OrderPOSTRequestParams.CreateSimpleHidenLimit("XBTUSD", 3, _xbtAvgPrice + LimitPriceSubtractor, OrderSide.Sell), OrderPOSTRequestParams.CreateSimpleHidenLimit("XBTUSD", 3, _xbtAvgPrice + LimitPriceSubtractor, OrderSide.Sell) } }; var result = Sut.Execute(BitmexApiUrls.Order.PostOrderBulk, @params).Result.Result; result.Should().NotBeNull(); result.All(a => a.OrdStatus == "New").Should().BeTrue(); result.All(a => !string.IsNullOrWhiteSpace(a.OrderId)).Should().BeTrue(); var @paramsPut = new OrderBulkPUTRequestParams() { Orders = result.Select(a => new OrderPUTRequestParams() { OrderID = a.OrderId, OrderQty = 2, }).ToArray() }; // act var resultPut = Sut.Execute(BitmexApiUrls.Order.PutOrderBulk, @paramsPut).Result.Result; // assert resultPut.Should().NotBeNull(); resultPut.All(a => a.OrdStatus == "New").Should().BeTrue(); resultPut.All(a => a.OrderQty == 2).Should().BeTrue(); resultPut.All(a => !string.IsNullOrWhiteSpace(a.OrderId)).Should().BeTrue(); }
public void should_delete_many_buy_orders() { // arrange var @params = new OrderBulkPOSTRequestParams { Orders = new[] { OrderPOSTRequestParams.CreateSimpleHidenLimit("XBTUSD", 3, _xbtAvgPrice - LimitPriceSubtractor, OrderSide.Buy), OrderPOSTRequestParams.CreateSimpleHidenLimit("XBTUSD", 3, _xbtAvgPrice - LimitPriceSubtractor, OrderSide.Buy) } }; var resultInsert = Sut.Execute(BitmexApiUrls.Order.PostOrderBulk, @params).Result.Result; // act var @paramsToDelete = new OrderDELETERequestParams { OrderID = string.Join(",", resultInsert.Select(a => a.OrderId)) }; var result = Sut.Execute(BitmexApiUrls.Order.DeleteOrder, @paramsToDelete).Result.Result; // assert result.Should().NotBeNull(); result.All(a => a.OrdStatus == "Canceled").Should().BeTrue(); result.All(a => !string.IsNullOrWhiteSpace(a.OrderId)).Should().BeTrue(); }
public void should_place_sell_limit_orders_bulk() { // arrange var @params = new OrderBulkPOSTRequestParams { Orders = new[] { OrderPOSTRequestParams.CreateSimpleLimit("XBTUSD", 3, _xbtAvgPrice + LimitPriceSubtractor, OrderSide.Sell), OrderPOSTRequestParams.CreateSimpleLimit("XBTUSD", 3, _xbtAvgPrice + LimitPriceSubtractor, OrderSide.Sell) } }; // act var result = Sut.Execute(BitmexApiUrls.Order.PostOrderBulk, @params).Result.Result; // assert result.Should().NotBeNull(); result.All(a => a.OrdStatus == "New").Should().BeTrue(); result.All(a => !string.IsNullOrWhiteSpace(a.OrderId)).Should().BeTrue(); }
public void should_place_buy_market_orders_bulk() { // arrange var @params = new OrderBulkPOSTRequestParams { Orders = new[] { OrderPOSTRequestParams.CreateSimpleMarket("XBTUSD", 3, OrderSide.Buy), OrderPOSTRequestParams.CreateSimpleMarket("XBTUSD", 3, OrderSide.Buy) } }; // act var result = Sut.Execute(BitmexApiUrls.Order.PostOrderBulk, @params).Result; // assert result.Should().NotBeNull(); result.All(a => a.OrdStatus == "Filled").Should().BeTrue(); result.All(a => !string.IsNullOrWhiteSpace(a.OrderId)).Should().BeTrue(); }