Hello,
I would like to retrieve yearly average bid/ask spread for a list of stocks historically. How could I use Python to extract?
Resolver not registered: react.asset.discussionTagsAsset
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()
Thank you for your participation in the forum.
Is the reply above satisfactory in answering your question?
If yes please click 'Yes' next to the text ‘Did this answer the question?’, and then close the question. This will guide all community members who have a similar question.
Otherwise please post again offering further insight into your question.
Thanks,
AHS
Hi @Emilymevo Please note that the answer above was marked as accepted. Please let us know if that's incorrect.