public async Task ChildOrder() { await apiClient.CancelAllOrders(new CancelAllOrdersParameter { ProductCode = ProductCode.FxBtcJpy }); var res1 = await apiClient.SendChildOrder(new SendChildOrderParameter { ProductCode = ProductCode.FxBtcJpy, ChildOrderType = ChildOrderType.Limit, Side = Side.Buy, Price = buyPrice, Size = OrderSize, MinuteToExpire = 10000, TimeInForce = TimeInForce.GoodTilCanceled }); var childOrderAcceptanceId = res1?.ChildOrderAcceptanceId; Assert.NotNull(childOrderAcceptanceId); var health = await PublicApi.GetHealth(ProductCode.FxBtcJpy); ThreadSleep(health.Status); var res2 = await apiClient.GetChildOrders(ProductCode.FxBtcJpy, childOrderState : ChildOrderState.Active); Assert.Contains(res2, x => x.ProductCode == ProductCode.FxBtcJpy); var resSingle = await apiClient.GetChildOrder(ProductCode.FxBtcJpy, res2.First().Id); Assert.NotNull(resSingle); await apiClient.CancelChildOrder(new CancelChildOrderParameter { ProductCode = ProductCode.FxBtcJpy, ChildOrderAcceptanceId = childOrderAcceptanceId }); await Task.WhenAll(Enumerable.Range(0, 3).Select(_ => apiClient.SendChildOrder(new SendChildOrderParameter { ProductCode = ProductCode.FxBtcJpy, ChildOrderType = ChildOrderType.Limit, Side = Side.Buy, Price = buyPrice, Size = OrderSize, MinuteToExpire = 10000, TimeInForce = TimeInForce.GoodTilCanceled }))); ThreadSleep(health.Status); await apiClient.CancelAllOrders(new CancelAllOrdersParameter { ProductCode = ProductCode.FxBtcJpy }); ThreadSleep(health.Status); var res3 = await apiClient.GetChildOrders(ProductCode.FxBtcJpy, childOrderState : ChildOrderState.Active); Assert.True(res3.Count(x => x.ProductCode == ProductCode.FxBtcJpy) == 0); }