nickpagz / 3commas-ftx-triggers

Python script to send buy and sell triggers to 3Commas trading bots setup to trade FTX perpetual futures
36 stars 29 forks source link

Add install script and virtual environment support #7

Open cyberjunky opened 3 years ago

cyberjunky commented 3 years ago

Thanks for this code, I'm started to use it, need to setup account on FTX. I added a install script called setup.sh Simply run it as ./setup.sh and you have the options:

usage:
    -i,--install    Install 3commas-ftx-triggers from scratch
    -u,--update     Command git pull to update.

It's created the same as the freqtrade one, so it creates a .env python enviroment to install the requirements in, and you can run the scripts from there without cluttering the machine.

Also added shebangs to Py3c*.py so you can run them like so ./Py3x_create.py

You need to check the contents of setup.cfg, the email address, name and license type are missing.

Before running any of the script enter the virtual enviroment first

cd 3commas-ftx-triggers
source .env/bin/activate

To enter and run a script in one go (from a startup script or services file do this:

cd /home/<user>/3commas-ftx/
/home/user/3commas-ftx-triggers/.env/bin/python /home/<user>/3commas-ftx-triggers/Py3c_triggers.py

Example service file 3commas-ftx-triggers.service, you need to edit the paths..

sudo cp 3commas-ftx-triggers.service /etc/systemd/system/
sudo systemd start 3commas-ftx-triggers.service

Hope you like it, thanks!