I am looking to get a list of Bonds (Active and Matured) for a series of entities, within the last twenty years. At the moment I am using the following to gather a list of active fixed income securities issued by a particular entity:
fi_fields = ['BondRatingLatest', 'IssuerOAPermid','IssuerOrgid','IssuerID','IssuerCommonName','ParentIssuerName', 'ParentOAPermID','IssueRating','IssueRatingSourceCode','BondRatingLatestSourceCode', 'AssetTypeDescription','DebtTypeDescription','ISIN','MainSuperRIC','DBSTicker','IsGreenBond','IssueDate', 'Currency', 'RCSCurrencyLeaf','FaceIssuedTotal', 'EOMAmountOutstanding', 'NextCallDate','CouponRate','IsPerpetualSecurity','MaturityDate','CdsSeniorityEquivalentDescription','Price', 'DTSimpleType'] for org in orgids_list: query = "IssuerOAPermID eq '" + str(org) + "' and IsActive eq true and not(AssetStatus in ('MAT'))" df = rdp.search(view = rdp.SearchViews.GovCorpInstruments, filter = query, top = 10000, select = ','.join(fi_fields), navigators = "Currency")
I have slightly amended the code to turn IsActive into False which can work - nevertheless I was wondering if there is perhaps a better way to filter the dataset already in the query? Would you please help me for example in structuring the code if I want for example to:
- Option1. Filter for anything from 2000 onwards via 'MaturityDate' field (I am having troubles here since the datatype is date)
- Option 2. Filter for AssetState being different from 'AC' (stands for Active)
Lastly, is there a field in the GovCorpInstruments RDP view whereby I can clearly select for Bonds? At the moment I am bringing in all securities issued by an entity, and that includes commercial papers which I suspect cannot be ran for Ownership? If you could confirm this last two points that would be great.
Thank you so much!