self reminder:
patience is the mother of science
K
is a very low latency market making trading bot with a fully featured web interface. It can place and cancel orders on one of several supported cryptocoin exchanges in less than a few milliseconds per order on a decent machine.
Runs on unix-like systems. Persistence is achieved through a built-in server-less SQLite C++ interface.
Installation in a dedicated Debian, Raspberry, Red Hat, CentOS or macOS instance is recommended.
The web UI is compatible with most web browsers/resolutions, but Brave or Firefox at 1600px are recommended. Doesn't require configuration of any web server (unless installed behind your own reverse proxy).
with Post-Only Orders support | without Post-Only | |
---|---|---|
with Maker and Taker fees | Coinbase (fees) ⟿ REST + WebSocket + FIX Binance (fees) ⟿ REST + WebSocket Kraken (fees) ⟿ REST + WebSocket² KuCoin (fees) ⟿ REST + WebSocket Bitfinex (fees) Ethfinex (fees) ⟿ REST + WebSocket Gate.io (fees) ⟿ REST + WebSocket HitBTC (fees) Bequant (fees) ⟿ REST + WebSocket² Poloniex (fees) ⟿ REST + WebSocket |
none |
without Maker fees | BitMEX (fees) ⟿ REST + WebSocket |
none |
All currency pairs are supported.
See etc/Dockerfile file.
Before proceeding with a manual installation, ensure your target machine has Windows 7 or greater and MSYS2 installed.
Use MSYS2 Terminal to install make
(with command pacman -S make
), and then proceed as usual with the installation.
Ensure you agree to install collaborative non-free software (see Unlock section).
Ensure your target machine has git
and make
installed.
Download it wherever you want (feel free to customize the suggested folder name K) and execute the installer:
$ git clone ssh://git@github.com/ctubio/Krypto-trading-bot K
$ cd K
$ make install
K.sh
in your favorite text editor: $ vim K.sh
To upgrade anytime see Upgrade to the latest commit section.
Ensure you agree to install collaborative non-free software (see Unlock section).
Ensure your target machine has curl
and make
installed.
Download it wherever you want (feel free to customize the suggested folder name K) and execute the installer:
$ mkdir K
$ cd K
$ curl -O krypto.ninja/Makefile
$ make install
K.sh
in your favorite text editor: $ vim K.sh
To upgrade anytime to the latest release just run make reinstall
.
See etc/K.sh.dist file or better your own copy of K.sh
file located in the top level path.
It just contains a few variables with examples. The very end of the file contains the code that starts the bot.
Once your config file is ready, you can execute it to start the bot:
$ ./K.sh
Alternatively use make start
to run K.sh
in the background using screen (to see the output, attach the screen with make screen
[or run all at once with make start screen
]).
Feel free to run make stop
or make restart
anytime, and don't forget to read the fucking manual.
Troubleshooting:
--list
argument.Optional:
See ./K.sh --help
to trade or make help
to develop.
Use your own SSL certificate with --ssl-crt
and --ssl-key
, see web ui section. Otherwise, the insecure built-in certificate is a fully featured default openssl, that you may just need to authorise in your browser.
If you upgrade while having any instance running in the background, you will need to manually restart it using make restart
or make restartall
to start using the latest version.
Please run make reinstall
to download the upgraded source and executable files.
Feel free anytime to check if there are new upgrades with make diff
.
Once you decide that it is time to upgrade, execute make upgrade
(or directly make reinstall
to skip the validation of new commits).
If you only use git
to pull the latest source files from the remote branch, you will still need to upgrade or recompile your executable files.
To not upgrade but instead recompile your own modified source files, use make lib K
or just make
(see Build notes).
Please note, an "instance" is in fact a *.sh
config file; using a single machine with a single installation, you can run as many instances as *.sh
files you have (limited by the available free RAM).
You can list the current running instances with make list
.
If you haven't defined a config file, make start
, make screen
, make stop
and make restart
will use the default config file K.sh
.
To run multiple instances using a collection of config files:
Create a new config file with cp etc/K.sh.dist X.sh && chmod +x X.sh
(use X.sh
or any name but keep .sh
extension).
Edit the new config file vim X.sh
Run the new instance with ./X.sh
or to run in the background, use K=X.sh make start
. To attach to the new instance's screen, use K=X.sh make screen
. To stop the new instance, use K=X.sh make stop
and to restart it, use K=X.sh make restart
. The environment variable K
specifies the filename of the config file that you want to use.
Open in the web browser the different pages of the ports of the different running instances, or display the UI of all instances together in a single page using the MATRYOSHKA link in the footer (that can be predefined using the optional argument --matryoshka=URL
).
After multiple config files are setup, to control them all together instead of one by one, the commands make startall
, make stopall
and make restartall
are also available, just remember that config files with a filename starting with underscore symbol "_" will be skipped.
Open your web browser to connect to HTTPS port 3000
(or your configured port number) of the machine running K. If you're running K locally on Mac/Windows on Docker, replace "localhost" with the address returned by boot2docker ip
.
Read up on how to use K and market making in the manual.
Use the web UI to change the quoting parameters. Click the "BTC/USD" button to start making markets. Click it again to stop. When the button is green, the bot is actively placing orders.
Once K
is up and running, visit HTTPS port 3000
(or your configured port number) to access the UI (i.e. https://localhost:3000). There are inputs for quoting parameters, grids to display market orders, market trades, your trades, your order history, your positions, and a big button with the currency pair you are trading. When you're ready, click that button green to begin sending out quotes. The UI uses angularjs hydrated with websockets observed with reactivexjs.
If you want to generate your own certificate see SSL for internal usage.
In case you really want to use plain HTTP, use --without-ssl
argument.
Each currency pair of each exchange will use a different sqlite database file with WAL mode enabled.
All database files are located at /var/lib/K/db/K-*.db*
, outside the download folder to survive wild rm -rf path/to/K
or reinstalls.
You can copy any group of *.db*
files to another machine when migrating or as a backup.
If a database does not exist, the application will create it on boot; otherwise, it will use the existing one.
To explore each database you can use https://github.com/sqlitebrowser/sqlitebrowser or a similar tool.
To set a different database filename or to set an in-memory database, use --database=FILE
argument (see --help
).
Even if using an in-memory database, the quoting parameters are always loaded from and saved into the disk file database.
The metrics are not saved anywhere, it is just UI data collected with a visibility retention of n
hours (where n
is the value of profit
quoting parameter), to display over time:
If you ask me, is a very nice web hosting company (awesome support team, awesome servers). Feel free to use this referral link to get a discount subtracted from my referral earnings (i'm a user since 2008).
Make sure your build machine has node installed, also ensure make lib
provides all dependencies without errors.
To rebuild the application with your modifications, see make help
and choose a target (just make
may be what you are looking for).
Test units are executed before the application exits, only if the application was compiled with KUNITS=1 make
.
Otherwise, just make
without the environment var KUNITS
produces an application that simply exits on exit.
A quick test runner therefore is ./K.sh --version
or the alias make test
or all at once with KUNITS=1 make K test
.
To pipe the output to stdout, execute the application in the foreground with ./K.sh --naked
.
To ignore the output, execute the application in the background with screen -dmS K K.sh
or with the alias make start
or simply ./K.sh
.
For more information consider to follow the white rabbit, but its dangerous to go alone, take this:
c sandbox: wandbox.org
js sandbox: jsfiddle.net
ws sandbox: websocket.org
Added Hello World bot, Portfolios bot, Scaling bot and Stable bot.
Added Binance, Kraken, KuCoin, Gate.io and BitMEX API.
Updated exchange integrations as simple libcurl wrappers.
Added main KryptoNinja class derived from all other classes and ready to be extended.
Added C++ OOP everywhere.
Added test units.
Added --interface=IP argument to bind outgoing traffic to a specific network interface.
Added Ethfinex
and FCoin
API.
Added build-in document root to stop reading files from disk.
Added build chain for win32.
Updated OKEx websocket to binary data.
Added build chain for OSX v10.13.
Updated HitBTC API v2.
Added ZIP installation steps for non-git-lovers.
Added HamelinRat quoting mode and Trend safety thanks to b-seite and serzhiio contributions.
Added command-line arguments.
Updated quoting engine and gateways without nodejs.
Added Makefile to replace npm scripts.
Added PNG files as configuration files.
Added built-in C++ WWW Server to replace expressjs and socketio.
Added built-in SQLite C++ interface to replace external mongodb server.
Added Poloniex API.
Updated application name to K because of Kira.
Added nodejs7, typescript2, angular4 and reactivexjs.
Added cleanup of bandwidth, source code, dependencies and installation steps.
Added many quoting parameters thanks to Camille92 genius suggestions.
Added support for multiple instances/config files with nested matryoshka UI.
Added npm scripts, david-dm, travis-ci, coveralls and codacy.
Added historical charts to replace grafana.
Added C++ math functions.
Updated OKCoin API (since https://www.okcoin.com/t-354.html).
Updated Bitfinex API v2.
Added Coinbase FIX API.
Added Korbit API.
Added new quoting styles PingPong, Boomerang, AK-47.
Added cleanup of database records, memory usage and log recording.
Added audio notices, realtime wallet display, and grafana integration.
Added https, dark theme and new UI elements.
Added a bit of love to Kira.
see the upstream project michaelgrosner/tribeca.
The bot is unlocked for collaborators and contributors (feel free to make acceptable Pull Requests for already opened issues or for anything you consider useful, and let me know the BTC Payment Address for the bot that you wish to unlock in the description of the PR, and I will credit it for you).
While locked, the orderbook will be in realtime 121 seconds, and later it will be updated only once every 121 seconds.
Anonymous users can also unlock any API Key by paying 0.01210000 BTC to the address displayed on exit.
Once unlocked you may use different bots or currency pairs or reinstall on a different machine with the same unlocked API Key. However, if you want to use more than one exchange, you will need to pay again to unlock the API Key for each exchange.
Otherwise if you choose to not support further development by ctubio, just keep running some old commit and do not upgrade (any commit prior to v0.3.0 was completely unlocked).
Please don't open issues asking how much % less the bot generates with --free-version
; it is relative to your trading strategy, the market conditions, and the bot's performance.
nope, this project doesn't have maintenance costs. but you can donate to your favorite developer today! (or tomorrow!)
or see the upstream project michaelgrosner/tribeca.
or donate your time with programming or financial suggestions in the IRC channel #krypto.ninja at irc.libera.chat on port 6697 (SSL), or 6667 (plain); or feel free to make any question, but questions technically are not donations.
IRC is awesome!
but if you dislike it, consider to create a new discussion permanently readable by everybody.
If you need installation or usage support, please create a new discussion.
To request new features open a new issue and explain your improvement as you consider.
To report errors open a new issue only after collecting all possible relevant log messages.
Pull Requests are welcome, but adhere to the Contributor License Agreement:
If love is so nice, tell me why are you so sad?
If love is so nice, tell me, oh tell me why are you hurt so bad?
One Love! get ready!
Now feel this drumbeat as it beats within,
playin' a riddim, resisting against the system:
We have already enough policemen,
if you like adventures choose to be a brave firefighter.
Violence should not be the answer to those who
are asking for freedom.
+ 99999
Crypto Trading Bot Deprecation Notice Firstly, I'd like to thank everyone who's shown an interest in this repo. I'd also like to apologize for my lack of support overthe last few years - I received no
Binance Trading Bot Automated Binance trading bot with trailing buy/sell strategy This is a test project. I am just testing my code. Warnings I cannot guarantee whether you can make money or not. So u
Deep Trading Agent Deep Reinforcement Learning based Trading Agent for Bitcoin using DeepSense Network for Q function approximation. For complete details of the dataset, preprocessing, network archite
TradingVue.js TradingVue.js was a hackable charting lib for traders. You could draw literally ANYTHING on top of candlestick charts. [Not Maintained] Why If you create trading software - this lib is p
Machine-Learning-and-AI-in-Trading Here is some of codes generated in Python using Machine Learning and AI for generating prediction in Stock Prices. Packages Used: Talib Scikit Learn TensorFlow Keras
问题内容: 我正在使用带有底部导航视图的简单应用程序。我有3个带有文本的片段,我想在Botton Navigation中选择一个项目时启动它们,但是我不知道在MainActivity.java中写什么。所有片段都具有.xml布局和.java。我搜索了一些代码,写了代码,搜索了视频,但没有成功。 我正在学习Fragments和UI Dynamic,因此我在Android Studio中使用“底部导航