Giter VIP home page Giter VIP logo

nuatsbot's Introduction

NuatsBot

How about a Technical Analysis Crypto Bot that runs on specified tickers/intervals and sends buy/sell signals on your Telegram or Discord channels?!

Meet NuatsBot, a Technical Analysis Bot for Binance

This library includes a set of tools with an easy setup to automatically perform Technical Analysis (TA) on selected cryptocurrencies which are tradable on the Binance Exchange. Furthermore, the bull/bear signals are broadcast to the specified Telegram/Discord channels.

TA signals

Currently the implemented signals are:

  • Change in volume
  • Oversold/Overbought RSI
  • RSI/price divergence

In order to modify the trigger values for each indicator check nuats_ta.py, the analyse function. In the future I will include the trigger values in the config.py file as well as the selected strategies for generating the desired signals.

Additionally, I would really appreciate it if someone wants to include more TA strategies to generate the buy/sell signals.

Requirements

Python 3.x required.

Add the package requirements with:

pip3 install -r requirements.txt

Usage

In the config.py file the user can set the following parameters:

TA related parameters:

  • tickers: List of tickers to analyse. If empty, all the available tickers in Binance are selected by default. E.g.: ['BTCUSDT', 'ETHBTC']
  • intervals: List of intervals to analyse. E.g.: ['30min','1h','1d'].
  • n_periods: Number of periods (bars or klines) for the selected intervals for which the TA will be performed. If blank, default is 500.
  • start_time: Start of the period to analyse. It will retrieve as many periods as necessary up to right now if end_time is not provided. If blank, only the last n_periods will be retrieved.
  • end_time: End of the period to analyse. Parameter only accepted when start_time is provided.

Bot related parameters:

  • live: Boolean to indicate if an infinite loop (execution of the bot) is desired. If false, the analysis will be only done once.
  • sleep: Sleep value for live executions. Indicates the time between analysis. Check Binance API restrictions for more info.
  • threading: Boolean to indicate a multithread execution or serial execution. The bot runs much faster multithreading of course!
  • telegram_token: Token of the Telegram Bot used to broadcast signals in Telegram channels. More info below.
  • telegram_chat_ids: List of the chat ids where the Telegram Bot is admin and can send messages. More info below.
  • discord_webhooks: List of discord webhooks. More info below.

When the desired configuration is set, just run nuats_bot.py to perform the TA on the tickers selected and automatically broadcast the signals to Telegram/Discord. Make sure to meet the requirements.txt.

Set up Telegram / Discord hooks

Telegram

In order to broadcast a message in the Telegram platform you will need to create a Bot with BotFather. Then add the Bot in one of your channels and set it as an admin. You will have received the bot token, which is the telegram_token parameter you need to fill in the config.py file.

Finally, get your channel id as explained here and include it in the telegram_chat_ids list.

Discord

You can create a webhook to your own server as explained here. Then copy the webhook link and include it in the discord_webhooks list of the config.py file. Easy peasy!

Useful links

Check useful_links.txt for interesting GitHub repositories I have looked at to develop this Bot.

License

Distributed under the MIT License.

Author: Bernat Font Garcia
Email: [email protected]

nuatsbot's People

Contributors

b-fg avatar omri93h avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

nuatsbot's Issues

Requirements not installable

Hello

The requirements.txt is not updated and there are 2-3 python modules which are not installable coz the pip command cannot find any module of that name..
The code exame is below when I ran pip3 install -r requirements.txt

screenshot_2018-10-15-14-52-22-127

Help...

from six.moves import range

having issue with importing moves , six is installed yet moves isnt ?

Import "six.moves" could not be resolved from source

had to use # pyright: ignore but not sure if or how it might effect the project!

A minimalisitc RSI signal script with open api

Hi ;)
I was searching for examples of little bots using free api's rather than binance or any exchange where kyc is needed.
I would love to ask you, how many lines would it take to write a script just printing a signal when BTCUSDT weekly RSI reached a specific level ? I'm a beginner and I would love to start with the most minimalistic script possible using Ta-lib or open API.
Would you be able to help ? I'd be ok to pay you for the writing of those lines... Please keep in touch ;)
thanks in advance

