Git Product home page Git Product logo

3commas-cyber-bots's Introduction

Hi there! ๐Ÿค™๐Ÿป I'm Ron aka 'cyberjunky', i'm based in The Netherlands, I work as a IT Security Manager and one of my hobbies is programming in Python! Take a look around and if you have any questions, feel free to ask them via email or socials!

Personal LinkedIn Twitter


๐Ÿš€ Projects I'm always busy with all kinds of projects. This mainly contains contributions for Home Assistant (home configurations and integrations) and crypto related bots and bothelpers.

Some projects I work on:

Projects Type Description
Home Assistant Garmin Connect Integration Get sensor data from Garmin Connect inside Home Assistant
Home Assistant FireServiceRota Integration Duty schedule and alerts for firefighters
python-garminconnect Python package Python client for reading your Garmin Connect data
3commas-cyber-bots Python scripts Tools to help you trade with 3commas bots
Home Assistant Toon Climate Integration Toon Thermostat
Home Assistant Toon Boilerstatus Integration Read boiler information from Toon
Home Assistant Toon Smartmeter Integration Read smartmeter data from Toon
Home Assistant Arpscan Tracker Integration Superfast presence detection
Home Assistant HVC Groep Integration Garbage collector data for HVC Groep
Home Assistant P2000 RTL-SDR Addon Addon Receive P2000 messages from the air using an RTL-SDR dongle
Home Assistant Bitvavo Integration Expose Bitvavo values inside Home Assistant
Home Assistant Shell Recharge Integration Expose data from EV chargers listed on shellrecharge.com to Home Assistant
python-shellrecharge Python package Python client for reading EV charger information from shellrecharge.com

3commas-cyber-bots's People

Contributors

amargedon avatar brhahlen avatar cyberjunky avatar dangalv avatar goempiek avatar m1ch43lv avatar mrcrdwd avatar neoegy avatar neox387 avatar spggooss avatar toonvdijck 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  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

3commas-cyber-bots's Issues

Error when restarting compound.py after the newest commit

Traceback (most recent call last):
File "compound.py", line 527, in
compound_bot(botdata)
File "compound.py", line 363, in compound_bot
deals_count, profit_sum = process_deals(deals)
File "compound.py", line 340, in process_deals
db.execute(f"INSERT INTO deals (dealid, profit) VALUES ({deal_id}, {profit})")
sqlite3.OperationalError: table deals has no column named profit

Stop Compounding if above risk % level

Is your feature request related to a problem? Please describe.
Compounding is very powerful mechanism and I believe if unattended it could drastically increase the risk level for most (if not all) DCA strategies on 3 commas.

When Compound bot compounds profits made by a (3c) bot to the BO and SO of the same (3c) bot, it will grow exponentially (the very nature of compounding) and will increase BO / SO values to higher levels, faster and faster. Eventually it will consume too much of the collateral (Bankroll), increase the risk level and will cause problems with bots not being able to fill all their SO's.

Describe the solution you'd like
Do not compound if Risk Level (Total Bankroll / Max DCA) above certain level (say 110%, value could be configured in a config file).

Describe alternatives you've considered
Still thinking about that, please comment. Please consider other strategies as well. I only can comment on strategies that I use.

Additional context
Thank you very much for your work, really appreciate that.

I am currently compounding only 0.01% profit back to the BO /SO to test this functionality, because of the described issue. Everything seems to be ok so far for me but I will feedback more if I find any issues or suggest improvement.

Thank you ๐Ÿ‘๐Ÿผ

Make exchange name configurable in watchlist.ini

Is your feature request related to a problem? Please describe.
I have multiple Binance accounts in my 3commas account. To keep these apart I renamed them in 3commas.

This prevents the Watchlist.py from working.

Describe the solution you'd like
Make the name configurable in watchlist.ini

Describe alternatives you've considered
I have renamed one of my account Binance

Additional context
I think the reference is given here to the name but my python knowledge is not enough to make a reference to the configuration script here myself.

# Get market of 3Commas because it's slightly different then exchanges if "Binance" in exchange or "Paper Account" in exchange: tickerlist = get_threecommas_market("binance") elif exchange == "FTX": tickerlist = get_threecommas_market("ftx") else: logger.error( "Bot is using the '%s' exchange which is not implemented yet!" % exchange ) return

Add Safety orders using profit

Is your feature request related to a problem? Please describe.
Just like the script created by @Lutjebroequer, it would be nice to increase the bot with more Safety orders.

Describe the solution you'd like
In the compound.ini file add a value that notes down the actual max safety orders and desired safety orders.
Technically it should work the same as "add max active deals"

Describe alternatives you've considered
/

Additional context
A problem/decision that would rise is to choose between "addmaxactivedeals" and "addsafetyorders".
My personal preference is to give priority so "addmaxactivedeals"

blacklist.txt being semi ignored?

Hi

i dont think the local blacklist is working correctly.

my blacklist.txt reads this:
USDT_SHIB
USDT_BTC
USDT_ETH

