Git Product home page Git Product logo

freqtrade-frogtrade9000's Introduction

frogtrade9000 - a command-line Rich client for the freqtrade REST API

I found FreqUI too cumbersome and slow on my Raspberry Pi 400 when running multiple instances of freqtrade bots. So I came up with a python Rich client:

It has very basic interactivity via the keyboard module which has cross-platform issues. I might consider porting this all to prompt-toolkit in the future, but not now.

image

Requirements

If you don't have freqtrade, get it here, and you'll satisfy most of the requirements. If not you'll need to pip install the following requirements.

Existing Freqtrade install

If you're intending to copy the scripts into an existing freqtrade folder, you'll need to activate your venv (e.g. source ./path/to/freqtrade/env/bin/activate) and pip install:

  • keyboard
  • rich
  • psutil

Standalone

You'll need to activate your venv or use the global python environment, and pip install -r requirements.txt or manually install the following:

  • numpy
  • pandas
  • ccxt
  • python-rapidjson
  • keyboard
  • rich
  • psutil

Installation

Existing venv Freqtrade install

Once cloned, copy the script files into your freqtrade/scripts folder. That's it!

Existing dockerised Freqtrade install

You need to add a COPY command into your freqtrade dockerfile to copy the scripts into the container and rebuild. Full instructions coming soon!

Standalone

You'll need the rest_client.py file from the core freqtrade repo and place it in the same folder that you put these files. Grab it from here: https://github.com/freqtrade/freqtrade/blob/stable/scripts/rest_client.py

Running

The easiest way to configure frogtrade9000 is with a YAML file. You can use a YAML file (see example_frogtrade_config.yaml) that contains the options you wish to run frogtrade9000 with, including multiple servers:

./scripts/frogtrade9000.py -y frogtrade_config.yaml

Running frogtrade9000 with no options will make it look for your config.json file and read in the api_server stanza from there, picking up the server IP, port, username and password:

./scripts/frogtrade9000.py

To specify a config use -c:

./scripts/frogtrade9000.py -c my-other.config.json

The nice thing about frogtrade9000 is that you can monitor multiple bots and strategies. If you run multiple bots with different IPs/ports use the -s flag to manually specify your own botname, the IP and ports and any username/password info of the freqtrade API servers separated by commas:

./scripts/frogtrade9000.py -s [bot1]user:[email protected]:8081,[bot2]user:[email protected]:8082

For simpler TTYs/terminals that cannot display curved symbols, use the -b option to use square edges so plots render correctly:

./scripts/frogtrade9000.py -s [bot1]user:[email protected]:8081,[bot2]user:[email protected]:8082 -b

Other options include:

  • exclude the pair and profit charts using the -x flag
  • include system information from the system that the bot is running on using -s (this requires a freqtrade PR to the REST API that is not merged yet, so this isn't functional)
  • include candle information from open trades (freqtrade REST API provides 5m candles) using -k

Note that your password has to be RFC compliant. You can use alphanumeric characters and - . _ ~ % ! $ & ' ( ) * + , ; =

Using frogtrade9000

There's not much to say. The view updates every 5 seconds.

It uses the Rich library to provide a console view, so there isn't really any decent interactivity as part of that library. However, if the keyboard is working (see below) then you can:

  • use the number keys to change the top OHCLV chart to whichever open pair your bot is trading, e.g. from the screenshot above, pressing 1 would change the chart to SHIB/USDT. Pressing 0 takes you back to BTC/USDT (or whatever informative pair you've specified in the code).
  • use the letter keys to change the bottom profit chart based on whichever bots you're running, e.g. pressing B will take you to the bot running on 192.168.1.77:8082
  • use the PgUp key to cycle through the OHCLV chart timeframe (supports 1m, 5m, 15m, 1h, 4h)

Known issues

  • The keyboard module needs root/sudo on Linux to gain access to /dev/input*. You can run frogtrade9000 without sudo, but any of the hokey keyboard interactivity will be disabled.
  • The display flickers on some terminals, e.g. git bash. I can't do anything about that.
  • The exception handling is lame. This needs improvement.
  • A JSON config file would help with more granular bot use and general tool settings, e.g. informative pair as default. I'll get round to this soon.

Acknowledgements

The very cool ASCII charts are from https://github.com/kroitor/asciichart under the MIT licence

freqtrade-frogtrade9000's People

Contributors

froggleston avatar thejoeschr avatar raphant avatar

Stargazers

WebClinic avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.