Does anyone know which code I have to use to download both US10Y and IT10Y historical Yield?
thank you very much
@s.bariatti
Thank you for reaching out to us.
You can use the LSEG Data Library for Python to retreive historical data. First, you need to know RICs and fields that can provide the required data. You can use the RIC Search tool to search for RICs.
For example, RICs for US10Y and IT10Y could be US10YT=RR and IT10YT=RR recpectively. Then, you can use the get_history method to get historical data.
data = ld.get_history('US10YT=RR', start='2024-01-01', interval='daily') data
If we don't specify the fields paramater, the get_history method will retrun all available fields of subscribed items.
The available real-time historical fields for US10YT=RR are:
Index(['YLDTOMAT', 'ASP6M', 'HIGH_1', 'OPEN_PRC', 'LOW_1', 'HIGH_YLD', 'LOW_YLD', 'A_YLD_1', 'ACCR_INT', 'BID', 'B_YLD_1', 'MID_PRICE', 'MID_YLD_1', 'CONVEXITY', 'MOD_DURTN', 'ASK_HIGH_1', 'OPEN_YLD', 'AST_SWPSPD', 'BPV', 'BMK_SPD', 'ISMA_A_YLD', 'ISMA_B_YLD', 'SWAP_SPRDB', 'ASK', 'ASP3M', 'OAS_BID', 'ZSPREAD', 'INT_BASIS', 'INT_CDS', 'OIS_SPREAD', 'TED_SPREAD', 'ASP1M', 'ASK_LOW_1', 'OPEN_ASK', 'DIRTY_PRC', 'CLEAN_PRC'], dtype='object', name='US10YT=RR')
You can also refer to the examples on GitHub.