Security Master

The Security Master module handles the objects and data that represent the more abstract concept of a company. The Security_Master contains three classes in all: the Company class, representing a company and its associated data such as sector, industry etc., the Instrument Class, representing a company’s stock or equity, and the Universe Class made to represent a number of companies within a certain set of filters.


Company

The Company Class allows you to create an object representing a specific company that will initialize its basic information such as the industry name. Note that the initializing of Company will not bind any relevant financial data such as KPIs to the Company class.

Company object is created using either a CompanyID or InstrumentID. From this information, the constructor will fetch the appropriate data from the Quantamatics Database and bind said data to the Company object.

Parameters

companyID

An Integer value that is unique to each company. This value can be used to initialize the Company object

instrumentId

An Integer value that is unique to each Instrument. This value can be used to initialize the Company object


Instrument

The Instrument object refers to the security of a particular company. From here, much of the data surrounding a particular company such as brands, calendar periods, and KPIs can be found.

The Instrument class is where the majority of a company’s financial data will be accessed. Additionally, symbology will also be available through the instrument object.

The instrument class also contains options for preloading upon the initializing of an instrument object to automatically set data such as financial statements, calendar periods, and companies based on the preLoadLevel.

One of two arguments may be passed to initialize an Instrument, an instrumentId or instrumentSymbol, essentially the ticker symbol of that company. There will also need to be passed the instrumentSymbologyType referring to which version the provided symbol is from.

The Quantamatics API will use the provided Id or Symbol along with the symbology type to return the Instrument from the Quantamatics Database, setting any of the instrument’s fields accordingly.

Parameters

instrumentSymbol

A string value automatically set to None. This value is one way in which the Instrument object may be initialized. Examples may include “BBBY” for the company of Bed Bath and Beyond or “TGT” for the company of Target.

instrumentID

An integer value automatically set to None. This value is one way in which the Instrument object may be initialized. This value may be a simple number such as 280.

instrumentSymbologyType

Refers to the type of Alias that is being passed in the instrumentID. Note that there is a high chance of Exceptions being raised if ever instrumentSymbologyType is not passed as a parameter.

preLoadLevel

The preLoadLevel dictates the extent of data that will be preloaded upon the initializing of the instrument object. This value will automatically be set to 0 meaning no preloading will be done.

A value of 1 means that the instrument’s Company object will be preloaded using the Company constructor from the Security Master module.

A value of 2 means that the instrument’s Calendar Periods object will be preloaded using the CalendarPeriods constructor from the Fundamentals module.

A value of 3 means that the instrument’s Financial Statement object will be preloaded using the FinancialStatement constructor from the Fundamentals module


Methods

getFinancialStatement()

This method will return the FinancialStatement object attached to the instrument. This value may have been set upon the creation of the instrument given a preLoadLevel of 3 or more. If this value has not been set, the FinancialStatement() Constructor will be called to populate it.

getCalendarPeriods()

This method will return the CalendarPeriods object attached to the instrument . This value may have been set upon the creation of the instrument given a preLoadLevel of 2. If this value has not been set, the CalendarPeriods() Constructor will be called to populate it.

getCompany()

This method will return the Company object attached to the instrument . This value may have been set upon the creation of the instrument given a preLoadLevel of 1. If this value has not been set, the Company() Constructor will be called to populate it.

getSymbology()

Returns a Dictionary of strings outlining the alias a given instrument’s symbol may take for a given institution. Will make a GET request to the Quantamatics API using the object’s instrumentID to retrieve this data.

getBrands()

Returns a DataFrame containing the different Brands that exist under the instrument as well as their instrument, company, and brand IDs. When given a parameter, this method may be specified to return only one brand and its information.


Universe

The Universe class is used to represent a collection of instruments with the scope of that collection being determined by several filters passed as parameters. A Universe Object has exactly one field which is the Universe DataFrame, containing the data for the specified scope of Instruments, their IDs, symbols and much more.

A Universe object can be very useful for finding an assortment of Instruments to analyze and compare balance sheets and KPIs with the InstrumentID being listed as part of the Universe DataFrame.

When creating a Universe, several parameters can be passed to filter the scope of applicable Instruments. When creating a Universe, the sector and industry parameters will be the most used in terms of filtering, but all five parameters will be used to send a request to the Quantamatics API and retrieve the appropriate data.

Parameters

sector

A String value automatically set to None. This will filter the scope of Instruments based on the sector the Instruments are listed under. Examples include Consumer Discretionary and Information Technology.

industry

A String value automatically set to None. This will filter the scope of Instruments based on the industry the Instruments are listed under. Examples include Machinery, IT Services, and Specialty Retail.

instrumentSymbol

A String value automatically set to None. This is the most filtering of the available parameters, narrowing the scope to a single Instrument and creating the DataFrame accordingly.

instrumentSymbologyType

A String value automatically set to the default value within settings. This value is used in the same fashion as in the Instrument class where its purpose is to identify the sort of alias the Instruments are to be returned as.

panelDatasetType

A string value that references the panel data type. When provided, the Universe object will be comprised of all the instruments and primary KPIs appropriate for that particular panel dataset type while working with the other given filters.