but SHIB is still being selected in the pair selection. (i cant use the 3commas blacklist as i have got another bot dedicated to trading SHIB, hence i dont want it included in my altrank bot)

the below log shows its read the 3 pairs from blacklist.txt but the updated pairs is still including USDT_SHIB.

2021-11-29 21:17:59 - altrank.py - Reading local blacklist file 'blacklist.txt' OK (3 pairs)

2021-11-29 21:15:23 - altrank.py - Bot 'Multipair USDT' with id '#######' updated with these pairs:
['USDT_RSR', 'USDT_XTZ', 'USDT_SYS', 'USDT_SHIB', 'USDT_MBOX', 'USDT_MATIC', 'USDT_COTI', 'USDT_ZIL', 'USDT_CAKE', 'USDT_RAY']

TypeError: float() argument must be a string or a number, not 'NoneType'

Galaxyscore was running for some days without any problems and it suddenly quited. When I try to restart the same error pops up.

['BTC_CELR', 'BTC_MANA', 'BTC_FIDA', 'BTC_MOVR', 'BTC_SYS', 'BTC_KSM', 'BTC_DGB']
2021-11-11 22:45:02,722 - galaxyscore - INFO - Next update in 900 Seconds at 23:00:02
2021-11-11 23:00:02,729 - galaxyscore - INFO - Loaded configuration from 'galaxyscore.ini'
2021-11-11 23:00:03,337 - galaxyscore - INFO - Fetched 3Commas pairs blacklist OK (179 pairs)
2021-11-11 23:00:03,408 - galaxyscore - INFO - Fetched 3Commas BTC price in USDT 65164.28 OK
2021-11-11 23:00:04,271 - galaxyscore - INFO - Fetched LunarCrush Top X gs OK (50 coins)
2021-11-11 23:00:04,271 - galaxyscore - INFO - Finding the best pairs for Binance Main exchange
2021-11-11 23:00:04,326 - galaxyscore - INFO - Fetched 3Commas market data for binance OK (1312 pairs)
Traceback (most recent call last):
File "/bot/3commas-cyber-bots/galaxyscore.py", line 659, in
find_pairs(botdata)
File "/bot/3commas-cyber-bots/galaxyscore.py", line 427, in find_pairs
if float(lunacrush[coin]) < float(minvolume):
TypeError: float() argument must be a string or a number, not 'NoneType'

Unknown error occurred#Exceptions::OpenDealPresentForThisPair None None

After running the watchlist.py script for a few days, the following errors sometimes shows up in the logs:

Error occurred while triggering start_new_deal bot 'Bot name' error: Other error occurred: Unknown error occurred#Exceptions::OpenDealPresentForThisPair None None.

Most of the time, the corresponding coin is added to 3commas, but i've also seen instances where the coin didn't got added.

TP Increment account type fix

Hi mate

please see attached fixes. there was an issue with checking for deals depending on what account was selected within the 3commas website (paper / real).

i have fixed this and also removed code which is no longer needed.

thanks
tpincrement.txt

TSL Helper

So another feature I've created. The ability to update the SL with a TSL function.

As 3C doesnt appear to allow any TSL for bots, only TTP. TSL only appears to work on smart trade, so I want the ability to have TSL for my futures bots which dont have any SO.

Not sure how this script would work with bots that make use of many SO's - so please bear this in mind.

activation-percentage in the config, will only check and activate the TSL when the profit % is >= . Below the activation-percentage, the SL is not updated.

I would suggest a quicker interval for checking, so the config sets this to 90 seconds by default.

You must have a SL set on the deals within the bot you want this script to manage.

The script will keep track of the last profit % the SL was updated, and will compare the lastest profit %, and move the TSL up when required. The script does not move the SL down, as this wouldnt make sense.
I have also catered for the fact that the user might update the SL manually after activation on the 3C website - in this case the TSL is restarted for the deal that was manually altered.

Appears to work, again this only has limited testing.

I would use this with caution. I am only using this to reduce my liquidation risk on my futures bots - but could be used with spot bots if you know what you're doing.
tsl.txt

Script stopped working

Hi,

Im getting the following error in the logs ?

2021-10-22 13:31:13,871 ERROR - Fetching LunarCrush Top X GalaxyScore failed with error: 502 Server Error: Bad Gateway for url: https://api.lunarcrush.com/v2?data=market&key=******************&limit=50&sort=gs&desc=true

2021-10-22 13:31:13,871 ERROR - Fetching LunarCrush Top X GalaxyScore failed with error: 502 Server Error: Bad Gateway for url: https://api.lunarcrush.com/v2?data=market&key=******************&limit=50&sort=gs&desc=true

I cannot link the telegram account with the bot helper

Hello again! you don't know how much I tried to avoid having to ask for help but I don't know what else to do :/

I comment the case I followed all the steps to get my bot token and chat id, then I embed it in the main code. As shown in the tutorial example.
And it cannot be started.
telegram error2

