copyright, license, fixes

This commit is contained in:
2024-08-21 22:47:35 +02:00
parent 07ef55bcd2
commit 88ea5bbb5b
61 changed files with 2088 additions and 150 deletions

101
README.md
View File

@@ -1,22 +1,59 @@
# Warning / Disclaimer
# Dabo (crypto bot)
The software provided here is called dabo (crypto bot).
## Warning / Disclaimer
The software provided here does not guarantee any profits or function as well as sufficient security. Use at your own risk!!!
This is a private project, which is based on amateur knowledge. Trading cryptocurrencies involves an enormous amount of risks and is considered highly speculative.
It is strongly recommended to deal intensively with the subject and this bot before using it. Also, when using the possibility should be considered that due to an unfavorable market development, technical errors, bugs or other reasons, the entire invested capital can be lost. This software should therefore only be used if it is justifiable to lose the entire invested capital!
# Objective
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
It is still under development and is currently only partially functional.
## Copyright / License
Copyright (c) 2022-2024 Oliver Bohlen
The software provided here is called dabo (crypto bot)
dabo is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
dabo is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty ofMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with dabo (see COPYING file). If not, see <http://www.gnu.org/licenses/>.
## Data sources
Various data sources such as finance.yahoo.com and crypto exchanges available via ccxt are used. please check whether this is legal in your region before use.
- query1.finance.yahoo.com (economic data,...)
- 30rates.com (forecast)
- api.coingecko.com (Market-Cap)
- fapi.binance.com (OpenInterest,...)
- api.alternative.me (Fear and Greed)
- https://unpkg.com/lightweight-charts/dist/lightweight-charts.standalone.production.js (TradingView Lightweitgt Charts)
- ...
## dependencies on other software products
- CCXT (https://www.ccxt.com | https://github.com/ccxt/ccxt)
- TradingView Lightweitgt Charts (https://de.tradingview.com/lightweight-charts/ | https://github.com/tradingview/lightweight-charts)
- bash, python
- several linux programs like bc, wget,...
- ...
## Objective
The dabo-bot is intended to help make and execute timely buy and sell decisions automatically in the fast-paced crypto environment.
These decisions are made using one or more self-definable strategies.
Various market data are available as a basis for decision-making, such as price trends, RSI, MACD and EMA indicators of various time intervals, Fear and Greed Index, S&P500 data,...
# Naming
## Naming
The name Dabo comes from the Star Trek universe.
Dabo was a roulette-style game of chance developed by the Ferengi.
More information here:
https://memory-alpha.fandom.com/wiki/Dabo
I thought this fits quite well to the cryptotrading world and that's why I chose this name ;-)
# Structure
## Structure
The Bot is splitted in the following parts:
- dabo-bot: Basic Bot woth buy and sell decisions based on self-definable strategies
@@ -30,47 +67,47 @@ The Bot is splitted in the following parts:
For cummunicating with the exchange APIs CCXT is used: https://github.com/ccxt/ccxt
gaboishlib
gaboshlib
Each part runs parallel to the others in its own docker-container.
# Features
## General:
## Features
### General:
- theoretically compatible to supported CCXT exchanges. Tested with Phemex. Please let me know if there are problems with other exchanges.
- parallel processing in separate docker containers
## Dabo Bot
### Dabo Bot
- place limit and market orders and supports ...
- ... leverage trading
- ... short trades
- ... margins cross and isolated
## Dabo Symbol Ticker
### Dabo Symbol Ticker
- automatically finds all supported tokens and pairs and fetches continiously ...
- ... symbols
- ... and prices
## Dabo OHLCV Candle data
### Dabo OHLCV Candle data
OHLCV = Open, High, Low, Close and Volume of a time unit
- time units 1w, 1d, 4h, 1h, 15m and 5m
- 4h, 1h, 15m and 5m from the respective stock exchange
- 1d and 1w data from yahoo finace to have longer terms
## Dabo Indicators
### Dabo Indicators
- data per time unit
- time units 1w, 1d, 4h, 1h, 15m and 5m
- self-calculated EMA12, 26 ,50, 100, 200, 400 and 800
- self-calculated RSI5, 14, 21
- self-calculated MACD
## Dabo Market Data
### Dabo Market Data
- Yahoo Finance
## Dabo Orders
### Dabo Orders
## Dabo Transaction History
- Support of additional Exchnages/Brokers JustTrade (CSV-Import) and Bitpanda (API+CSV-Import)
## Dabo Webpage
### Dabo Webpage
- ReadOnly Overview
- Consideration of trading fees
- Automatic selection of cryptocurrencies to invest in
- Filtering of cryptocurrencies by market capitalization (data via coingecko API) e.g. only trade the 50 largest by market capitalization if available on the exchange
- Notifications via Signal Messenger to groups
- Notifications via Matrix Messenger to groups
- Individually selectable percentage of available capital per trade
- automatic definition of time intervals (e.g. every minute / every five minutes) based on the change of the rates
- Monitoring of overall market performance via own market performance index based for example on the MSCI World, leading currencies like BTC and ETH and their forecasts.
@@ -83,19 +120,19 @@ OHLCV = Open, High, Low, Close and Volume of a time unit
- Hedge mode (long and short positions the same time) not supported
## Buy conditions
### Buy conditions
- definable RSI Indicator signals min/max (RSI5, 14 and 21)
- definable MACD signals min/max
- definable minimum growth in a definable time period
## Sell conditions
### Sell conditions
- sell at defined loss limit
- hold if the result would be negative
- sell after certain time even if loss exists
- definable RSI Indicator signals min/max
- definable MACD signals min/max
# Why bash?
## Why bash?
Yes, bash is not a language in which you write something like this in a normal way.
To be honest, I'm more of a Linux admin than a programmer, so I do a lot of my work using bash.
@@ -106,7 +143,7 @@ Originally this project was supposed to be a simple script to monitor prices of
Finally, it's a hobby project and I have to see how and when I can find time for it, because there also has to be time for family, friends, work and other hobbies.
If there is someone who would like to rewrite this bot in e.g. Python, I would be happy to support them as best I can with this task. Just let me know.
# How to use/install
## How to use/install
Linux knowledge required!
Needed a running Docker install. Traefik suggested, see
@@ -116,18 +153,18 @@ https://gitea.ds9.dedyn.io/olli/debian.ansible.docker
https://gitea.ds9.dedyn.io/olli/debian.ansible.traefik.server
## Download
### Download
```
git clone https://gitea.ds9.dedyn.io/olli/dabo.git
cd dabo
```
## Build container
### Build container
```
docker -l warn compose --ansi never build --progress=plain --pull --no-cache --force-rm
```
## Configure
### Configure
Edit docker-compose.yml or create docker-compose.override.yml to fit yout needs e.g. domain and network settings or basic auth, e.g. for traefik and letsencrypt:
```
echo '
@@ -170,14 +207,14 @@ networks:
```
Optional: If you use signal-cli (https://gitea.ds9.dedyn.io/olli/debian.ansible.signal-cli.client) and want do receive Signal-Messages from the bot you can create an SSH-Key to allow sending Signal-Messages e.g.:
Optional: If you use matrix/matrix-commander (https://gitea.ds9.dedyn.io/olli/debian.ansible.matrix.server) and want do receive Matrix-Messages from the bot you can create an SSH-Key to allow sending Matrix-Messages e.g.:
```
mkdir -p home/.ssh
ssh-keygen -f home/.ssh/id_ed25519 -N "" -t ed25519
chmod 700 home/.ssh
cat home/.ssh/id_ed25519.pub
```
and add Key on your signal-cli-Server to the authorized_keys of the signal-User
and add Key on your matrix-Server to the authorized_keys of the matrix-User
Create Secrets file for your API Key(s)
@@ -200,7 +237,7 @@ vim dabo-bot.conf
Defaults in dabo/dabo-bot.conf
## Prepare/Create a stretegy
### Prepare/Create a stretegy
IMPORTANT!!!
@@ -226,7 +263,7 @@ strategies/buy.mannover-sulu-1.conf
strategies/sell.command-kirk-3.conf
```
## Create individual watch-assets.csv
### Create individual watch-assets.csv
```
cp dabo/watch-assets.csv watch-assets.csv
```
@@ -236,13 +273,13 @@ You can edit this file if you want do generate warnings or track your asstes/tra
nano watch-assets.csv
```
## Set Rights
### Set Rights
Set Rights (UID 10000 for non-root-User in running container):
```
chown -R 10000:10000 dabo data home strategies dabo-bot.conf watch-assets.csv
```
## Operational commands
### Operational commands
Run/Restart:
```
docker compose down # if an old instance is running
@@ -280,13 +317,13 @@ A Binance or OneTrading.com (ex BitpandaPro) account must exist and the API must
The access data is stored in the file .binance-secrets in the project directory in the variables API_SECRET and API_KEY.
The access rights to this file should be set to the minimum necessary for security reasons.
# Strategies
## Strategies
You can put your own code into the strateghies it will be sourced by the bot.
You can use available variables to set and read things.
## Variables to set
### Variables to set
You can simply use the following varaibles to define things:
@@ -323,7 +360,7 @@ local BUY_MINGROWTH_PERIOD
local BUY_MINGROWTH
```
## Variables with current values from the CSV files
### Variables with current values from the CSV files
```
# date from current timeframe
${f_date}
@@ -382,7 +419,7 @@ ${f_support3}
${f_resist3}
```
# Future ideas/featrues
## Future ideas/featrues
- Crypto preferences (While/Blacklist for certain currencies)
- Overview trades/profits/losses for tax declaration
- Support for decentralized exchanges like uniswap to gain more "security"