static void Main(string[] args)
        {
            const string dataGridEndpoint = "https://api.refinitiv.com/data/datagrid/beta1/";

            try
            {
                // Create the platform session.
                using (ISession session = Configuration.Sessions.GetSession())
                {
                    // Open the session
                    session.Open();

                    IEndpoint endpoint = DeliveryFactory.CreateEndpoint(new Endpoint.Params().Session(session)
                                                                        .Url(dataGridEndpoint));

                    // Simple request
                    var response = endpoint.SendRequest(new Endpoint.Request.Params().WithMethod(Endpoint.Request.Method.POST)
                                                        .WithBodyParameters(new JObject()
                    {
                        { "universe", new JArray("TRI.N", "IBM.N") },
                        { "fields", new JArray("TR.Revenue", "TR.GrossProfit") }
                    }));
                    DisplayResponse(response);

                    // Global parameters
                    response = endpoint.SendRequest(new Endpoint.Request.Params().WithMethod(Endpoint.Request.Method.POST)
                                                    .WithBodyParameters(new JObject()
                    {
                        { "universe", new JArray("GOOG.O", "AAPL.O") },
                        { "fields", new JArray("TR.Revenue", "TR.GrossProfit") },
                        { "parameters", new JObject()
                          {
                              { "SDate", "0CY" },
                              { "Curn", "CAD" }
                          } }
                    }));
                    DisplayResponse(response);

                    // Historical data with specific date range
                    response = endpoint.SendRequest(new Endpoint.Request.Params().WithMethod(Endpoint.Request.Method.POST)
                                                    .WithBodyParameters(new JObject()
                    {
                        { "universe", new JArray("BHP.AX") },
                        { "fields", new JArray("TR.AdjmtFactorAdjustmentDate", "TR.AdjmtFactorAdjustmentFactor") },
                        { "parameters", new JObject()
                          {
                              { "SDate", "1980-01-01" },
                              { "EDate", "2018-09-29" }
                          } }
                    }));
                    DisplayResponse(response);
                }
            }
            catch (Exception e)
            {
                Console.WriteLine($"\n**************\nFailed to execute: {e.Message}\n{e.InnerException}\n***************");
            }
        }
Exemple #2
0
        static void Main(string[] args)
        {
            try
            {
                // Create the platform session.
                using (ISession session = Configuration.Sessions.GetSession())
                {
                    // Open the session
                    session.Open();

                    var endpoint = DeliveryFactory.CreateEndpoint(new Endpoint.Params().Session(session)
                                                                  .Url(symbolLookupEndpoint));

                    // RIC to multiple identifiers
                    Console.WriteLine("\nRIC to multiple identifiers...");
                    Display(endpoint.SendRequest(new Endpoint.Request.Params().WithMethod(Endpoint.Request.Method.POST)
                                                 .WithBodyParameters(new JObject()
                    {
                        ["from"] = new JArray(
                            new JObject()
                        {
                            ["identifierTypes"] = new JArray("RIC"),
                            ["values"]          = new JArray("MSFT.O")
                        }),
                        ["to"] = new JArray(
                            new JObject()
                        {
                            ["identifierTypes"] = new JArray("ISIN", "LEI", "ExchangeTicker")
                        }),
                        ["type"] = "auto"
                    })));

                    // Legal Entity Identifier (LEI) to multiple RICs
                    Console.WriteLine("LEI to multiple RICs...");
                    Display(endpoint.SendRequest(new Endpoint.Request.Params().WithMethod(Endpoint.Request.Method.POST)
                                                 .WithBodyParameters(new JObject()
                    {
                        ["from"] = new JArray(
                            new JObject()
                        {
                            ["identifierTypes"] = new JArray("LEI"),
                            ["values"]          = new JArray("INR2EJN1ERAN0W5ZP974")
                        }),
                        ["to"] = new JArray(
                            new JObject()
                        {
                            ["identifierTypes"] = new JArray("RIC")
                        }),
                        ["type"] = "auto"
                    })));
                }
            }
            catch (Exception e)
            {
                Console.WriteLine($"\n**************\nFailed to execute: {e.Message}\n{e.InnerException}\n***************");
            }
        }
Exemple #3
0
 public OptionChain(ISession session)
 {
     endpoint = DeliveryFactory.CreateEndpoint(new Endpoint.Params().Session(session)
                                               .Url(ChainEndpointUrl));
 }