shner-elmo / TradingView-Screener

A package that lets you create TradingView screeners in Python
https://shner-elmo.github.io/TradingView-Screener/2.5.0/tradingview_screener.html
MIT License
282 stars 44 forks source link

Can't access data from any country #43

Closed Pranjal-dew closed 3 months ago

Pranjal-dew commented 3 months ago

Hi I'm trying to fetch data for other market data but im unable to do it.

Pranjal-dew commented 3 months ago

Hey, it's really great package and I'm truly amazed by how many features you have integrated. Thanks for making such a wonderful code, it's really a life saver. Regards, P

shner-elmo commented 3 months ago

Of course bro, I'm glad you are enjoying it.

The issue is that by default it filters just america stocks, so naturally you wont find any india stocks within the filtered result, but you can change it: https://shner-elmo.github.io/TradingView-Screener/2.5.0/tradingview_screener/query.html#Query.set_markets

And use the set_markets() method instead of where(Column('market') == ...), its also more performant.


And finally, if you even want to filter a column that its either value X or Y, don't do:

Query().where(Column('some_column') == 'x' or 'y')

But instead do:

Query().where(Column('some_column').isin(['x', 'y']))