• Welcome to forex.pm forex forum binary options trade. Please login or sign up.
 

Python Crypto Bot v4.2.1 (pycryptobot)

Started by Bitcoin, Sep 15, 2022, 05:09 pm

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Bitcoin

Python Crypto Bot v4.2.1 (pycryptobot)

Python Crypto Bot v4.2.1 (pycryptobot)
I get paid to write on Medium. Readers following me, applauding and commenting on my articles, all helps with my earnings. I provided this bot to all of you for free and actively developing it. One way you can support my efforts is to follow me on Medium and read my articles. The Medium subscription is $5 a month (roughly £3) so basically nothing in terms of the value you are getting from the bot. Your efforts here would be greatly appreciated!
Follow me on Medium for updates!
Python Crypto Bot (PyCryptoBot)
What's new in PyCryptoBot 2?
PyCryptoBot with Telegram.
PyCryptoBot Results and Config.
Coinbase Pro Portfolio Tracker.
Optional Add-on.
Coinbase Pro Portfolio Tracker.
An all-in-one view of all your Coinbase Pro portfolios. Highly recommended if running multiple bots and keeping track of their progress.
Prerequisites.
When running in containers: a working docker/podman installation.
Python 3.9.x installed -- https://installpython3.com (must be Python 3.9 or greater)
% python3 -m pip -version.
pip 21.0.1 from /usr/local/lib/python3.9/site-packages/pip (python 3.9)
Installation.
Manual.
Container.
From Github image repo.
Additional Information.
The "requirements.txt" was created with python3 -m pip freeze.
Run it.
Manual.
Docker (Option 1)
Typically I would save all my settings in the config.json but running from the command line I would usually run it like this.
docker-compose (Option 2)
To run using the config.json in template folder,
By default, docker-compose will use the config inside ./market/template . We provide this as a template for any market config.
For each market you want to trade, create a copy of this folder under market. Also create either a coinbase.key or binance.key file to each folder depending which trading platform is being used. For example, if you are trading BTCEUR and ETHEUR your market folder should look like this:
Run all your bots. Note that each market should have it's own config. Graphs will be saved on each market's folder.
Kubernetes (Helm) (Option 3)
There is a helm chart available in this repo. It will create your config.json as a configmap and the binance/coinbase keys as secrets, and mount them into the Pod. To run pycryptobot as a Kubernetes deployment, create your helm values as yaml in the following format (do not change the path to the api_key_file):
So if you created above helm values file as config-eth-eur.yaml, you would run:
Bot mechanics.
If the EMA12 is greater than the EMA26 on the 1 hour and 6 hour intervals switch to start trading on the 15 minute intervals If the EMA12 is lower than the EMA26 on the 1 hour and 6 hour intervals switch back to trade on the 1 hour intervals If a "granularity" is specified as an argument or in the config.json then smart switching will be disabled Force smart switching between 1 hour and 15 minute intervals with "smartswitch" argument or config option (1 or 0)
EMA12 is currently crossing above the EMA26 and MACD is above the Signal OR MACD is currently crossing above the Signal and EMA12 is above the EMA26 Golden Cross (SMA50 is above the SMA200) On-Balance Volume Percent > -5 Elder Ray Buy is True.
The bot will only trade in a bull market to minimise losses! (you can disable this)
Special buy cases:
"nobuynearhighpcnt" to specify the percentage from high that the bot should not buy if "disablebuynearhigh" is not specified.
EMA12 is currently crossing below the EMA26 MACD is below the Signal.
Special sell cases:
"buymaxsize" specifies a fixed max amount of the quote currency to buy with "nosellminpcnt" specifies the lower margin limit to not sell above "nosellmaxpcnt" specifies the upper margin limit to not sell below If "sellatloss" is on, bot will sell if price drops below the lower Fibonacci band If "sellatloss" is on and "selllowerpcnt" is specified the bot will sell at the specified amount E.g. -2 for -2% margin If "sellatloss" is on and "trailingstoploss" is specified the bot will sell at the specified amount below the buy high If "sellupperpcnt" is specified the bot will sell at the specified amount E.g. 10 for 10% margin (Depending on the conditions I lock in profit at 3%) If the margin exceeds 3% and the price reaches a Fibonacci band it will sell to lock in profit If the margin exceeds 3% but a strong reversal is detected with negative OBV and MACD "sellatloss" set to 0 prevents selling at a loss.
Optional Options.
Disabling Default Functionality.
"Sell At Loss" explained.
The "sellatloss" option disabled has it's advantages and disadvantages. It does prevent any losses but also prevents you from exiting a market before a crash or bear market. Sometimes it's better to make an occasional small loss and make it up with several buys than be conservative and potentially lock a trade for  crypto bot weeks if not months. It happened to me while testing this with the last crash (after Elon's tweet!). Three of my bots did not sell while the profit dropped to -10 to -20%. It did bounce back and I made over 3% a trade with any losses but I also lost out of loads of trading opportunities. It's really a matter of preference. Maybe some markets would be more appropriate than others for this.
Live Trading.
In order to trade live you need to authenticate with the Coinbase Pro or Binance APIs. This is all documented in my Medium articles. In summary you will need to include a config.json file in your project root which contains your API keys. If the file does not exist it will only work in test/demo mode.
Trading Simulation.
simstartdate takes priority over simenddate if both are given.
Simulation trades.csv.
By default, when running a simulation, if there are any orders, a file called trades.csv with all BUYS and  When you have any kind of inquiries regarding exactly where and tips on how to employ kucoin trading bot, it is possible to e mail us with our own page. SELLS will be created.
With --tradesfile you can control the name and where file is stored, eg --tradesfile BTSUDC-trades.csv.
API key / secret / password storage.
From now on it's recommended NOT to store the credentials in the config file because people share configs and may inadvertently share their API keys within.
Instead, please, create binance.key or coinbase.key or kucoin.key (or use your own names for the files) and refer to these files in the config.json file as:
Once you have done that, "api_key" and "api_secret" can be safely removed from your config file and you're free to share your configs without worrying of leaked credentials.
binance.key / conbase.key / kucoin.key examples.
Actually it's pretty simple, these files are supposed to be a simple text files with the API key on the first line, API secret on the second line and in case of coinbase and kucoin, probably the API password on the third. No comments or  crypto bot anything else is allowed,  Kucoin just the long string of numbers:
(dots are used to indicate places where the strings were shortened)
config.json examples.
Coinbase Pro basic (using smart switching)
Coinbase Pro basic (specific granularity, no smart switching)
Coinbase Pro only (new format)
Binance only (new format)
Kucoin (using smart switching)
Coinbase Pro, Binance and Kucoin (new format)
All the "config" options in the config.json can be passed as arguments E.g. -market.
Command line arguments override config.json config.
For telegram, add a piece to the config.json as follows:
You can use @botfather and  Kucoin @myidbot in telegram to create a bot with token and get a client id.
For configuring logger, add a piece to the config.json as follows: This is also default configuration of the logger,  crypto trade bot if no config is given and log is not disabled this configuration will apply.

Source: Python Crypto Bot v4.2.1 (pycryptobot)

Bybit cryptocurrencyexchanges -  cashback 20% - Registration
Binance cryptocurrencyexchanges - Registration - cashback 10%
KoCoin Cryptocurrency Exchange - cashback 20%