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

Overview

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

Standalone

You'll need to activate your venv or use the global python environment, and pip install:

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

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

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

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

Using frogtrade9000

There's not much to say. 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

You might also like...
Hurry is a CLI tool to speed setting up MoniGoMani HyperStrategy & co. #freqtrade #hyperopting #trading #strategy

Hurry is a CLI tool to speed setting up MoniGoMani HyperStrategy & co. #freqtrade #hyperopting #trading #strategy

Command-line interface to PyPI Stats API to get download stats for Python packages
Command-line interface to PyPI Stats API to get download stats for Python packages

pypistats Python 3.6+ interface to PyPI Stats API to get aggregate download statistics on Python packages on the Python Package Index without having t

A command line interface to interact with the Hypixel api allowing the user to get stats, leaderboards, etc

HyConsole is a way to get data on players and leaderboards from the Hypixel Minecraft server from the command line. Keep in mind I have no a

Format click help output nicely with rich.
Format click help output nicely with rich.

rich-click Format click help output nicely with Rich. Click is a "Python package for creating beautiful command line interfaces". Rich is a "Python li

commandpack - A package of modules for working with commands, command packages, files with command packages.
commandpack - A package of modules for working with commands, command packages, files with command packages.

commandpack Help the project financially: Donate: https://smartlegion.github.io/donate/ Yandex Money: https://yoomoney.ru/to/4100115206129186 PayPal:

A Python-based command prompt concept which includes windows command emulation.

PythonCMD A Python-based command prompt concept which includes windows command emulation. Current features: echo: Input your message and it will be cl

Library and command-line utility for rendering projects templates.
Library and command-line utility for rendering projects templates.

A library for rendering project templates. Works with local paths and git URLs. Your project can include any file and Copier can dynamically replace v

A command-line utility that creates projects from cookiecutters (project templates), e.g. Python package projects, VueJS projects.
A command-line utility that creates projects from cookiecutters (project templates), e.g. Python package projects, VueJS projects.

Cookiecutter A command-line utility that creates projects from cookiecutters (project templates), e.g. creating a Python package project from a Python

instant coding answers via the command line
instant coding answers via the command line

howdoi instant coding answers via the command line Sherlock, your neighborhood command-line sloth sleuth. Are you a hack programmer? Do you find yours

Comments
  • Cumulative Profit chart displays incorrect value

    Cumulative Profit chart displays incorrect value

    The value displayed in the Trades Summary (left side) is different than value displayed in Cumulative Profit (right side).

    For example, Trades Summary displays total of 28.49, but Cumulative Profit chart incorrectly displays 24.00

    opened by t3ch9 2
  • some minor fixes

    some minor fixes

    • add "pyyaml" to requirements for "-y" flag
    • Check max_apit
    • Force max_capit to float to fix str div bug
    • Fix closed trades table, add trade direction
    • adds curl copy pasta to README for convience
    • formating: replace '' with ""
    • prints cause additionally to error.
    opened by TheJoeSchr 1
  • Add option to enlarge a single sidepane window

    Add option to enlarge a single sidepane window

    With more than 2 or 3 bots, it'll be hard to see all rows in each table in the sidebar. Provide keybinds to set the side layout to show one table at a time, e.g. Shift+O for only open trades, Shift+C for closed, etc.

    enhancement 
    opened by froggleston 1
Owner
Robert Davey
Robert Davey
Rich is a Python library for rich text and beautiful formatting in the terminal.

The Rich API makes it easy to add color and style to terminal output. Rich can also render pretty tables, progress bars, markdown, syntax highlighted source code, tracebacks, and more — out of the box.

Will McGugan 41.4k Jan 3, 2023
As easy as /aitch-tee-tee-pie/ 🥧 Modern, user-friendly command-line HTTP client for the API era. JSON support, colors, sessions, downloads, plugins & more. https://twitter.com/httpie

HTTPie: human-friendly CLI HTTP client for the API era HTTPie (pronounced aitch-tee-tee-pie) is a command-line HTTP client. Its goal is to make CLI in

HTTPie 25.4k Dec 30, 2022
GetRepo-py is a command line client that queries GitHub API and searches repositories by given arguments

GetRepo-py is a command line client that queries GitHub API and searches repositories by given arguments

Davidcin 3 Feb 14, 2022
A command-line based, minimal torrent streaming client made using Python and Webtorrent-cli.

ABOUT A command-line based, minimal torrent streaming client made using Python and Webtorrent-cli. Installation pip install -r requirements.txt It use

Janardon Hazarika 17 Dec 11, 2022
Command line client for Audience Insights

Dynamics 365 Audience Insights CLI The AuI CLI is a command line tool for Dynamics 365 Audience Insights. It is based on the customerinsights Python l

Microsoft 8 Jan 9, 2023
Splitgraph command line client and python library

Splitgraph Overview Splitgraph is a tool for building, versioning and querying reproducible datasets. It's inspired by Docker and Git, so it feels fam

Splitgraph 313 Dec 24, 2022
RSS reader client for CLI (Command Line Interface),

rReader is RSS reader client for CLI(Command Line Interface)

Lee JunHaeng 10 Dec 24, 2022
A cd command that learns - easily navigate directories from the command line

NAME autojump - a faster way to navigate your filesystem DESCRIPTION autojump is a faster way to navigate your filesystem. It works by maintaining a d

William Ting 14.5k Jan 3, 2023
AML Command Transfer. A lightweight tool to transfer any command line to Azure Machine Learning Services

AML Command Transfer (ACT) ACT is a lightweight tool to transfer any command from the local machine to AML or ITP, both of which are Azure Machine Lea

Microsoft 11 Aug 10, 2022
Ros command - Unifying the ROS command line tools

Unifying the ROS command line tools One impairment to ROS 2 adoption is that all

null 37 Dec 15, 2022