Pairing issue

I’m using your bot but when i want load only the BTC pairing on Binance the scanner did not work. I use the example on Github like this ['BTCUSDT', 'ETHBTC'].

Attribute error

Traceback (most recent call last):
File "nuats_bot.py", line 124, in
main()
File "nuats_bot.py", line 96, in main
if (len(notifications_list) > 0): broadcast_signals(notifications_list)
File "nuats_bot.py", line 28, in broadcast_signals
all_notifications_list = list(filter(None.ne, tickers_TA_list)) # Filter out tickers with no bull/bear notifications
AttributeError: 'NoneType' object has no attribute 'ne'

The Telegram broadcasting system is not working

I set up the config.py added my telegram bit token and channel ID
But it doesn't work...

My config.py

https://user-images.githubusercontent.com/41206183/46945089-8a10eb00-d091-11e8-8b16-59c34cea5272.jpeg

It says Telegram Broadcasting ['channelid'] and stops but nothing happens see below code

https://user-images.githubusercontent.com/41206183/46945102-9432e980-d091-11e8-9483-6a030eeb2a9b.png

https://user-images.githubusercontent.com/41206183/46945112-9a28ca80-d091-11e8-8801-dbaf2f566d6b.jpeg

What's the prob?please help

Bug while running nuats_bot.py

0%| | 0/4 [00:00<?, ?it/s]C:\Users\dell\PycharmProjects\nuatsbot\venv\lib\site-packages\sklearn\linear_model_base.py:141: FutureWarning: 'normalize' was deprecated in version 1.0 and will be removed in 1.2.
If you wish to scale the data, use Pipeline with a StandardScaler in a preprocessing stage. To reproduce the previous behavior:

from sklearn.pipeline import make_pipeline

model = make_pipeline(StandardScaler(with_mean=False), LinearRegression())

If you wish to pass a sample_weight parameter, you need to pass it as a fit parameter to each step of the pipeline as follows:

kwargs = {s[0] + '__sample_weight': sample_weight for s in model.steps}
model.fit(X, y, **kwargs)

