Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: added multiple tradingview indicators #539

Merged
merged 48 commits into from
May 4, 2024

Conversation

chrisleekr
Copy link
Owner

@chrisleekr chrisleekr commented Nov 18, 2022

Description

This PR is providing multiple TradingView indicators.

Warnings: Please do a backup before upgrading. It may break due to migrations. If it breaks, please let me know.

Changes:

Caveats:

  • I am limiting the number of TradingView intervals to 3 intervals. The bot will request the TradingView API endpoint extensively (it's POST - https://github.com/brian-the-dev/python-tradingview-ta/blob/main/tradingview_ta/main.py#L107). For example, if I set 3 intervals, then it will request 3 intervals * 60 seconds = 180 requests per min. I think it's already too many requests and likely blocked by TradingView. Although, they may not have any rate limit (or they do?).

Related Issue

#438

Motivation and Context

The TradingView is providing the indicator per interval.
At the moment, the bot only monitors a single TradingView interval, which is ok.
But the trend can be changed very quickly before new technical analysis results.

How Has This Been Tested?

It's been running on my server.
However, this requires intensive test before releasing.

Screenshots (if appropriate):

image
image
image

@chrisleekr chrisleekr self-assigned this Nov 18, 2022
@chrisleekr chrisleekr added the enhancement New feature or request label Nov 18, 2022
@chrisleekr chrisleekr linked an issue Nov 18, 2022 that may be closed by this pull request
24 tasks
@chrisleekr chrisleekr assigned chrisleekr and unassigned chrisleekr Nov 19, 2022
@codecov-commenter
Copy link

codecov-commenter commented Nov 20, 2022

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (a0993c2) to head (5c99cad).
Report is 2 commits behind head on master.

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff            @@
##            master      #539   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           91        92    +1     
  Lines         3505      3554   +49     
  Branches       610       607    -3     
=========================================
+ Hits          3505      3554   +49     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@eppenga
Copy link

eppenga commented Nov 24, 2022

Looks cool! I also use the technique of multiple Tradingview confirmations in my own bot and have it live now for about half a year. It never gave me any problems with rate limiting. If you are interested, happy to share, but I thought this was not the place to advertise my own work :)

@chrisleekr
Copy link
Owner Author

chrisleekr commented Nov 30, 2022

@eppenga Oh, if you can share your code, I am happy to take it as a reference.
With my changes, I think there is a performance issue. Not on my server, but my server is pretty powerful to run the bot.
Raspberry Pi seems to struggle as well. My Okteto test bot is also struggling.

So I am thinking of refactoring the code to not harm the performance.
If you can share your code, I will definitely take a look. :)

@eppenga
Copy link

eppenga commented Dec 2, 2022

@eppenga Oh, if you can share your code, I am happy to take it as a reference. With my changes, I think there is a performance issue. Not on my server, but my server is pretty powerful to run the bot. Raspberry Pi seems to struggle as well. My Okteto test bot is also struggling.

So I am thinking of refactoring the code to not harm the performance. If you can share your code, I will definitely take a look. :)

Sure, gladly, please see: https://github.com/eppenga/goldstar-crypto-trading-bot

It's just a simple PHP script that buys and sells based on either signals or as a gridbot. Personally I use it as a gridbot with 4-fold TradingView confirmation continuously on four different pairs and query every 15 seconds. I think the main difference regarding TradingView is that I think you query TradingView all the time and I only do so when a BUY is imminent.

So far I have never experiences issues with TradingView, not sure if they have rate limiting, never saw it.

@chrisleekr
Copy link
Owner Author

chrisleekr commented Apr 14, 2024

Before merging,

  • Need to test upgrade from v0.0.98

@chrisleekr
Copy link
Owner Author

This PR works as expected based on the recent trades with test settings.

Setting
image

Closed Trades
image

Charts with Buy/Sell
image
image

@chrisleekr chrisleekr merged commit 7988078 into master May 4, 2024
2 checks passed
@chrisleekr chrisleekr deleted the feat/multiple-tradingview-indicators branch May 4, 2024 13:47
@chrisleekr
Copy link
Owner Author

Explanation of TradingView is here - https://github.com/chrisleekr/binance-trading-bot/wiki/TradingView

@rando128
Copy link
Contributor

Hi @chrisleekr, when do you plan to make it into an official 0.0.99 release?

@chrisleekr
Copy link
Owner Author

Hi @rando128

I am not sure. All packages are very outdated and I will need to spend some time to update all packages.

It should work with the main branch if you need to use it, which is what I am doing at the moment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add additional TradingView interval
6 participants