Stock Screen for Inactive Stocks in a particular exchange

I am trying to screen for all stocks in a particular exchange, using the TR.ExchangeMarketIdCode. When I screen for active stocks, using the command below, it works.

'SCREEN(U(IN(Equity(active,public,primary))), IN(TR.ExchangeMarketIdCode,"XTAI"))'


However, when I try to get the list of inactive stocks, using the following command, I get nothing back.

'SCREEN(U(IN(Equity(inactive,public,primary))), IN(TR.ExchangeMarketIdCode,"XTAI"))'


Can i screen for inactive stocks by exchange market code? (I know I can screen for inactive stocks if i used the screen by country, but that is not what i want.)

Best Answer

  • aramyan.h
    Answer ✓

    Hi @Quek ,


    Thank you for your question. I have checked on my end, the code looks working. It seems that there is no values for the specified screen. For example, removing IN(TR.ExchangeMarketIdCode,"XTAI") returned me values suggesting that inactive is a valid command.


    Generally, the way I approach screener functions is to build the screen using SCREENER app in Workspace, then exporting the query as formula and finally take the screener code from excel into my query. That way I am certain both on the query syntax as well as the values I will get.


    screenshot-2023-06-02-at-133719.png


    Could you please kindly try this workflow and let me know if you get any values in Workspace which you can't via the python query?


    Best regards,

    Haykaz