Main Content

Retrieve Factor Rank Data for Portfolio Selection

This example shows how to retrieve ranking data from IHS Markit®for use in portfolio selection or an existing model. Retrieve percentile rank data for ticker security identifiers of a factor code. Then, use the rank information for portfolio selection or further analysis in an existing model. The example assumes that you have IHS Markit credentials. For credentials, see theIHS Markitwebsite.

Create an IHS Markit connection using your user name and password.cis anihsmarkitrsobject.

username ='ABCDEF'; password ='ABC123'; c = ihsmarkitrs(username,password);

Retrieve signal information for the last 10 days using the IHS Markit connection. Specify theABRfactor code andUS Total Capuniverse. Also, specify the ticker security type and percentile data format. The percentile format provides factor ranking data.dis a table that contains signal information and thedateanddatavariables.

code ='ABR'; universeid ='US Total Cap'; startdate = datetime('today')-10; enddate = datetime('today');标识符='ticker'; datatype ='percentile'; d = signals(c,code,universeid,startdate,enddate,identifier,datatype);

Access the first few rows of ranking data for the first day in the date range by using thedatavariable.

data = d.data{1}; head(data)
ans = 8×2 table ticker value ______ _____ 'SVU' 1 'LBY' 1 'TLRY' 1 'WIFI' 1 'TCS' 1 'AOBC' 1 'TTD' 1 'ZOES' 1

The variables of the resulting table aretickerandvalue. Thetickervariable contains the ticker security identifiers. Thevaluevariable contains the factor ranking data.

Find all ticker security identifiers indatathat have the most attractive value using rank values1through10. Create a table to store the rank values and perform an inner join to retrieve the most attractive securities. Display the last few attractive securities.

value = 1:10;% Define array of ranks 1 through 10T = table(value','VariableNames',{'value'});% Create table of the ranks in one variablesecurities = innerjoin(data,T);% Perform inner join to find securities within the rankstail(securities)
ans = 8×2 table ticker value _______ _____ 'CDPYF' 10 'CNXN' 10 'DRNA' 10 'PSX' 10 'BRC' 10 'ICHR' 10 'MNLO' 10 'MBI' 10

Use the factor rank data in your portfolio selection process or further analysis in your existing model.

See Also

|

Related Topics

External Websites