MGM-Hurry
⚠️ Disclaimer
- This Framework & Strategy are still experimental and under heavy development. It is not recommended running it live at this moment.
- Always make sure to understand & test your MoniGoMani configuration until you trust it, before even thinking about going live!
- I am in no way responsible for your live results! You are always responsible for your own MoniGoMani configuration!
- MoniGoMani should always be re-optimized after doing manual changes!
- You need to optimized your own copy of MoniGoMani while thinking logically, don't follow your computer blindly!
MGM-Hurry is a command line tool to speedup & simplify the setup & usage of Freqtrade in combination with the MoniGoMani FrameWork & Strategy. Setting it all up requires some knowledge of the entire process, until you found MGM-Hurry! 💨
Table of Contents
- ⚠️ Disclaimer
- ## Table of Contents
- ##
mgm-hurry
Command Usage mgm-hurry --help
mgm-hurry version
mgm-hurry up
mgm-hurry install_freqtrade
mgm-hurry install_mgm
mgm-hurry setup
mgm-hurry cleanup
mgm-hurry download_static_pairlist
mgm-hurry download_candle_data
mgm-hurry hyperopt
mgm-hurry backtest
mgm-hurry plot_stats
mgm-hurry importance_report
mgm-hurry export_csv
mgm-hurry hyperopt_show_epoch
mgm-hurry hyperopt_show_results
mgm-hurry start_trader
- ## Example timeranges
- Developer Notes
- ### Virtual Environment
- ### Continuous Integration
- ### Module headers
mgm-hurry
Command Usage
⚠️ A shell alias has been configured for these shorter example commands.
If you haven't done that optional step then you will need to prefix all your commands with python3 -m pipenv run ./mgm-hurry ...
in the root installation folder instead of just being able to run mgm-hurry ...
anywhere!
mgm-hurry --help
Displays information about the commands and their usage.
General usage format: python3 mgm-hurry [command] [options]
mgm-hurry version
Displays the currently installed MoniGoMani & Freqtrade versions on source
installations.
mgm-hurry up
Quick start command, launches an interactive wizard which guides you through the entire process of: - Installing & configuring Freqtrade - Installing & configuring MoniGoMani - Configuring exchange API - Configuring Telegram bot API - Generating a static pairlist - Downloading historic candle data for HyperOpting & BackTesting - Running required HyperOpt runs - BackTesting your setup - And finally start trading!
mgm-hurry install_freqtrade
Individual command to install & update Freqtrade.
Options
--target_dir
: (Optional) Specify where you wish to install Freqtrade- Defaults to: The current directory
--branch
: (Optional) Specify the Freqtrade branch you wish to install- Defaults to: The
develop
branch, can also bestable
branch for less bleeding edge but generally more stable version
- Defaults to: The
--commit
: (Optional) Specify a specific Freqtrade commit you wish to utilize (Can be a specific commit orlatest
)- Defaults to: The latest supported / recommended commit for MoniGoMani
mgm-hurry install_mgm
Individual command to install & update MoniGoMani.
Options
--target_dir
: (Optional) Specify where you wish to install MoniGoMani- Defaults to: The current directory
--branch
: (Optional) Specify the MoniGoMani branch you wish to install- Defaults to: The
development
branch, can also bemain
branch for less bleeding edge but generally more stable version
- Defaults to: The
--commit
: (Optional) Specify a specific MoniGoMani commit you wish to utilize (Can be a specific commit orlatest
)- Defaults to: The latest MoniGoMani commit
mgm-hurry setup
Setup command, launches an interactive wizard which lets you configure Freqtrade & MoniGoMani.
mgm-hurry cleanup
Cleans up HyperOpt Result .json
files so you can easily start a fresh HyperOpt.
mgm-hurry download_static_pairlist
Retrieve and apply a current Top-Volume-StaticPairList.json file (Using RetrieveTopVolumeStaticPairList.json). The retrieved StaticPairList contains the top X pairs with the most trading volume at that point in time.
Options
--stake_currency
: The stake currency to find the list of.- Defaults to: Value in
.hurry
orUSDT
- Defaults to: Value in
--exchange
: The exchange to read the data from.- Defaults to: Value in
.hurry
orbinance
- Defaults to: Value in
--pairlist_length
: Amount of pairs wish to use in your pairlist.- Defaults to: Prompts you for the amount
--min_days_listed
: The minimal days that coin pairs need to be listed on the exchange.- Defaults to: Defaults to the amount of days in between now and the start of the timerange in
.hurry
minus thestartup_candle_count
.
- Defaults to: Defaults to the amount of days in between now and the start of the timerange in
mgm-hurry download_candle_data
Downloads candle data for a given timerange with the aid of an interactive prompt.
Option
--timerange
: (Optional) Specify the timerange for which you want to download candle data- Needs to be of the format
--timerange=yyyymmdd-yyyymmdd
or--timerange=down/side/up
- Defaults to: The
timerange
defined in your.hurry
file.
- Needs to be of the format
mgm-hurry hyperopt
HyperOpt (HyperSpace Parameter Optimization, a form of machine learning) magic that will make your life easier! Runs HyperOpt process to find out the most positive settings.
Options
--timerange
: (Optional) Specify the timerange upon which you want to HyperOpt- Needs to be of the format
--timerange=yyyymmdd-yyyymmdd
or--timerange=down/side/up
- Defaults to: The
timerange
defined in your.hurry
file.
- Needs to be of the format
--strategy
: (Optional) Specify the Strategy which you want to HyperOpt- Defaults to: The
strategy
defined in thehyperopt
section of your.hurry
file.
- Defaults to: The
--loss
: (Optional) Specify the HyperOptLoss which you want to use during HyperOpting- Defaults to: The
loss
defined in thehyperopt
section of your.hurry
file.
- Defaults to: The
--spaces
: (Optional) Specify the HyperOpt spaces which you want to use during HyperOpting (Example:"buy sell stoploss"
)- Defaults to: The
spaces
defined in thehyperopt
section of your.hurry
file.
- Defaults to: The
--enable_protections
: (Optional) Specify if HyperOpt should use Protections- Defaults to:
True
. ProvideFalse
to disable protections
- Defaults to:
--random_state
: (Optional) Specify the random state that HyperOpt will use.- This is needed to be able to get reproducible results when doing comparison tests
--apply_best_results
: (Optional) Automatically apply the latest epoch found in the "best" HyperOpt Results table after a HyperOpt in the form of a.json
file that the strategy will automatically load & use if found.- For MoniGoMani this will be the
mgm-hyperopt-results.json
file found in theuser_data
folder. - For other strategies this will be a
<strategy-name>.json
file found in theuser_data/strategies
folder - Defaults to:
True
. ProvideFalse
to disable automatic creation of a HyperOpt Results.json
file.
- For MoniGoMani this will be the
--clean_start
: (Optional) Performmgm-hurry cleanup
before starting HyperOpt.--do_backtest
: (bool, Optional) Do a BackTest after the HyperOpt?- Defaults to: True.
--plot_stats
: (bool, Optional) Plot a QuantStats report after the BackTest?- Defaults to: True.
--importance_report
: (bool, Optional) Calculate a Signal Importance Report for MoniGoMani after the HyperOpt?- Defaults to: True.
--export_csv
: (bool, Optional) Export the HyperOpt Results into a.csv
SpreadSheet after the HyperOpt?- Defaults to: True.
--output_file_name
: (Optional) Custom filename for the.log
file being created.- Defaults to:
HyperOptResults-<Strategy-Name>-<Current-DateTime>
- Defaults to:
--epochs
: (Optional) Amount of epochs to HyperOpt over.- Defaults to: Value defined in
.hurry
- Defaults to: Value defined in
--jobs
: (Optional) Amount of parallel workers (CPU cores) to use- Defaults to: Automatic detection (Amount used will depend on the amount of cores available on your system)
- **
--min_trades
: Minimal amount of trades wished to be reached.- Defaults to: Not used.
mgm-hurry backtest
Runs BackTest process to find out more about the results found by HyperOpt.
Options
--timerange
: (Optional) The target timerange for backtesting.- Defaults to: timerange in
.hurry
.
- Defaults to: timerange in
--strategy
: (Optional) Specify the Strategy which you want to BackTest- Defaults to: The
strategy
defined in thehyperopt
section of your.hurry
file.
- Defaults to: The
--enable_protections
: (Optional) Whether or not to enable protections.- Defaults to: True.
--output_file_name
: (Optional) Custom name for the '.log' file being created.- Defaults to: Defaults to
BackTestResults-<Strategy-Name>-<Current-DateTime>
- Defaults to: Defaults to
mgm-hurry plot_stats
Plot the stats report from a BackTest into detail html file.
Option
--choose_results
: (Optional) Launches a prompt to easily choose a certain backtest result file. If 'False' then the last BackTest result will be used.- Defaults to: 'True' mean an interactive prompt to choose a 'backtest-result-
.json' file.
- Defaults to: 'True' mean an interactive prompt to choose a 'backtest-result-
--strategy
: (Optional) Specify the Strategy of backTest result- Defaults to: The
strategy
defined in thehyperopt
section of your.hurry
file.
- Defaults to: The
--output_file_name
: (Optional) Custom name for the.html
file being created.- Defaults to: Defaults to
PlotProfitResults-<Strategy-Name>-<Current-DateTime>
- Defaults to: Defaults to
mgm-hurry importance_report
Runs the TotalOverallSignalImportanceCalculator process to find out which signals reached more importance in your MoniGoMani results found by HyperOpt.
Option
--output_file_name
: (Optional) Custom name for the.log
file being created.- Defaults to: Defaults to
SignalImportanceResults-MoniGoManiHyperStrategy-<Current-DateTime>
- Defaults to: Defaults to
mgm-hurry export_csv
Export the .fthypt
results to an easy to interpret/sort/filter .csv
SpreadSheet.
Option
--output_file_name
: (Optional) Custom name for the.csv
file being created.- Defaults to: Defaults to
CsvResults-<Strategy-Name>-<Current-DateTime>
- Defaults to: Defaults to
--fthypt
: (Optional) Launches a prompt to easily choose a certain.fthypt
file or a specific.fthypt
by providing it's name.- Defaults to: The last known
.fthypt
file. ProvideTrue
to launch a prompt to easily choose a specific..fthypt
file.
- Defaults to: The last known
mgm-hurry export_results
Export the results that are selected. Creates a .zip
archive of the various files created by HyperOpt runs after the user selects which HyperOpt run they would like to export. Archive is placed in user_data/mgm_result_export
.
mgm-hurry hyperopt_show_epoch
Prints & applies the HyperOpt Results for an epoch of choice.
Options
--epoch
: (Mandatory) Provide the epoch from which you wish to print the results.--strategy
: (Optional) Strategy used- Defaults to: Value in
.hurry
.
- Defaults to: Value in
--apply
: (Optional) Apply the printed HyperOpt Results- Defaults to:
True
. ProvideFalse
to only print the results
- Defaults to:
--fthypt
: (Optional) Launches a prompt to easily choose a certain.fthypt
file or a specific.fthypt
by providing it's name.- Defaults to: The last known
.fthypt
file. ProvideTrue
to launch a prompt to easily choose a specific..fthypt
file.
- Defaults to: The last known
mgm-hurry hyperopt_show_results
Launches a prompt to easily choose a certain .fthypt
file to print epochs from.
Options
--only_best
: (Optional) Show only best epochs.- Defaults to:
True
. ProvideFalse
to disable filter.
- Defaults to:
--only_profitable
: (Optional) Show only profitable epochs.- Defaults to:
False
. ProvideTrue
to enable filter.
- Defaults to:
mgm-hurry start_trader
Start the trader. Your ultimate goal!
Option
--dry_run
: (Optional) Run the trader in Dry-Run mode.- Defaults to:
True
. ProvideFalse
to run in Live-Run mode.
- Defaults to:
Example timeranges
Here are some examples of timeranges for each different market type (bearish, bullish etc).
Trend | Timerange |
---|---|
Downtrend | 20210509-20210524 |
Uptrend | 20210127-20210221 |
Sidetrend | 20210518-20210610 |
Final | 20210425-20210610 |
Developer Notes
Virtual Environment
It's adviced to use an isolated environment for this project. (Probably each project)
Using pipenv
makes this super easy.
Install pip packages from Pipfile in isolated environment
Execute commands in the environment is as easy as
pipenv run <your command>
Continuous Integration
We use GitHub Actions online (and pre-commit
local) to run CI procedures after each push and PR. It runs code styling checks and unit tests. To run these checks on your machine it is adviced to use pre-commit
.
NOTE: This example uses Homebrew to installInstall
pre-commit
tool Installing a git pre-commit hook as configured in.pre-commit-config.yaml
pre-commit
but you are free to use your preferred package manager.
Install the pre-commit script.
Run pre-commit only on files in current changeset.
Run pre-commit on all files in the repo.
Module headers
To generate a module header (ascii art), you need to run the following command:
Copy and paste the ASCII art output 🍻