示例#1
0
        static void Main(string[] _)
        {
            try
            {
                // Create the platform session.
                using (ISession session = Configuration.Sessions.GetSession())
                {
                    // Open the session
                    session.Open();

                    // Historical content
                    var response = FundamentalAndReference.Definition().Universe("AMCATMIV.AX", "BTATMIV.L", "4183ATMIV.OS",
                                                                                 "AATMIV.U", "STXEATMIV.EX", "1101ATMIV.TM", "0001ATMIV.HK")
                                   .Fields("TR.90DAYATTHEMONEYIMPLIEDVOLATILITYINDEXFORCALLOPTIONS.date",
                                           "TR.90DAYATTHEMONEYIMPLIEDVOLATILITYINDEXFORCALLOPTIONS")
                                   .Parameters(new JObject()
                    {
                        { "SDATE", "0d" },
                        { "EDATE", "-4d" }
                    }).GetData();
                    Common.DisplayTable("Valid request with historical fields", response);

                    // Last Month End, in Euros
                    response = FundamentalAndReference.Definition().Universe("GOOG.O", "AAPL.O")
                               .Fields("TR.RevenueMean", "TR.NetProfitMean")
                               .Parameters(new JObject()
                    {
                        { "SDate", "0M" },
                        { "Curn", "EUR" }
                    }).GetData();
                    Common.DisplayTable("Last Month End, in Euros", response);
                }
            }
            catch (Exception e)
            {
                Console.WriteLine($"\n**************\nFailed to execute: {e.Message}\n{e.InnerException}\n***************");
            }
        }
        static void Main(string[] _)
        {
            try
            {
                // Create a session into the desktop
                // Note: The Fundamental and Reference API is only available on the desktop.
                using (ISession session = Configuration.Sessions.GetSession(Configuration.Sessions.SessionTypeEnum.DESKTOP))
                {
                    // Open the session
                    session.Open();

                    // Reference data
                    var response = FundamentalAndReference.Definition().Universe("TRI.N", "IBM.N")
                                   .Fields("TR.Revenue", "TR.GrossProfit")
                                   .GetData();
                    Common.DisplayTable("Reference Data", response);
                }
            }
            catch (Exception e)
            {
                Console.WriteLine($"\n**************\nFailed to execute: {e.Message}\n{e.InnerException}\n***************");
            }
        }