Exemple #1
0
 public static void WriteCurveOrderRequest(CurveOrderRequest curveOrderRequest)
 {
     Console.WriteLine("---");
     Console.WriteLine($"AuctionId: {curveOrderRequest.AuctionId}");
     Console.WriteLine($"AreaCode: {curveOrderRequest.AreaCode}");
     Console.WriteLine($"Portfolio: {curveOrderRequest.Portfolio}");
     WriteCurves(curveOrderRequest);
     Console.WriteLine("---");
 }
Exemple #2
0
 private static void WriteCurves(CurveOrderRequest curveOrderRequest)
 {
     Console.WriteLine("Curves:");
     foreach (var curve in curveOrderRequest.Curves)
     {
         Console.WriteLine($"Curve contract: {curve.ContractId}");
         Console.WriteLine($"Prices:\t\t{string.Join("\t", curve.CurvePoints.Select(x => x.Price))}");
         Console.WriteLine($"Volumes:\t{string.Join("\t", curve.CurvePoints.Select(x => x.Volume))}");
         Console.WriteLine("");
     }
 }
Exemple #3
0
 public static async Task <CurveOrder> PlaceCurveOrder(this IAuctionApiClient apiClient,
                                                       CurveOrderRequest curveOrder)
 {
     try
     {
         return(await apiClient.PostCurveOrderAsync(curveOrder));
     }
     catch (ApiException exception)
     {
         throw ConstructApiException(exception);
     }
 }
Exemple #4
0
        public static CurveOrderRequest GenerateStaticCurveOrderRequest(string portfolio, string areaCode,
                                                                        Auction auction, double minPrice = -500.0d, double maxPrice = -1500.0d)
        {
            var curveOrderRequest = new CurveOrderRequest
            {
                AreaCode  = areaCode,
                Portfolio = portfolio,
                AuctionId = auction.Id,
                Curves    = GenerateCurves(auction, minPrice, maxPrice).ToList()
            };

            return(curveOrderRequest);
        }