Is it possible to get a company's ticker with just the name enter by an user input?

Here is my code. I want to get the company's ticker when a user input the company name. It seems not bee working as I get NONE

company_name = ['entry2']

company_ticker, err =

ek.get_data(['SCREEN(U(IN(Equity(active,public,primary))),Contains(TR.CommonName,"company_name"))'], ['TR.CommonName'])

Best Answer

  • Jirapongse
    Jirapongse ✭✭✭✭✭
    Answer ✓

    @maxwilliams.boko

    I hope that this is what you are looking for.

    company_name = "Voda"
    screener_exp = 'SCREEN(U(IN(Equity(active,public,primary))),Contains(TR.CommonName,"{}"))'.format(company_name)

    company_ticker, err = ek.get_data(instruments=[screener_exp], fields = ['TR.RIC','TR.CommonName','TR.TickerSymbol'])
    company_ticker

    There are other ways to insert values into strings.

Answers