Hello,
I would like to retrieve yearly average bid/ask spread for a list of stocks historically. How could I use Python to extract?
Hi @Emilymevo
Please look into the LDL tutorials; I'd advise also using CodeBook, the DIB and CodeCreator (shown in the first screenshot below). Doing so myself I cam up with the below. Does this return the data you are after?
import lseg.data as ld ld.open_session() df = ld.get_data( universe = [ 'LSEG.L', 'VOD.L'], fields=['TR.ASKPRICE(SDate=0,EDate=-3,Frq=FY,CALCMETHOD=AVG)']) display(df) ld.close_session()