"
Traceback (most recent call last):
File "/home/droidg/3commas-cyber-bots/altrank.py", line 185, in
notification = NotificationHandler(
File "/home/droidg/3commas-cyber-bots/./helpers/logging.py", line 22, in init
urls = json.loads(notify_urls)
File "/usr/local/lib/python3.9/json/init.py", line 346, in loads
return _default_decoder.decode(s)
File "/usr/local/lib/python3.9/json/decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/usr/local/lib/python3.9/json/decoder.py", line 355, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 2 (char 1)
"

I installed Apprise to auto-send me a message and it arrived correctly, so the chat id and the bot id works fine

Captura de pantalla 2022-01-08 042159

Captura de pantalla 2022-01-08 042311

It's the last thing I need to learn. I hope you can give me a hand. Thank you

Error: record_invalid Invalid parameters {'max_active_deals'

My bot had already some activity on it. Max active deals present (20). Started the Galaxyrank bot and changed to 25 in 3Commas. 15 pair max in galaxyrank.ini Start and update were fine. After first hour the update of pairs is fine, but at the end an error is thrown (BOTID replaced with xxx):

2021-11-15 22:18:31 - galaxyscore.py - DEBUG - These pairs are invalid on the 'Binance' market according to 3Commas and were skipped: ['BUSD_BLOK2', 'BUSD_KCS', 'BUSD_RNDR', 'BUSD_POWR', 'BUSD_CSPR', 'BUSD_VRA', 'BUSD_PIT', 'BUSD_CRO', 'BUSD_MIX', 'BUSD_BLZ']
2021-11-15 22:18:31 - galaxyscore.py - DEBUG - Current pairs: ['BUSD_BAT', 'BUSD_FLOW', 'BUSD_INJ', 'BUSD_MATIC', 'BUSD_NANO', 'BUSD_ONE', 'BUSD_QNT', 'BUSD_SKL', 'BUSD_STX', 'BUSD_SXP', 'BUSD_SYS', 'BUSD_TRX', 'BUSD_UTK', 'BUSD_XRP', 'BUSD_XTZ']
New pairs: ['BUSD_NANO', 'BUSD_SYS', 'BUSD_POLY', 'BUSD_QNT', 'BUSD_XLM', 'BUSD_FLOW', 'BUSD_UTK', 'BUSD_SXP', 'BUSD_ANT', 'BUSD_SOL', 'BUSD_STX', 'BUSD_AVAX']
2021-11-15 22:18:31 - connectionpool.py - DEBUG - https://api.3commas.io:443 "PATCH /public/api/ver1/bots/xxx/update HTTP/1.1" 400 144
2021-11-15 22:18:31 - galaxyscore.py - ERROR - Error occurred while updating bot 'BUSD Multi Long Bot' error: Other error occurred: record_invalid Invalid parameters {'max_active_deals': ['must be less than or equal to 24']}.
2021-11-15 22:18:31 - galaxyscore.py - INFO - Next update in 3450 Seconds at 23:16:01

My galaxyrank.ini:

[settings]
timeinterval = 3450
debug = True
logrotate = 7
botids = [xxx]
numberofpairs = 15
accountmode = real

I'm running the latest main version of software (did a GIT PULL just before startup)

Dynamic Max Active Deals modification when updating coin pairs + GalaxyScore threshold

Is your feature request related to a problem? Please describe.
Here's one problematic situation: suppose you want to update your coin pairs with AltRank, but you only want to get top20 pairs (because you might get from experience that below that threshold you really don't get good performances). Suppose that due to some restrictions (available pairs on your exchange + blacklisted coins) you end up cutting off the top20 AltRank list down to a number of coins which is below your bot's "Max active deals" number. In this case the script will fail telling you that your "Max active deals" number must be below or equal to your suitable pairs list's length. No update is then performed.

Describe the solution you'd like
In my opinion, a possible solution would be the following. Set an if condition and when the "restricted-suitable-pairs" list is shorter than expected from "Max active deals" original setting, just set "Max active deals" equal to its length (or any similar solution to always impose "Max active deals" matching "restricted-suitable-pairs" length, but only if this length is lower than the original - this is a conservative approach -). I believe this is pretty straightforward to do with a little modification in routine set_threecommas_bot_pairs inside helpers/threecommas.py.

Describe alternatives you've considered
If this was done, then it would be more viable to build a GalaxyScore threshold parameter (for example: update list of coins with just coins from GalaxyScore >= 70). There might be bad market days in which GalaxyScore is low for any coin and even if one coin is the top 1 in GalaxyScore we still don't want to use it as its absolute metric is bad. This would be a strong update to GalaxyScore helper which can't be done instead with AltRank helper as AltRank is just a relative metric and not an absolute one.

Additional context
Screenshot from error related to the case described in the first section:
image

TP % Adjustments

Hi thanks for the hard work you have put into this. Ive been using the altrank and compounding with great sucess and nice profits along the way. so thank you!

What would be a nice to have is a script which will auto increment the TP % based on how many SO have been executed on a trade - the script will only adjust deals which are assigned to the bot id's which are specified in the config.

For example, for every SO executed, the TP % increases 0.25% (based on user inputted configuration). This would allow you to profit more from the volatility of a coin.

Hope this makes sense... and once again, thank you!

Blacklist for futures dont work

Hello! first thanks for your work!
Now I have to clarify that I have very basic knowledge but something I defend myself. Oh and I hope the translator is understood.
The bot works correctly, except for the blacklist in futures.
To confirm that I start a new clean task: I delete the previous galaxyscore.ini then I set the blacklist.txt,. And I run the galaxyscore.py again.
For example there is a pair in binance futures that was running continuously USDT_NEARUSDT and I had already put it in the blacklist.txt. Unfortunately the native 3commas blacklist does not omit these pairs and the bot places them the same, as my SO and BO is the minimum, the bot does not save the changes and does nothing showing me an insufficient funds error from the 3c-helper, since NEAR It asks for 17 dollars minimum to run.
I really don't know how to make the bot skip certain pairs from 3c cyber-bots helper
I hope you give me a hand, thank you!

image

edit:
Solution, correct sintax for futures (old):
USDT_BTC
USDT_SOL
USDT_UNI
....
USDT_XXX

edit2:
Now correct sintax (for futures) with the new update (~01/07/22)
USDT_BTCUSDT
USDT_SOLUSDT
USDT_UNIUSDT
....
USDT_XXXUSDT

Request to add kucoin exchange

Is your feature request related to a problem? Please describe.
No

Describe the solution you'd like
I would like to be able to use kucoin exchange pairs.

Describe alternatives you've considered
N/A

Additional context
N/A

File not Found Error

I have upgraded the Repo from 57ffeff..6c6d672

2021-11-28 00:55:21 - altrank.py - 3Commas bot helper altrank
2021-11-28 00:55:21 - altrank.py - Started at Sunday 00:55:21 28-11-2021
2021-11-28 00:55:21 - altrank.py - Loaded configuration from '/var/git/3commas-cyber-bots/altrank.ini'
2021-11-28 00:55:21 - altrank.py - Notifications are disabled
2021-11-28 00:55:21 - altrank.py - Reloaded configuration from '/var/git/3commas-cyber-bots/altrank.ini'
2021-11-28 00:55:21 - altrank.py - Fetched 3Commas pairs blacklist OK (12 pairs)
2021-11-28 00:55:21 - altrank.py - Fetched 3Commas BTC price OK (54475.15 USDT)
2021-11-28 00:55:22 - altrank.py - Fetched LunarCrush ranking OK (100 coins)
2021-11-28 00:55:23 - altrank.py - Bot base currency: BUSD
2021-11-28 00:55:23 - altrank.py - Bot minimal 24h BTC volume: 500.0
Traceback (most recent call last):
File "altrank.py", line 648, in
find_pairs(botdata)
File "altrank.py", line 430, in find_pairs
marketcode = get_threecommas_account(thebot["account_id"])
File "altrank.py", line 302, in get_threecommas_account
for account in data:
TypeError: 'NoneType' object is not iterable
Error in sys.excepthook:
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/apport_python_hook.py", line 153, in apport_excepthook
with os.fdopen(os.open(pr_filename,
FileNotFoundError: [Errno 2] No such file or directory: '/var/crash/_var_git_3commas-cyber-bots_altrank.py.0.crash'

Original exception was:
Traceback (most recent call last):
File "altrank.py", line 648, in
find_pairs(botdata)
File "altrank.py", line 430, in find_pairs
marketcode = get_threecommas_account(thebot["account_id"])
File "altrank.py", line 302, in get_threecommas_account
for account in data:
TypeError: 'NoneType' object is not iterable

Option to stop bots

Is your feature request related to a problem? Please describe.
There are times when the bot might not be able to update the 3commas bot through an API request,e.g., number of pairs less then number of deals. Not being able to get altrank scores etc. In these cases 3commas will lag behind the altrank scores causing issues.

The second stop bot feature with an optional close deals features should be tied with bitcoin dump e.g., if bitcoin falls 0.5% in last 15 minutes stop bot and close all open deals. When a dump like that is in effect, lunarcrush stats become useless for an hour or so. So manual intervention is usually required. This could also be tied with overall crypto marketcap, i.e., if crypto market falls by x% in x minutes. I would love to hear other peoples thoughts on this.

Describe the solution you'd like
Option to Stop bot on failure to update the 3commas bot(any error) and on bitcoin dump.

TP Increment - further enhancments

Hi me again

i have been using this with great sucess and increasing the profits more on my account. but i have increased my safety order allocation on my deals which could result in a big TP % increase, so I wanted more control of the increase TP % per completed SO.

So i have implemented a 'step scale', which will increase each safety order to a specifed amount. For example, the config file now needs the following variable:

increment-step-scale = [0.1, 0.05, 0.03]

so how this works using the above config, is:
safety order 1 increment is 0.1%
safety order 2 increment is 0.05%
safety order 3 increment is 0.03%
safety orders > 3 are ignored and not adjusted (you can increase the number of steps in the config to cater more safety orders e.g. [0.1, 0.05, 0.03, 0.03, 0.03] will cater for 5 SO)

upon each update inteval, the safety orders are compared from the last 'run', so no SO are missed, the difference is then calculated.
For example, using the above example config:
update interval 1 = SO's complete is 0, so the increase is 0%
update interval 2 = SO's complete is 2, so the increase is 0.15%
update interval 3 = SO's complete is 3, so the increase is 0.03%

the following lines within the documentation are now invalid following this change, so can be removed:

  • If the increment value is changed in the config file, all existing deals will use the original value which is stored in the DB - so the config will not affect older deals.
  • Default increments are 0.1% for every SO completed - this can be changed in the config file.

the examples above can be added to the documentation so users can understand the concept.

this can also be ran as a service so might need a template in the scripts folder :)

This should help anyone which has a large value of max safety orders on their deals, or just want to fine tune the TP% increase for each SO.

tpincrement.txt

Enhancement Request

Hi CyberJunky,
Is it possible to include a log purge after x amount of runs ?

compound.py throws error for real bots when paper trading is active

Describe the bug
Running compound.py on a real bot, when Paper Trading is active on the 3Commas site will throw an error:

2021-12-15 13:21:51 - compound.py - ERROR - Fetching deals failed with error: {}

To Reproduce
Steps to reproduce the behavior:

  1. Which program you run
    compound.py
  2. Relevant settings used (don't paste your bot-id's, or any api-key values!)
    Pretty default settings, TP Increment to 0.75
  3. Error you get
    2021-12-15 13:21:51 - compound.py - ERROR - Fetching deals failed with error: {}
  4. Anything else what is important
    Paper trading must be active on the 3Commas Website, and the bot that is being compounded must be a real bot.

Expected behavior
Normal compounding without errors.

Environment:

  • Python version: python3 -V
    Python 3.8.12
  • Operating System: uname -a
    Linux compound-btc 5.15.7-200.fc35.x86_64 #1 SMP Wed Dec 8 19:00:47 UTC 2021 x86_64 GNU/Linux
    Running in Docker
  • Version of software [e.g. 0.6.1]:
    Current master branch

Additional context
Add any other context about the problem here.

Trouble getting started

Hello.
I have tried installing for use on Ubuntu and PythonAnywhere, following the directions provided. In both instances, I get the following for either Galaxy or Altrank:

Traceback (most recent call last):
File "/home/mkgort/3commas-cyber-bots/./galaxyscore.py", line 636, in
botids = json.loads(config.get("settings", "botids"))
File "/usr/local/lib/python3.9/json/init.py", line 346, in loads
return _default_decoder.decode(s)
File "/usr/local/lib/python3.9/json/decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/usr/local/lib/python3.9/json/decoder.py", line 355, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 2 (char 1)

The log shows:
10 2021-11-22 21:53:07 - galaxyscore.py - INFO - 3Commas bot helper galaxyscore
11 2021-11-22 21:53:07 - galaxyscore.py - INFO - Started at Monday 21:53:07 22-11-2021
12 2021-11-22 21:53:07 - galaxyscore.py - INFO - Loaded configuration from '/home/mkgort/3commas-cyber-bots/galaxyscore.ini'
13 2021-11-22 21:53:07 - galaxyscore.py - INFO - Using PAPER TRADING account
14 2021-11-22 21:53:07 - galaxyscore.py - INFO - Notifications are disabled
15 2021-11-22 21:53:07 - galaxyscore.py - INFO - Reloaded configuration from '/home/mkgort/3commas-cyber-bots/galaxyscore.ini'

And then nothing happens.

Admittedly I'm not familiar with Python, but I would really like to get this to work.

Do you have any suggestions on what could be the issue?

Cheers!

beginner question

Hi, I'm a total noob and I have no experience with Python. But I successfully downloaded the files to Pythonanywhere, modified 3commas api key and api secret, but:
1)I don't know how to set up apikey LunarCrush. (I only found the V2 api key at legacy.lunarcrush.com)

  1. When I run python3 ./altrank.py this comes out:
    python3 ./altrank.py
    Traceback (most recent call last) :
    File
    "/home/jak9n/3commas-cyber-bots/./altrank.py", line 602, in module>
    notification = NotificationHandler
    File
    "/home/jak9n/3commas-cyber-bots/./altrank.py", line 26, in
    _init
    urls = json. loads (notify_urls)
    File
    "/usr/local/lib/python3.9/json/init
    .py", line 346, in loads
    return
    default decoder.decode(s)
    File
    "/usr/local/lib/python3.9/json/decoder.py"
    line 337, in decode
    obj,
    end = self.raw decode(s,
    idx=_w(s,
    • end () )
      File
      "/usr/local/lib/python3.9/json/decoder.py", line 355,
      line 355,
      in raw decode
      raise JSONDecodeError("Expecting value"
      S,
      err. value) from None
      ison. decoder-JSONDecodeError: Expecting value: line 1 column 2 (char 1)

I'm sorry, I really don't know what I'm doing wrong.

compound.py not finding bot ID's

Hello, I'm on a raspberry pi with Bullseye. I'm not sure if this is a bug or most likely something I'm doing wrong. when I run python3 ./compound.py each bot ID i setup in the .ini comes back as not found.

Error Occurred compounding bots: other error occurred: not_found Not Found None

This happens for each bot id, I have triple checked each bot id # is correct. i have also put in my 3commas api and key.

Also, when i try to run the command to view the error log errors come up saying path could not be found, I noticed in the errors it shows path /home/ron... even though i had edited the compound files in /scripts to reflect the correct username and path.
any quick things to check?

Request: Automatic Compound and grid modifying

Hi,

Great work on this! You've asked for idea's to do.

What I would like is automatic gridbot management. I do this by hand and consumes a lot of time monitoring this and modifying the grids if it gained and the price moved outside the grid.

I have 2 ideas:

  • Automatic compounding at a set interval to put the gains back in the grid
  • Follow the price (also at a set interval?) if it got outside the grid settings, but maintain the grid width (with a margin off course)

Thing to keep in mind:
Sometimes you need to stop the grid if modifying it, before accepting the new settings. Not sure this is a 3commas gui problem.

Other error occurred: record_invalid Invalid parameters

Describe the bug
When running the compound.py script, the error below shows in the logs when it's trying to update the BO/SO.

To Reproduce
Steps to reproduce the behavior:

  1. Which program you run
    compound.py

  2. Relevant settings used (don't paste your bot-id's, or any api-key values!)

[settings]
timezone = Europe/Amsterdam
timeinterval = 3600
debug = False
logrotate = 7
botids = [1234, 12345]
profittocompound = 0.9
3c-apikey = [...]
3c-apisecret = [...[
notifications = False
notify-urls = ['notify-url1', 'notify-url2']
  1. Error you get
2021-11-27 19:27:13 - compound.py - ERROR - Error occurred updating bot with new BO/SO values: Other error occurred: record_invalid Invalid parameters {'pairs': ['No market data for this pair: USDT_AAVEDOWN', 'No market data for this pair: USDT_AAVEUP', 'No market data for this pair: USDT_SXPDOWN', 'No market data for this pair: USDT_SXPUP']}.

Environment:

  • Python version: Python 3.8.10
  • Operating System: Ubuntu 20.04
  • Version of software [e.g. 0.6.1]: 0.7.9

Watchlist - another format

Hi, would it be possible to set the watchlist to a different telegram message format?
For example, I receive messages in the format:

WIN/USDT
Vol: 8965790.70 Base: 0.00566600 Price: 0.00508700

Thanks in advance.

Leverage

Hi, everything works absolutely fantastic, but I have a problem with futures. Why the minimum leverage is only 25, and the minimum basic order varies by pairs. It could be done to use a maximum leverage of 100x. And for a pair where it is not allowed leverage 100x the maximum allowed leverage for that pair? When this error pops up, the pairs no longer update. Thank you image

Compound profit over all running bots

Is your feature request related to a problem? Please describe.
It would be nice to group some bots and distribute the total profit.

Describe the solution you'd like
Example: You have botids 1001, 1002,1003 and 1004.
Bot 1001 takes 1USD/btc profit. It would compound 0,25 into each bot.

Describe alternatives you've considered
/

Additional context
It would be even better tot have a distribution key to give some bots more weight for compounding profit.

Unable to start service

I ran the command as described:

$ sudo cp scripts/3commas-galaxyscore-bot.service /etc/systemd/system/
$ sudo systemctl start 3commas-galaxyscore-bot.service

It doesn't seem to do anything, just hangs on that line after I pressed enter. Tried to chmod +x as well but it doesn't seems to be any helpful. There are no further information under journalctl too.

$ journalctl -r -u 3commas-galaxyscore-bot.service
-- Logs begin at Tue 2021-11-16 17:18:12 CET, end at Thu 2021-11-18 16:07:43 CET. --
-- No entries --

Any ideas?

Thank you in advance

Timezone

Hi Cyberjunky, Kindly can you implement a time zone setting (TZ) in the *ini files ?

import os
import time
os.environ["TZ"] = "xxx/xxxx"
time.tzset()

Keep getting Not a crypto trigger message, or exchange not yet supported.

Dear ,

I get error with watchlist.py Not a crypto trigger message, or exchange not yet supported. while testing the helper

i have tried all type of message to trigger the bot but i keep getting this error
Screenshot_4

kindly let me know how do I trigger the bot with message also how can we change the trigger message to ( Buy #coin , #coin buy )

Thanks for the amazing scripts .

Integrate Coinmarketcap API

How about integrating the API of Coinmarketcap. Then you could filter the cryptocoin pairs by additional criteria like market cap or trading volume.

FTX perpetuals not recognized

Perpetual coins are not being recognized by the tool i wonder if its possible to include them. Thank you for your hard work !!

Notifications for tsl_and_tp.py

Is your feature request related to a problem? Please describe.
When using the tsl_and_tp.py, a notification is sent every 120 seconds. The same as when it runs. I want the notifications when a change is made, but not every 2 minutes when there is no change.
Describe the solution you'd like
Add a line of code that allows notifications only when the py makes a change to the current deal.
Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
I really love the work you have done!
Thank you.

Blacklist for Stablecoins

I use the bot since Sunday and it works well.
I have selected Altlist as data source
Yesterday I loaded the pair USDC/BUSD into the bot and started a trade. Of course, there is not much to expect.
Would it be possible to make an extra blacklist for stablecoins and then include it in the config file with stablecoin = true/false? Alternatively, each user must always know all stablecoins and include them.
Maybe you can get the list of stablecoins via API from a service like Coinmarketcap?

None of the by LunarCrush suggested pairs have been found on the Binance Main exchange!

Pulled the new version of the script, but it seems there's something wrong with checking the pairs against the Binance exchange.
Think it has to do with the 24h check:

python3 galaxyscore.py
2021-11-18 09:38:24 - galaxyscore.py - 3Commas bot helper galaxyscore
2021-11-18 09:38:24 - galaxyscore.py - Started at Thursday 09:38:24 18-11-2021
2021-11-18 09:38:24 - galaxyscore.py - Loaded configuration from '/bot/cyberbotv2/3commas-cyber-bots/galaxyscore.ini'
2021-11-18 09:38:24 - galaxyscore.py - Using REAL TRADING account
2021-11-18 09:38:24 - galaxyscore.py - Notifications are disabled
2021-11-18 09:38:24 - galaxyscore.py - Reloaded configuration from '/bot/cyberbotv2/3commas-cyber-bots/galaxyscore.ini'
2021-11-18 09:38:24 - galaxyscore.py - Fetched 3Commas pairs blacklist OK (179 pairs)
2021-11-18 09:38:25 - galaxyscore.py - Fetched 3Commas BTC price in USDT 59602.33 OK
2021-11-18 09:38:25 - galaxyscore.py - Fetched LunarCrush ranking OK (100 coins)
2021-11-18 09:38:26 - galaxyscore.py - Fetched 3Commas market data for binance OK (1327 pairs)
2021-11-18 09:38:26 - galaxyscore.py - None of the by LunarCrush suggested pairs have been found on the Binance Main exchange!
2021-11-18 09:38:26 - galaxyscore.py - Next update in 900 Seconds at 09:53:26

Enabled debug mode and checked the log file. Seems like it skips the pairs because it cant find the 24h volume.

2021-11-18 09:42:58 - galaxyscore.py - DEBUG - Bot base currency: BUSD
2021-11-18 09:42:58 - galaxyscore.py - DEBUG - Bot exchange: Binance Main
2021-11-18 09:42:58 - galaxyscore.py - DEBUG - Bot minimal 24h BTC volume: None
2021-11-18 09:42:58 - connectionpool.py - DEBUG - https://api.3commas.io:443 "GET /public/api/ver1/accounts/market_pairs?market_code=binance HTTP/1.1" 200 None
2021-11-18 09:42:58 - galaxyscore.py - INFO - Fetched 3Commas market data for binance OK (1327 pairs)
2021-11-18 09:42:58 - galaxyscore.py - DEBUG - Could not check 24h BTC volume for quote 'RUNE', data is missing, skipping
2021-11-18 09:42:58 - galaxyscore.py - DEBUG - Could not check 24h BTC volume for quote 'SDT', data is missing, skipping
2021-11-18 09:42:58 - galaxyscore.py - DEBUG - Could not check 24h BTC volume for quote 'WOO', data is missing, skipping
2021-11-18 09:42:58 - galaxyscore.py - DEBUG - Could not check 24h BTC volume for quote 'SPELL', data is missing, skipping
2021-11-18 09:42:58 - galaxyscore.py - DEBUG - Could not check 24h BTC volume for quote 'GLCH', data is missing, skipping
2021-11-18 09:42:58 - galaxyscore.py - DEBUG - Could not check 24h BTC volume for quote 'ATOM', data is missing, skipping
2021-11-18 09:42:58 - galaxyscore.py - DEBUG - Could not check 24h BTC volume for quote 'TIME2', data is missing, skipping
2021-11-18 09:42:58 - galaxyscore.py - DEBUG - Could not check 24h BTC volume for quote 'MATH', data is missing, skipping
2021-11-18 09:42:58 - galaxyscore.py - DEBUG - Could not check 24h BTC volume for quote 'GHST', data is missing, skipping
2021-11-18 09:42:58 - galaxyscore.py - DEBUG - Could not check 24h BTC volume for quote 'TRADE', data is missing, skipping

Volume Scale

Currently there is no option to include the Volume Scale in the calculation of updated BO/SO's.
It works only with Volume Scale 1

Galaxyscore.py with paperaccount - error: Fetching 3Commas account failed

Describe the bug
Hello,
First of all thank you for sharing this amazing tools!

I tried to use galaxyscore.py using docker with paper account on 3 commas.
When I start the container, I get this error message:

2021-12-20 11:03:28 - galaxyscore.py - 3Commas bot helper galaxyscore!

2021-12-20 11:03:28 - galaxyscore.py - Started at Monday 11:03:28 20-12-2021

2021-12-20 11:03:28 - galaxyscore.py - Loaded configuration from 'config/galaxyscore.ini'

2021-12-20 11:03:28 - galaxyscore.py - Notifications are enabled

2021-12-20 11:03:28 - galaxyscore.py - Reloaded configuration from 'config/galaxyscore.ini'

2021-12-20 11:03:28 - galaxyscore.py - Fetched 3Commas pairs blacklist OK (0 pairs)

2021-12-20 11:03:28 - galaxyscore.py - Fetched 3Commas BTC price OK (45938.02 USDT)

2021-12-20 11:03:29 - galaxyscore.py - Fetched LunarCrush ranking OK (100 coins)

2021-12-20 11:03:29 - galaxyscore.py - Bot base currency: USDT

2021-12-20 11:03:29 - galaxyscore.py - Bot minimal 24h BTC volume: 0.0

Traceback (most recent call last):

  File "galaxyscore.py", line 651, in <module>

    find_pairs(botdata)

  File "galaxyscore.py", line 430, in find_pairs

    marketcode = get_threecommas_account(thebot["account_id"])

  File "galaxyscore.py", line 309, in get_threecommas_account

    logger.error("Fetching 3Commas account failed with error: %s" % error["msg"])

KeyError: 'msg'

Environment:

  • Python version: v 3.9.9
  • Operating System: Windows 10 + Docker Destop v4.3.0

Additional context
I am using paper account on 3 commas

Thanks for your help

Change bot in order to add coins correlated to those in LunarCrush

Some free services like this or this offer the possibility to know coins that have a behavior extremely similar or are the opposite of other coins.
I believe that we could scale profits if we had the option to add these positively correlated or negatively correlated coins to the existent 10 altrank/galaxyscore coins.

Is it possible to have another helper/script that looks for these correlated coins in these services above-mentioned and that can automatically update the bot?

Issue fetching lunarcrush data

Hi,
I followed to setup and the readme for the altrank.

everything start well but it create an error at the moment he try to fetche lunarcrush data
soryy i found the problem...

Trailingstoploss enhancements

updated the code to add a initial set % which is specified in the config file.

this will allow the below scenario:
original deal SL is 5%
the activation % is triggered at 2% profit
the script can move the SL straight to -0.01% to guarantee profit
the TSL will then track the price up to ensure more guaranteed profit.

users need to amend the following in the ini file (upgrade code included in script):
set-sl-percentage-at-first-activation.
value '[]' = empty - which means the script will continue working as the old revision and a traditional TSL
a decimal value = a specified amount the SL will immediately be set to on the first activation

trailingstoploss.txt

compound.py gives UnicodeEncodeError

Python gives the following error when running compound.py

--- Logging error ---
Traceback (most recent call last):
File "C:\Program Files (x86)\Python38-32\lib\logging_init_.py", line 1084, in emit
stream.write(msg + self.terminator)
File "C:\Program Files (x86)\Python38-32\lib\encodings\cp1252.py", line 19, in encode
return codecs.charmap_encode(input,self.errors,encoding_table)[0]
UnicodeEncodeError: 'charmap' codec can't encode character '\u20bf' in position 54: character maps to
Call stack:
File "compound.py", line 541, in
compound_bot(botdata)
File "compound.py", line 413, in compound_bot
update_bot(
File "compound.py", line 300, in update_bot
logger.info(
File "compound.py", line 167, in info
self.log(message, "info")
File "compound.py", line 157, in log
self.my_logger.info(message)

Feature request - Notification enhancement

Feature Request (low priority / nice to have)

Im having a hard time tracking if all my scripts successfully ran or not and if their are any errors.

Solution I would like

One Telegram bot one to provide summary information
10:00 - 5 of 5 python scripts on the 1h schedule ran with 0 errors, 0 warnings
10:15 - 2 of 2 python scripts on the 15m schedule ran with 0 errors, 0 warnings
10:30 - 1 of 1 python scripts on the 60s schedule ran with 1 errors, 0 warnings*
10:30 - 5 bots had deals and were compounded

Then a separate telegram bot just for exception notifications
11:00 - GalaxyScore.py is not running.
15:00 - Lunacrush api is not responding.

*Warning could be bot id not found in 3C

Does not work correctly with Binance Futures bot

Describe the bug
A) Running the alt-rank bot on a 3commas futures bot removes all settings related to leverage on the bot
B) For some pairs it throws up errors like the following

ERROR - Error occurred while updating bot 'ALTRANK - Futures' error: Other error occurred: record_invalid Invalid parameters {'pairs': ['No market data for this pair: USDT_WRXUSDT', 'No market data for this pair: USDT_POLSUSDT', 'No market data for this pair: USDT_CKBUSDT']}.

Those will then need to be blacklisted in 3commas to allow the bot to function again.

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.