UNICORN Binance Trailing Stop Loss CLI¶
Description | Installation | Usage | Example commands | Smart Entry | Example files | Documentation | Disclaimer
After starting the engine, a stop/loss order is placed and trailed until it is completely fulfilled. If desired, a notification can be sent via email afterwards.
In addition, there is a smart entry option called jump-in-and-trail. This offers the possibility to buy spot,
future and margin assets with a limit or market order and then to trail a stop/loss order until sold.
The CLI interface ubtsl is installed during the
installation of unicorn-binance-trailing-stop-loss
with pip and is used to interact with the
unicorn-binance-trailing-stop-loss Python library.
Please read carefully all provided documentation, our disclaimer and look in the issues about known problems before using this tool - you use it at your own risk!
If you put this engine on a market, you should stop trading manually on this market yourself!
Part of ‘UNICORN Binance Suite’.
Description¶
After startup ubtsl tries to load a
ubtsl_config.ini
and a
ubtsl_profiles.ini
file from the {home}/.unicorn-binance-suite/config/ and the current working directory. Alternatively, you can specify these files explicitly with the
--configfile and --profilesfile parameters.
Once the tool is started, it trails the stop/loss order until it is completely fulfilled, sends the notifications, and then it stops.
Supported exchanges:
| Exchange | Exchange string | trail | jump-in-and-trail |
|---|---|---|---|
| Binance | binance.com |
yes | no |
| Binance Testnet | binance.com-testnet |
yes | no |
| Binance Futures | binance.com-futures |
yes | no |
| Binance Isolated Margin | binance.com-isolated_margin |
yes | yes (experimental) |
| Binance Margin | binance.com-margin |
yes | no |
Installation¶
pip install unicorn-binance-trailing-stop-loss
Every parameter that can be configured via the ubtsl_profiles.ini
or the ubtsl_config.ini
file can also be defined as a command line argument. Therefore, both files are not mandatory, but they increase the
usability immensely.
Create ubtsl_config.ini¶
A fresh ubtsl_config.ini file can be created with the following command
$ ubtsl --createconfigini
Create ubtsl_profiles.ini¶
The same command is available for the ubtsl_profiles.ini file:
$ ubtsl --createprofilesini
Open ubtsl_config.ini¶
Open the used ubtsl_config.ini file in a GUI editor:
$ ubtsl --openconfigini
Open ubtsl_profiles.ini¶
The same command is available for the ubtsl_profiles.ini file:
$ ubtsl --openprofilesini
Test the notification settings¶
If you entered valid email settings you can test the notification system:
$ ubtsl --test notification
Test connectivity to Binance API¶
If you entered valid API key and secret you can test the connectivity to the Binance API:
$ ubtsl --test binance-connectivity
Test data streams¶
Test the data streams, this test needs a defined exchange and market parameter:
$ ubtsl --test streams --exchange binance.com --market BTCUSDT
It is possible to use exchange and market values of a profile.
$ ubtsl --profile "BTCUSDT_SELL" --test streams
Usage¶
$ ubtsl --help
Alternatively, it is possible to run ubtsl in the Python environment as follows:
Linux/Mac:
$ python3 -m ubtsl --help
Windows:
$ py -m ubtsl --help
Load a profile¶
If profiles are available, they can be activated with the --profile parameter at startup.
$ ubtsl --profile BTCUSDT_SELL
Command line arguments¶
Instead of loading the values from profiles, they can also be defined explicitly via command line parameters.
Any CLI parameters will overwrite predefined values from the profile.
All parameters that expect numbers can be configured with fixed numerical values as well as with percentage values.
Example commands¶
Check if a new update is available¶
$ ubtsl --checkupdate
Show program version¶
$ ubtsl --version
Overwrite values¶
Arguments defined in the CLI overrule values from the loaded profile!
Start with profile “BTCUSDT_SELL” and overwrite the stoplosslimit:
$ ubtsl --profile BTCUSDT_SELL --stoplosslimit 0.5%
Smart entry¶
This function is still in an experimental phase and only available for Isolated Margin.
Do a smart entry by using engine = jump-in-and-trail like it is defined within the profile BTCUSDT_SMART_ENTRY
of the example_ubtsl_profiles.ini.
By activating the jump-in-and-trail engine, it first buys the predefined asset amount and then trails them
automatically.
$ ubtsl --profile BTCUSDT_SMART_ENTRY
List all open orders¶
Get a list of all open orders.
$ ubtsl --exchange "binance.com" --market "BTCUSDT" --listopenorders
It is possible to use exchange and market values of a profile.
$ ubtsl --profile "BTCUSDT_SELL" --listopenorders
Cancel all open orders¶
$ ubtsl --exchange "binance.com" --market "BTCUSDT" --cancelopenorders
It’s possible to use exchange and market values of a profile.
$ ubtsl --profile "BTCUSDT_SELL" --cancelopenorders
Example files¶
Documentation¶
Contributing¶
UNICORN Binance Trailing Stop Loss is an open source project which welcomes contributions which can be anything from simple documentation fixes and reporting dead links to new features. To contribute follow this guide.
Disclaimer¶
This project is for informational purposes only. Nothing contained herein constitutes financial advice or a solicitation to buy or sell securities.
If you intend to use real money, use it at your own risk.
Under no circumstances will we be responsible or liable for any claims, damages, losses, expenses, costs or liabilities of any kind, including but not limited to direct or indirect damages for loss of profits.

