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
222 stars 39 forks source link

Update `constants.py` #35

Open tameike000 opened 2 months ago

tameike000 commented 2 months ago

First, great package!

I tried to use "close_1_days_back" and I get: requests.exceptions.HTTPError: 400 Client Error: Bad Request Body: {"totalCount":0,"error":"Unknown field \"close_1_days_back\"","data":null}

Seems not existing (anymore).

Is there a way to create an updated constants.py?

Thanks!! M

shner-elmo commented 2 months ago

Hey, thanks for the feedback.

Yeah, the fields change all the time, that's why I'm thinking of putting them on the website instead of hard-coding them in the library.

I could definitely update it, but I'm curious where you usually search the fields: in the Github repository, source code installed locally, or the docs at https://shner-elmo.github.io/TradingView-Screener?

tameike000 commented 2 months ago

I am a docs guys ;-) But that's me ...

Thank's for looking into this!

shner-elmo commented 2 months ago

@tameike000 It's not officially published, but check this out: https://shner-elmo.github.io/TradingView-Screener/fields/stocks.html

I'd appreciate it if you can give me some feedback

Stail7 commented 1 month ago

@tameike000 It's not officially published, but check this out: https://shner-elmo.github.io/TradingView-Screener/fields/stocks.html

I'd appreciate it if you can give me some feedback

Great page! Thank you! Is there a way (except of using another API) to get a Daily prices for: close[2], close[1] and low[1] (where: 2 - two days ago, 1 - one day ago)? I need this data to create a short sale restriction condition (SSR)

tameike000 commented 1 month ago

@tameike000 It's not officially published, but check this out: https://shner-elmo.github.io/TradingView-Screener/fields/stocks.html

I'd appreciate it if you can give me some feedback

That's Gold!!

Thanks!!

shner-elmo commented 1 month ago

@Stail7 Thanks. I don't think you can do that through the screener API.

There is another API that the charts use to get historical and live data through a websocket I believe, but haven't looked into it.

dietmarb01 commented 3 weeks ago

Thanks for this list, it is immensely helpful! IMHO there are different approaches:

shner-elmo commented 3 weeks ago

@dietmarb01 of course, glad you found it useful.

That page is generated every day through a cronjob, to keep the data updated (if you look in the bottom it says the UTC time it was last generated).

Regarding your second point, why would you want to pull the list? is it for runtime validation or what? And yes I agree, we need to be careful not to overwhelm TradingView's API.

shner-elmo commented 3 weeks ago

While I'm at it, other than removing constants.py in the next major release, I'm also going to remove screener.py, because screeners also change.

What do you guys think about the following: https://shner-elmo.github.io/TradingView-Screener/screeners/main_screeners.html https://shner-elmo.github.io/TradingView-Screener/screeners/stocks/america.html

(the code doesn't work with the latest PyPi version, you need to clone master if you want to test the queries)

shner-elmo commented 3 weeks ago

Also implemented syntax for And/Or filtering: image