warnings.warn(
C:\Users\dell\PycharmProjects\nuatsbot\venv\lib\site-packages\sklearn\linear_model_base.py:141: FutureWarning: 'normalize' was deprecated in version 1.0 and will be removed in 1.2.
If you wish to scale the data, use Pipeline with a StandardScaler in a preprocessing stage. To reproduce the previous behavior:

from sklearn.pipeline import make_pipeline

model = make_pipeline(StandardScaler(with_mean=False), LinearRegression())

If you wish to pass a sample_weight parameter, you need to pass it as a fit parameter to each step of the pipeline as follows:

kwargs = {s[0] + '__sample_weight': sample_weight for s in model.steps}
model.fit(X, y, **kwargs)

warnings.warn(
C:\Users\dell\PycharmProjects\nuatsbot\venv\lib\site-packages\sklearn\linear_model_base.py:141: FutureWarning: 'normalize' was deprecated in version 1.0 and will be removed in 1.2.
If you wish to scale the data, use Pipeline with a StandardScaler in a preprocessing stage. To reproduce the previous behavior:

from sklearn.pipeline import make_pipeline

model = make_pipeline(StandardScaler(with_mean=False), LinearRegression())

If you wish to pass a sample_weight parameter, you need to pass it as a fit parameter to each step of the pipeline as follows:

kwargs = {s[0] + '__sample_weight': sample_weight for s in model.steps}
model.fit(X, y, **kwargs)

warnings.warn(
C:\Users\dell\PycharmProjects\nuatsbot\venv\lib\site-packages\sklearn\linear_model_base.py:141: FutureWarning: 'normalize' was deprecated in version 1.0 and will be removed in 1.2.
If you wish to scale the data, use Pipeline with a StandardScaler in a preprocessing stage. To reproduce the previous behavior:

from sklearn.pipeline import make_pipeline

model = make_pipeline(StandardScaler(with_mean=False), LinearRegression())

If you wish to pass a sample_weight parameter, you need to pass it as a fit parameter to each step of the pipeline as follows:

kwargs = {s[0] + '__sample_weight': sample_weight for s in model.steps}
model.fit(X, y, **kwargs)

warnings.warn(
C:\Users\dell\PycharmProjects\nuatsbot\venv\lib\site-packages\sklearn\linear_model_base.py:141: FutureWarning: 'normalize' was deprecated in version 1.0 and will be removed in 1.2.
If you wish to scale the data, use Pipeline with a StandardScaler in a preprocessing stage. To reproduce the previous behavior:

from sklearn.pipeline import make_pipeline

model = make_pipeline(StandardScaler(with_mean=False), LinearRegression())

If you wish to pass a sample_weight parameter, you need to pass it as a fit parameter to each step of the pipeline as follows:

kwargs = {s[0] + '__sample_weight': sample_weight for s in model.steps}
model.fit(X, y, **kwargs)

warnings.warn(
C:\Users\dell\PycharmProjects\nuatsbot\venv\lib\site-packages\sklearn\linear_model_base.py:141: FutureWarning: 'normalize' was deprecated in version 1.0 and will be removed in 1.2.
If you wish to scale the data, use Pipeline with a StandardScaler in a preprocessing stage. To reproduce the previous behavior:

from sklearn.pipeline import make_pipeline

model = make_pipeline(StandardScaler(with_mean=False), LinearRegression())

If you wish to pass a sample_weight parameter, you need to pass it as a fit parameter to each step of the pipeline as follows:

kwargs = {s[0] + '__sample_weight': sample_weight for s in model.steps}
model.fit(X, y, **kwargs)

warnings.warn(
C:\Users\dell\PycharmProjects\nuatsbot\venv\lib\site-packages\sklearn\linear_model_base.py:141: FutureWarning: 'normalize' was deprecated in version 1.0 and will be removed in 1.2.
If you wish to scale the data, use Pipeline with a StandardScaler in a preprocessing stage. To reproduce the previous behavior:

from sklearn.pipeline import make_pipeline

model = make_pipeline(StandardScaler(with_mean=False), LinearRegression())

If you wish to pass a sample_weight parameter, you need to pass it as a fit parameter to each step of the pipeline as follows:

kwargs = {s[0] + '__sample_weight': sample_weight for s in model.steps}
model.fit(X, y, **kwargs)

warnings.warn(
C:\Users\dell\PycharmProjects\nuatsbot\venv\lib\site-packages\sklearn\linear_model_base.py:141: FutureWarning: 'normalize' was deprecated in version 1.0 and will be removed in 1.2.
If you wish to scale the data, use Pipeline with a StandardScaler in a preprocessing stage. To reproduce the previous behavior:

from sklearn.pipeline import make_pipeline

model = make_pipeline(StandardScaler(with_mean=False), LinearRegression())

If you wish to pass a sample_weight parameter, you need to pass it as a fit parameter to each step of the pipeline as follows:

kwargs = {s[0] + '__sample_weight': sample_weight for s in model.steps}
model.fit(X, y, **kwargs)

warnings.warn(
25%|██▌ | 1/4 [00:00<00:01, 1.56it/s]
Traceback (most recent call last):
File "C:\Users\dell\PycharmProjects\nuatsbot\nuats_bot.py", line 124, in
main()
File "C:\Users\dell\PycharmProjects\nuatsbot\nuats_bot.py", line 112, in main
tickers_TA_list = list(tqdm(executor.map(TA_task, a), total=len(a)))
File "C:\Users\dell\PycharmProjects\nuatsbot\venv\lib\site-packages\tqdm\std.py", line 1195, in iter
for obj in iterable:
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.1520.0_x64__qbz5n2kfra8p0\lib\concurrent\futures_base.py", line 609, in result_iterator
yield fs.pop().result()
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.1520.0_x64__qbz5n2kfra8p0\lib\concurrent\futures_base.py", line 439, in result
return self.__get_result()
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.1520.0_x64__qbz5n2kfra8p0\lib\concurrent\futures_base.py", line 391, in __get_result
raise self._exception
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.1520.0_x64__qbz5n2kfra8p0\lib\concurrent\futures\thread.py", line 58, in run
result = self.fn(*self.args, **self.kwargs)
File "C:\Users\dell\PycharmProjects\nuatsbot\nuats_bot.py", line 49, in TA_task
klines = bclient.get_last_klines(ticker, interval, n_periods)
File "C:\Users\dell\PycharmProjects\nuatsbot\binance_client\client.py", line 289, in get_last_klines
return self.get_klines(
File "C:\Users\dell\PycharmProjects\nuatsbot\binance_client\client.py", line 197, in get_klines
return self._get('klines', data = params)
File "C:\Users\dell\PycharmProjects\nuatsbot\binance_client\client.py", line 104, in _get
return self._request_api('get', path, **kwargs)
File "C:\Users\dell\PycharmProjects\nuatsbot\binance_client\client.py", line 89, in _request_api
return self._request(method, uri, **kwargs)
File "C:\Users\dell\PycharmProjects\nuatsbot\binance_client\client.py", line 85, in _request
return self._handle_response(response)
File "C:\Users\dell\PycharmProjects\nuatsbot\binance_client\client.py", line 97, in _handle_response
raise BinanceAPIException(response)
binance_client.exceptions.BinanceAPIException: APIError(code=-1120): Invalid interval.

Good way to keep bot from timing out

After running for only a short while, the app crashes due to a timeout reaching binance api. Here's the output when the app stops:

Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/urllib3/connectionpool.py", line 603, in urlopen
    chunked=chunked)
  File "/usr/local/lib/python3.7/site-packages/urllib3/connectionpool.py", line 344, in _make_request
    self._validate_conn(conn)
  File "/usr/local/lib/python3.7/site-packages/urllib3/connectionpool.py", line 843, in _validate_conn
    conn.connect()
  File "/usr/local/lib/python3.7/site-packages/urllib3/connection.py", line 316, in connect
    conn = self._new_conn()
  File "/usr/local/lib/python3.7/site-packages/urllib3/connection.py", line 165, in _new_conn
    (self.host, self.timeout))
urllib3.exceptions.ConnectTimeoutError: (<urllib3.connection.VerifiedHTTPSConnection object at 0x120b78d68>, 'Connection to api.binance.com timed out. (connect timeout=10)')

Unknown Error

Hello, I've got such an error. Don't know how to fix)
from sklearn.pipeline import make_pipeline

model = make_pipeline(StandardScaler(with_mean=False), LinearRegression())

If you wish to pass a sample_weight parameter, you need to pass it as a fit parameter to each step of the pipeline as follows:

kwargs = {s[0] + '__sample_weight': sample_weight for s in model.steps}
model.fit(X, y, **kwargs)

warnings.warn(
Traceback (most recent call last):
File "c:/Users/Admin/Desktop/nuatsbot-master/nuatsbot-master/nuats_bot.py", line 124, in
main()
File "c:/Users/Admin/Desktop/nuatsbot-master/nuatsbot-master/nuats_bot.py", line 112, in main
tickers_TA_list = list(tqdm(executor.map(TA_task, a), total=len(a)))
File "C:\Users\Admin\AppData\Local\Programs\Python\Python38\lib\site-packages\tqdm\std.py", line 1195, in iter
for obj in iterable:
File "C:\Users\Admin\AppData\Local\Programs\Python\Python38\lib\concurrent\futures_base.py", line 611, in result_iterator
yield fs.pop().result()
File "C:\Users\Admin\AppData\Local\Programs\Python\Python38\lib\concurrent\futures_base.py", line 434, in result
self._condition.wait(timeout)
File "C:\Users\Admin\AppData\Local\Programs\Python\Python38\lib\threading.py", line 302, in wait
waiter.acquire()

Problem with receiving signals

Hello!
I have a problem with receiving signals.
When I launch the bot, it only writes the word Signal to me but does not write other data.
What should I do?
Thank you!
Снимок экрана 2022-08-15 в 22 23 42

How Can Multiple Queries Being Sent Separately?

I'm trying to send the queries drawn from the API to telegram via a ready-made this code. However, when more than one query is received, it sends it to telegram as a single post. How can we solve this incoming multiple queries being sent separately? I added example output from this way.

image

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.