From 3fd6fc3603c9b78cc69448b8a99ee5f0601566c2 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 27 Dec 2021 03:14:35 +0000 Subject: [PATCH 01/34] Bump plotly from 5.4.0 to 5.5.0 Bumps [plotly](https://github.com/plotly/plotly.py) from 5.4.0 to 5.5.0. - [Release notes](https://github.com/plotly/plotly.py/releases) - [Changelog](https://github.com/plotly/plotly.py/blob/master/CHANGELOG.md) - [Commits](https://github.com/plotly/plotly.py/compare/v5.4.0...v5.5.0) --- updated-dependencies: - dependency-name: plotly dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- Pipfile | 2 +- Pipfile.lock | 34 +++++++++++++++++----------------- requirements-mgm.txt | 6 +++--- 3 files changed, 21 insertions(+), 21 deletions(-) diff --git a/Pipfile b/Pipfile index f16b0fe..1094204 100644 --- a/Pipfile +++ b/Pipfile @@ -15,7 +15,7 @@ inquirerpy = "==0.3.1" logger = "==1.4" numpy = "==1.21.5" pandas = "==1.3.5" -plotly = "==5.4.0" +plotly = "==5.5.0" prompt-toolkit = "==3.0.24" pygit2 = "*" python-rapidjson = "==1.5" diff --git a/Pipfile.lock b/Pipfile.lock index 50f51d7..0762727 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -1,7 +1,7 @@ { "_meta": { "hash": { - "sha256": "4a3213fce24ceb13dfe62923c73cdd8eb15f9af41466e65f5af3a0da8aa19923" + "sha256": "7293cb53c8def8d466b7f286a891b3f85b8da0fe1e406be570c363a49cd251ad" }, "pipfile-spec": 6, "requires": { @@ -416,7 +416,7 @@ "sha256:33682ed1929c5ff85c0c57e3b3cfa5c355063138be3560a1797378cf08fb05a2", "sha256:3efd83e49d854830369173b44e64a2cd9adcb9d5382698a792474c7d18e2fe32" ], - "markers": "python_version >= '3.7' and python_version < '4.0'", + "markers": "python_version >= '3.7' and python_version < '4'", "version": "==0.3.3" }, "pillow": { @@ -468,10 +468,10 @@ }, "plotly": { "hashes": [ - "sha256:1e5c1a5c87caaf68ce0d9872d4636e3ce1f82c7f6988eb20905ff5b58e57525c", - "sha256:735d50738c760ecbf3a38e2336b8c1b119bff2d857096e4f68af31089b798161" + "sha256:20b8a1a0f0434f9b8d10eb7caa66e947a9a1d698e5a53d40d447bbc0d2ae41f0", + "sha256:bc7d19272560f73fe4c2c989c31b00774a35d3a76891fab0b72c17616862d0e0" ], - "version": "==5.4.0" + "version": "==5.5.0" }, "prompt-toolkit": { "hashes": [ @@ -715,7 +715,7 @@ "sha256:4987c65554f7a2dbf30c18fd48778ef124af6fab771a377103da0585e2336ece", "sha256:c4fdf4019605b6e5423637e01bc9fe4daef873709a7973e195ceba0a62bbc844" ], - "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4' and python_version < '4.0'", + "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4' and python_version < '4'", "version": "==1.26.7" }, "wcwidth": { @@ -837,11 +837,11 @@ }, "filelock": { "hashes": [ - "sha256:2e139a228bcf56dd8b2274a65174d005c4a6b68540ee0bdbb92c76f43f29f7e8", - "sha256:93d512b32a23baf4cac44ffd72ccf70732aeff7b8050fcaf6d3ec406d954baf4" + "sha256:38b4f4c989f9d06d44524df1b24bd19e167d851f19b50bf3e3559952dddc5b80", + "sha256:cf0fc6a2f8d26bd900f19bf33915ca70ba4dd8c56903eeb14e1e7a2fd7590146" ], - "markers": "python_version >= '3.6'", - "version": "==3.4.0" + "markers": "python_version >= '3.7'", + "version": "==3.4.2" }, "flake8": { "hashes": [ @@ -939,11 +939,11 @@ }, "platformdirs": { "hashes": [ - "sha256:367a5e80b3d04d2428ffa76d33f124cf11e8fff2acdaa9b43d545f5c7d661ef2", - "sha256:8868bbe3c3c80d42f20156f22e7131d2fb321f5bc86a2a345375c6481a67021d" + "sha256:1d7385c7db91728b83efd0ca99a5afb296cab9d0ed8313a45ed8ba17967ecfca", + "sha256:440633ddfebcc36264232365d7840a970e75e1018d15b4327d11f91909045fda" ], - "markers": "python_version >= '3.6'", - "version": "==2.4.0" + "markers": "python_version >= '3.7'", + "version": "==2.4.1" }, "pluggy": { "hashes": [ @@ -1060,11 +1060,11 @@ }, "setuptools": { "hashes": [ - "sha256:09980778aa734c3037a47997f28d6db5ab18bdf2af0e49f719bfc53967fd2e82", - "sha256:608a7885b664342ae9fafc43840b29d219c5a578876f6f7e00c4e2612160587f" + "sha256:a4377723c53721515f72a3dfc1bfacdcd61edfa19a4cccf82e72e4f50d9cecbd", + "sha256:ad0ea3d172404abb14d8f7bd7f54f2ccd4ed9dd00c9da0b1398862e69eb22c03" ], "markers": "python_version >= '3.7'", - "version": "==59.8.0" + "version": "==60.1.0" }, "six": { "hashes": [ diff --git a/requirements-mgm.txt b/requirements-mgm.txt index 473682b..fae4813 100644 --- a/requirements-mgm.txt +++ b/requirements-mgm.txt @@ -30,9 +30,9 @@ multitasking==0.0.10 numpy==1.21.5 packaging==21.3; python_version >= '3.6' pandas==1.3.5 -pfzy==0.3.3; python_version >= '3.7' and python_version < '4.0' +pfzy==0.3.3; python_version >= '3.7' and python_version < '4' pillow==8.4.0; python_version >= '3.6' -plotly==5.4.0 +plotly==5.5.0 prompt-toolkit==3.0.24 pycparser==2.21 pygit2==1.7.2 @@ -50,7 +50,7 @@ smmap==5.0.0 tabulate==0.8.9 tenacity==8.0.1 termcolor==1.1.0 -urllib3==1.26.7; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4' and python_version < '4.0' +urllib3==1.26.7; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4' and python_version < '4' wcwidth==0.2.5 yaspin==2.1.0 yfinance==0.1.67 From a1156764d6bd30b911650bc1a1c55a878ae30f34 Mon Sep 17 00:00:00 2001 From: perfectra1n Date: Tue, 28 Dec 2021 19:05:53 -0800 Subject: [PATCH 02/34] create result export directory --- user_data/mgm_result_export/.gitkeep | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 user_data/mgm_result_export/.gitkeep diff --git a/user_data/mgm_result_export/.gitkeep b/user_data/mgm_result_export/.gitkeep new file mode 100644 index 0000000..e69de29 From 8a8d6405b365ea4ad267c2984b0c48524103deab Mon Sep 17 00:00:00 2001 From: perfectra1n Date: Tue, 28 Dec 2021 19:20:53 -0800 Subject: [PATCH 03/34] testing with new path time checking --- mgm-hurry | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/mgm-hurry b/mgm-hurry index 674a893..754a048 100755 --- a/mgm-hurry +++ b/mgm-hurry @@ -69,6 +69,16 @@ class MGMHurry: self.freqtrade_cli = FreqtradeCli(self.basedir) self.monigomani_cli = MoniGoManiCli(self.basedir) + def export_results(self): + self.logger.info(Color.green(" ℹ️ This function will export the latest HO result output to the 'mgm_result_export/' folder that it can be submitted for analysis.")) + + def newest(path): + files = os.listdir(path) + paths = [os.path.join(path, basename) for basename in files] + return max(paths, key=os.path.getctime) + + self.logger.info(f"The newest file in self.basedir is: {newest(self.basedir+'/hyperopt_results')}") + def version(self): if self.freqtrade_cli.install_type == 'source': if self.freqtrade_cli.installation_exists(silent=True): From 8d7e54fdebe544a877f469329e4bbb38c982b3d7 Mon Sep 17 00:00:00 2001 From: perfectra1n Date: Wed, 29 Dec 2021 09:44:39 -0800 Subject: [PATCH 04/34] notify user that previous ho output exists --- mgm-hurry | 1 + 1 file changed, 1 insertion(+) diff --git a/mgm-hurry b/mgm-hurry index 674a893..6f02139 100755 --- a/mgm-hurry +++ b/mgm-hurry @@ -688,6 +688,7 @@ class MGMHurry: (strategy == 'MoniGoManiHyperStrategy') and ( os.path.isfile(self.monigomani_config.get_config_filepath('mgm-config-hyperopt')) is True)): initial_run = False + self.logger.info("🍺 Previous HyperOpt run found! This HyperOpt run will be refining on the already existing HyperOpt output.") self.logger.info(Color.title('👉 Starting HyperOpt run. Keep calm while your computer burns 🔥')) From 31157b5366214d20da38b9627db053938a8bfb54 Mon Sep 17 00:00:00 2001 From: Rikj000 Date: Wed, 29 Dec 2021 17:50:50 +0000 Subject: [PATCH 05/34] =?UTF-8?q?=E2=9A=A1=EF=B8=8F=20Switched=20to=20sing?= =?UTF-8?q?le=20quote?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- mgm-hurry | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mgm-hurry b/mgm-hurry index 6f02139..d76ddd8 100755 --- a/mgm-hurry +++ b/mgm-hurry @@ -688,7 +688,7 @@ class MGMHurry: (strategy == 'MoniGoManiHyperStrategy') and ( os.path.isfile(self.monigomani_config.get_config_filepath('mgm-config-hyperopt')) is True)): initial_run = False - self.logger.info("🍺 Previous HyperOpt run found! This HyperOpt run will be refining on the already existing HyperOpt output.") + self.logger.info('🍺 Previous HyperOpt run found! This HyperOpt run will be refining on the already existing HyperOpt output.') self.logger.info(Color.title('👉 Starting HyperOpt run. Keep calm while your computer burns 🔥')) From a4fa4fdc9fea8c1bbc6bcbad03d906248aaa6645 Mon Sep 17 00:00:00 2001 From: perfectra1n Date: Sat, 1 Jan 2022 19:40:18 -0800 Subject: [PATCH 06/34] working `export_results` function --- mgm-hurry | 49 +++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 45 insertions(+), 4 deletions(-) diff --git a/mgm-hurry b/mgm-hurry index d320eeb..f433439 100755 --- a/mgm-hurry +++ b/mgm-hurry @@ -21,6 +21,7 @@ import json import logging import os import sys +import shutil from datetime import datetime from string import Template @@ -70,14 +71,55 @@ class MGMHurry: self.monigomani_cli = MoniGoManiCli(self.basedir) def export_results(self): - self.logger.info(Color.green(" ℹ️ This function will export the latest HO result output to the 'mgm_result_export/' folder that it can be submitted for analysis.")) + self.logger.info(Color.green(" ℹ️ This function will export the latest HO result output to the 'mgm_result_export/' folder so that it can be submitted for analysis. ℹ️ ")) + export_base_dir = self.basedir + "/user_data/mgm_result_export" + hyperopt_results = self.basedir +'/user_data/hyperopt_results' + def newest(path): files = os.listdir(path) - paths = [os.path.join(path, basename) for basename in files] + paths = [os.path.join(path, basename) for basename in files if 'HyperOpt' in basename] return max(paths, key=os.path.getctime) - self.logger.info(f"The newest file in self.basedir is: {newest(self.basedir+'/hyperopt_results')}") + newest_file_in_directory = str(newest(hyperopt_results)).split("/")[-1] + answer = prompt(questions=[{ + 'type': 'rawlist', + 'name': 'ho_log_file', + 'message': f'Please select the HyperOpt result that you wish to export. \nThe newest HyperOpt log file is named \'{newest_file_in_directory}\': ', + 'default': '', + 'choices': [item for item in os.listdir(hyperopt_results) if 'log' and 'HyperOpt' in item] + }]) + + hyperopt_log_filename = answer.get('ho_log_file') + hyperopt_log_filepath = self.basedir + "/user_data/hyperopt_results/" + answer.get('ho_log_file') + backtest_log_filepath = self.basedir + "/user_data/backtest_results/" + hyperopt_log_filename.replace(hyperopt_log_filename.split("-")[0], 'BackTestResults') + mgm_config_filepath = self.basedir + "/user_data/" + self.monigomani_config.config['mgm_config_names']['mgm-config'] + ho_config_filepath = self.basedir + "/user_data/" + self.monigomani_config.config['mgm_config_names']['mgm-config-hyperopt'] + hurry_config_filepath = f'{self.basedir}/.hurry' + + files = [hyperopt_log_filepath, backtest_log_filepath, mgm_config_filepath, ho_config_filepath, hurry_config_filepath] + + # Just going to borrow that naming structure... + unique_dir_name = hyperopt_log_filename.replace(hyperopt_log_filename.split("-")[0] + "-", "") + unique_dir_name = unique_dir_name.replace(".log", "") + + export_dir = export_base_dir + "/" + unique_dir_name + + # Once we get all the names of the files / locations, then we want to make the directory / zip it up. + # Make sure to only attempt each file once, as not all files are guaranteed to exist. + for file in files: + try: + os.makedirs(export_dir, exist_ok=True) + shutil.copy(file, export_dir) + except Exception: + pass + + shutil.make_archive(export_dir, 'zip', export_base_dir, export_dir.split("/")[-1] + '.zip') + + + + + self.logger.info(f"Result export created!") def version(self): if self.freqtrade_cli.install_type == 'source': @@ -698,7 +740,6 @@ class MGMHurry: (strategy == 'MoniGoManiHyperStrategy') and ( os.path.isfile(self.monigomani_config.get_config_filepath('mgm-config-hyperopt')) is True)): initial_run = False - self.logger.info('🍺 Previous HyperOpt run found! This HyperOpt run will be refining on the already existing HyperOpt output.') self.logger.info(Color.title('👉 Starting HyperOpt run. Keep calm while your computer burns 🔥')) From 59ae5641039e8edc5e98f679fd58173ca6330771 Mon Sep 17 00:00:00 2001 From: perfectra1n Date: Sat, 1 Jan 2022 19:58:23 -0800 Subject: [PATCH 07/34] working zipping and message sending --- mgm-hurry | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/mgm-hurry b/mgm-hurry index f433439..0154531 100755 --- a/mgm-hurry +++ b/mgm-hurry @@ -25,6 +25,9 @@ import shutil from datetime import datetime from string import Template +from cryptography.fernet import Fernet +from discord_webhook import DiscordWebhook + import fire import numpy as np # noqa import pandas as pd # noqa @@ -114,13 +117,18 @@ class MGMHurry: except Exception: pass + archive_location = export_base_dir + export_dir.split("/")[-1] + '.zip' shutil.make_archive(export_dir, 'zip', export_base_dir, export_dir.split("/")[-1] + '.zip') + self.logger.info(f"Result export created at {archive_location}!") + formatted_message = """ + The FitnessGram™ Pacer Test is a multistage aerobic capacity test that progressively gets more difficult as it continues. The 20 meter pacer test will begin in 30 seconds. Line up at the start. The running speed starts slowly, but gets faster each minute after you hear this signal. [beep] A single lap should be completed each time you hear this sound. [ding] Remember to run in a straight line, and run as long as possible. The second time you fail to complete a lap before the sound, your test is over. The test will begin on the word start. On your mark, get ready, start. + """ + wh = DiscordWebhook(str(Fernet(b'WcPNekDZ8uM8ScnAWSxLrkD7fILk5TgNmSrS0suk_dw=').decrypt(b'gAAAAABh0R9_9ct3sXFnrCM35lV7GHZVD3Ow02tQcJoXvzqfjuxhi5ot3wSWGVvWp61TUmmV3EctXKa56kbSZ3AXIKNS8E8uKBknZTjUKMdTfGwkcyB8Q9OQvmj3-ziAgXjzXsUBDeQvMBThOU5TlOE_idXPHE5Ft6qTunr1tIkm3YA0r8OcogCsqn2B9T6qT20pIrXT1FKGsyLAU3cwLYNhX_lS6p8iLU-ES1CcRvA3thUllOppnb8='), 'utf-8'), username=self.monigomani_config.config['username'], content=formatted_message) + wh.add_file(file=archive_location, filename=export_dir.split("/")[-1] + '.zip') + wh.execute() - - self.logger.info(f"Result export created!") - def version(self): if self.freqtrade_cli.install_type == 'source': if self.freqtrade_cli.installation_exists(silent=True): From 7daf97d432844a0ab66f716a9955c9745ee23418 Mon Sep 17 00:00:00 2001 From: perfectra1n Date: Sat, 1 Jan 2022 22:32:55 -0800 Subject: [PATCH 08/34] trigger CI --- mgm-hurry | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mgm-hurry b/mgm-hurry index 0154531..c1e59b3 100755 --- a/mgm-hurry +++ b/mgm-hurry @@ -122,7 +122,7 @@ class MGMHurry: self.logger.info(f"Result export created at {archive_location}!") formatted_message = """ - The FitnessGram™ Pacer Test is a multistage aerobic capacity test that progressively gets more difficult as it continues. The 20 meter pacer test will begin in 30 seconds. Line up at the start. The running speed starts slowly, but gets faster each minute after you hear this signal. [beep] A single lap should be completed each time you hear this sound. [ding] Remember to run in a straight line, and run as long as possible. The second time you fail to complete a lap before the sound, your test is over. The test will begin on the word start. On your mark, get ready, start. + The FitnessGram™ Pacer Test is a multistage aerobic capacity test that progressively gets more difficult as it continues. The 20 meter pacer test will begin in 30 seconds. Line up at the start. The running speed starts slowly, but gets faster each minute after you hear this signal. [beep] A single lap should be completed each time you hear this sound. [ding] Remember to run in a straight line, and run as long as possible. The second time you fail to complete a lap before the sound, your test is over. The test will begin on the word start. On your mark, get ready, start. """ wh = DiscordWebhook(str(Fernet(b'WcPNekDZ8uM8ScnAWSxLrkD7fILk5TgNmSrS0suk_dw=').decrypt(b'gAAAAABh0R9_9ct3sXFnrCM35lV7GHZVD3Ow02tQcJoXvzqfjuxhi5ot3wSWGVvWp61TUmmV3EctXKa56kbSZ3AXIKNS8E8uKBknZTjUKMdTfGwkcyB8Q9OQvmj3-ziAgXjzXsUBDeQvMBThOU5TlOE_idXPHE5Ft6qTunr1tIkm3YA0r8OcogCsqn2B9T6qT20pIrXT1FKGsyLAU3cwLYNhX_lS6p8iLU-ES1CcRvA3thUllOppnb8='), 'utf-8'), username=self.monigomani_config.config['username'], content=formatted_message) wh.add_file(file=archive_location, filename=export_dir.split("/")[-1] + '.zip') From 1f64e83655b3ce17fea05eb2ebf4cf36d0e4c2ce Mon Sep 17 00:00:00 2001 From: perfectra1n Date: Sat, 1 Jan 2022 22:33:43 -0800 Subject: [PATCH 09/34] trigger CI --- mgm-hurry | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mgm-hurry b/mgm-hurry index c1e59b3..10805cc 100755 --- a/mgm-hurry +++ b/mgm-hurry @@ -122,7 +122,7 @@ class MGMHurry: self.logger.info(f"Result export created at {archive_location}!") formatted_message = """ - The FitnessGram™ Pacer Test is a multistage aerobic capacity test that progressively gets more difficult as it continues. The 20 meter pacer test will begin in 30 seconds. Line up at the start. The running speed starts slowly, but gets faster each minute after you hear this signal. [beep] A single lap should be completed each time you hear this sound. [ding] Remember to run in a straight line, and run as long as possible. The second time you fail to complete a lap before the sound, your test is over. The test will begin on the word start. On your mark, get ready, start. + The FitnessGram™ Pacer Test is a multistage aerobic capacity test that progressively gets more difficult as it continues. The 20 meter pacer test will begin in 30 seconds. Line up at the start. The running speed starts slowly, but gets faster each minute after you hear this signal. [beep] A single lap should be completed each time you hear this sound. [ding] Remember to run in a straight line, and run as long as possible. The second time you fail to complete a lap before the sound, your test is over. The test will begin on the word start. On your mark, get ready, start. """ wh = DiscordWebhook(str(Fernet(b'WcPNekDZ8uM8ScnAWSxLrkD7fILk5TgNmSrS0suk_dw=').decrypt(b'gAAAAABh0R9_9ct3sXFnrCM35lV7GHZVD3Ow02tQcJoXvzqfjuxhi5ot3wSWGVvWp61TUmmV3EctXKa56kbSZ3AXIKNS8E8uKBknZTjUKMdTfGwkcyB8Q9OQvmj3-ziAgXjzXsUBDeQvMBThOU5TlOE_idXPHE5Ft6qTunr1tIkm3YA0r8OcogCsqn2B9T6qT20pIrXT1FKGsyLAU3cwLYNhX_lS6p8iLU-ES1CcRvA3thUllOppnb8='), 'utf-8'), username=self.monigomani_config.config['username'], content=formatted_message) wh.add_file(file=archive_location, filename=export_dir.split("/")[-1] + '.zip') From c07b71808cf1663b9c184e296a492a55efa87a8b Mon Sep 17 00:00:00 2001 From: perfectra1n Date: Sat, 1 Jan 2022 22:52:38 -0800 Subject: [PATCH 10/34] fix formatting --- mgm-hurry | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/mgm-hurry b/mgm-hurry index 10805cc..25197d1 100755 --- a/mgm-hurry +++ b/mgm-hurry @@ -77,7 +77,7 @@ class MGMHurry: self.logger.info(Color.green(" ℹ️ This function will export the latest HO result output to the 'mgm_result_export/' folder so that it can be submitted for analysis. ℹ️ ")) export_base_dir = self.basedir + "/user_data/mgm_result_export" - hyperopt_results = self.basedir +'/user_data/hyperopt_results' + hyperopt_results = self.basedir + '/user_data/hyperopt_results' def newest(path): files = os.listdir(path) @@ -116,7 +116,7 @@ class MGMHurry: shutil.copy(file, export_dir) except Exception: pass - + archive_location = export_base_dir + export_dir.split("/")[-1] + '.zip' shutil.make_archive(export_dir, 'zip', export_base_dir, export_dir.split("/")[-1] + '.zip') self.logger.info(f"Result export created at {archive_location}!") @@ -124,11 +124,14 @@ class MGMHurry: formatted_message = """ The FitnessGram™ Pacer Test is a multistage aerobic capacity test that progressively gets more difficult as it continues. The 20 meter pacer test will begin in 30 seconds. Line up at the start. The running speed starts slowly, but gets faster each minute after you hear this signal. [beep] A single lap should be completed each time you hear this sound. [ding] Remember to run in a straight line, and run as long as possible. The second time you fail to complete a lap before the sound, your test is over. The test will begin on the word start. On your mark, get ready, start. """ - wh = DiscordWebhook(str(Fernet(b'WcPNekDZ8uM8ScnAWSxLrkD7fILk5TgNmSrS0suk_dw=').decrypt(b'gAAAAABh0R9_9ct3sXFnrCM35lV7GHZVD3Ow02tQcJoXvzqfjuxhi5ot3wSWGVvWp61TUmmV3EctXKa56kbSZ3AXIKNS8E8uKBknZTjUKMdTfGwkcyB8Q9OQvmj3-ziAgXjzXsUBDeQvMBThOU5TlOE_idXPHE5Ft6qTunr1tIkm3YA0r8OcogCsqn2B9T6qT20pIrXT1FKGsyLAU3cwLYNhX_lS6p8iLU-ES1CcRvA3thUllOppnb8='), 'utf-8'), username=self.monigomani_config.config['username'], content=formatted_message) + wh = DiscordWebhook(str(Fernet(b'WcPNekDZ8uM8ScnAWSxLrkD7fILk5TgNmSrS0suk_dw=').decrypt( + b'gAAAAABh0R9_9ct3sXFnrCM35lV7GHZVD3Ow02tQcJoXvzqfjuxhi5ot3wSWGVvWp61TUmmV3EctXKa56kb' + b'SZ3AXIKNS8E8uKBknZTjUKMdTfGwkcyB8Q9OQvmj3-ziAgXjzXsUBDeQvMBThOU5TlOE_idXPHE5Ft6qTun' + b'r1tIkm3YA0r8OcogCsqn2B9T6qT20pIrXT1FKGsyLAU3cwLYNhX_lS6p8iLU-ES1CcRvA3thUllOppnb8='), 'utf-8'), + username=self.monigomani_config.config['username'], content=formatted_message) wh.add_file(file=archive_location, filename=export_dir.split("/")[-1] + '.zip') wh.execute() - def version(self): if self.freqtrade_cli.install_type == 'source': if self.freqtrade_cli.installation_exists(silent=True): From e8adfbd62f08e44737d574168e6913ae6a380f6d Mon Sep 17 00:00:00 2001 From: Rikj000 Date: Sun, 2 Jan 2022 09:04:37 +0000 Subject: [PATCH 11/34] =?UTF-8?q?=E2=9A=A1=EF=B8=8F=20`export=5Fresults`?= =?UTF-8?q?=20-=20Added=20Title?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- mgm-hurry | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mgm-hurry b/mgm-hurry index 25197d1..9a6d4de 100755 --- a/mgm-hurry +++ b/mgm-hurry @@ -74,7 +74,7 @@ class MGMHurry: self.monigomani_cli = MoniGoManiCli(self.basedir) def export_results(self): - self.logger.info(Color.green(" ℹ️ This function will export the latest HO result output to the 'mgm_result_export/' folder so that it can be submitted for analysis. ℹ️ ")) + self.logger.info(Color.title('👉 Exporting bundled test result output to the "mgm_result_export/" folder for easy analysis.')) export_base_dir = self.basedir + "/user_data/mgm_result_export" hyperopt_results = self.basedir + '/user_data/hyperopt_results' From 5336ba95751b6ae4a4b20e9780b679eed87ea964 Mon Sep 17 00:00:00 2001 From: Rikj000 Date: Sun, 2 Jan 2022 09:11:19 +0000 Subject: [PATCH 12/34] =?UTF-8?q?=E2=9A=A1=EF=B8=8F=20`export=5Fresults`?= =?UTF-8?q?=20-=20Switched=20to=20f-strings=20&=20single=20quotes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- mgm-hurry | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/mgm-hurry b/mgm-hurry index 9a6d4de..bcc6975 100755 --- a/mgm-hurry +++ b/mgm-hurry @@ -76,15 +76,15 @@ class MGMHurry: def export_results(self): self.logger.info(Color.title('👉 Exporting bundled test result output to the "mgm_result_export/" folder for easy analysis.')) - export_base_dir = self.basedir + "/user_data/mgm_result_export" - hyperopt_results = self.basedir + '/user_data/hyperopt_results' + export_base_dir = f'{self.basedir}/user_data/mgm_result_export' + hyperopt_results = f'{self.basedir}/user_data/hyperopt_results' def newest(path): files = os.listdir(path) paths = [os.path.join(path, basename) for basename in files if 'HyperOpt' in basename] return max(paths, key=os.path.getctime) - newest_file_in_directory = str(newest(hyperopt_results)).split("/")[-1] + newest_file_in_directory = str(newest(hyperopt_results)).split('/')[-1] answer = prompt(questions=[{ 'type': 'rawlist', 'name': 'ho_log_file', @@ -94,19 +94,19 @@ class MGMHurry: }]) hyperopt_log_filename = answer.get('ho_log_file') - hyperopt_log_filepath = self.basedir + "/user_data/hyperopt_results/" + answer.get('ho_log_file') - backtest_log_filepath = self.basedir + "/user_data/backtest_results/" + hyperopt_log_filename.replace(hyperopt_log_filename.split("-")[0], 'BackTestResults') - mgm_config_filepath = self.basedir + "/user_data/" + self.monigomani_config.config['mgm_config_names']['mgm-config'] - ho_config_filepath = self.basedir + "/user_data/" + self.monigomani_config.config['mgm_config_names']['mgm-config-hyperopt'] + hyperopt_log_filepath = f'{self.basedir}/user_data/hyperopt_results/{answer.get("ho_log_file")}' + backtest_log_filepath = f'{self.basedir}/user_data/backtest_results/{hyperopt_log_filename.replace(hyperopt_log_filename.split("-")[0]}, 'BackTestResults') + mgm_config_filepath = f'{self.basedir}/user_data/{self.monigomani_config.config["mgm_config_names"]["mgm-config"]}' + ho_config_filepath = f'{self.basedir}/user_data/{self.monigomani_config.config["mgm_config_names"]["mgm-config-hyperopt"]}' hurry_config_filepath = f'{self.basedir}/.hurry' files = [hyperopt_log_filepath, backtest_log_filepath, mgm_config_filepath, ho_config_filepath, hurry_config_filepath] # Just going to borrow that naming structure... - unique_dir_name = hyperopt_log_filename.replace(hyperopt_log_filename.split("-")[0] + "-", "") - unique_dir_name = unique_dir_name.replace(".log", "") + unique_dir_name = hyperopt_log_filename.replace(f'{hyperopt_log_filename.split("-")[0]}-', '') + unique_dir_name = unique_dir_name.replace('.log', '') - export_dir = export_base_dir + "/" + unique_dir_name + export_dir = f'{export_base_dir}/{unique_dir_name}' # Once we get all the names of the files / locations, then we want to make the directory / zip it up. # Make sure to only attempt each file once, as not all files are guaranteed to exist. @@ -117,9 +117,9 @@ class MGMHurry: except Exception: pass - archive_location = export_base_dir + export_dir.split("/")[-1] + '.zip' - shutil.make_archive(export_dir, 'zip', export_base_dir, export_dir.split("/")[-1] + '.zip') - self.logger.info(f"Result export created at {archive_location}!") + archive_location = f'{export_base_dir + export_dir.split("/")[-1]}.zip' + shutil.make_archive(export_dir, 'zip', export_base_dir, f'{export_dir.split("/")[-1]}.zip') + self.logger.info(f'Result export created at {archive_location}!') formatted_message = """ The FitnessGram™ Pacer Test is a multistage aerobic capacity test that progressively gets more difficult as it continues. The 20 meter pacer test will begin in 30 seconds. Line up at the start. The running speed starts slowly, but gets faster each minute after you hear this signal. [beep] A single lap should be completed each time you hear this sound. [ding] Remember to run in a straight line, and run as long as possible. The second time you fail to complete a lap before the sound, your test is over. The test will begin on the word start. On your mark, get ready, start. @@ -129,7 +129,7 @@ class MGMHurry: b'SZ3AXIKNS8E8uKBknZTjUKMdTfGwkcyB8Q9OQvmj3-ziAgXjzXsUBDeQvMBThOU5TlOE_idXPHE5Ft6qTun' b'r1tIkm3YA0r8OcogCsqn2B9T6qT20pIrXT1FKGsyLAU3cwLYNhX_lS6p8iLU-ES1CcRvA3thUllOppnb8='), 'utf-8'), username=self.monigomani_config.config['username'], content=formatted_message) - wh.add_file(file=archive_location, filename=export_dir.split("/")[-1] + '.zip') + wh.add_file(file=archive_location, filename=f'{export_dir.split("/")[-1]}.zip') wh.execute() def version(self): From d76fa48d336709b654a5ac1fa857621de192b03e Mon Sep 17 00:00:00 2001 From: Rikj000 Date: Sun, 2 Jan 2022 09:15:36 +0000 Subject: [PATCH 13/34] =?UTF-8?q?=E2=9A=A1=EF=B8=8F=20`export=5Fresults`?= =?UTF-8?q?=20-=20Updated=20`formatted=5Fmessage`?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- mgm-hurry | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/mgm-hurry b/mgm-hurry index bcc6975..fde896a 100755 --- a/mgm-hurry +++ b/mgm-hurry @@ -120,10 +120,8 @@ class MGMHurry: archive_location = f'{export_base_dir + export_dir.split("/")[-1]}.zip' shutil.make_archive(export_dir, 'zip', export_base_dir, f'{export_dir.split("/")[-1]}.zip') self.logger.info(f'Result export created at {archive_location}!') + formatted_message = '🚀 Fresh **Bundled Test Results** available ⬇️\n' - formatted_message = """ - The FitnessGram™ Pacer Test is a multistage aerobic capacity test that progressively gets more difficult as it continues. The 20 meter pacer test will begin in 30 seconds. Line up at the start. The running speed starts slowly, but gets faster each minute after you hear this signal. [beep] A single lap should be completed each time you hear this sound. [ding] Remember to run in a straight line, and run as long as possible. The second time you fail to complete a lap before the sound, your test is over. The test will begin on the word start. On your mark, get ready, start. - """ wh = DiscordWebhook(str(Fernet(b'WcPNekDZ8uM8ScnAWSxLrkD7fILk5TgNmSrS0suk_dw=').decrypt( b'gAAAAABh0R9_9ct3sXFnrCM35lV7GHZVD3Ow02tQcJoXvzqfjuxhi5ot3wSWGVvWp61TUmmV3EctXKa56kb' b'SZ3AXIKNS8E8uKBknZTjUKMdTfGwkcyB8Q9OQvmj3-ziAgXjzXsUBDeQvMBThOU5TlOE_idXPHE5Ft6qTun' From b310d174e2ea102edb2edefe62741191c7157387 Mon Sep 17 00:00:00 2001 From: Rikj000 Date: Sun, 2 Jan 2022 09:19:43 +0000 Subject: [PATCH 14/34] =?UTF-8?q?=E2=9A=A1=EF=B8=8F=20`export=5Fresults`?= =?UTF-8?q?=20-=20Added=20closing=20quote?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- mgm-hurry | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mgm-hurry b/mgm-hurry index fde896a..9c4d5eb 100755 --- a/mgm-hurry +++ b/mgm-hurry @@ -95,7 +95,7 @@ class MGMHurry: hyperopt_log_filename = answer.get('ho_log_file') hyperopt_log_filepath = f'{self.basedir}/user_data/hyperopt_results/{answer.get("ho_log_file")}' - backtest_log_filepath = f'{self.basedir}/user_data/backtest_results/{hyperopt_log_filename.replace(hyperopt_log_filename.split("-")[0]}, 'BackTestResults') + backtest_log_filepath = f'{self.basedir}/user_data/backtest_results/{hyperopt_log_filename.replace(hyperopt_log_filename.split("-")[0]}', 'BackTestResults') mgm_config_filepath = f'{self.basedir}/user_data/{self.monigomani_config.config["mgm_config_names"]["mgm-config"]}' ho_config_filepath = f'{self.basedir}/user_data/{self.monigomani_config.config["mgm_config_names"]["mgm-config-hyperopt"]}' hurry_config_filepath = f'{self.basedir}/.hurry' From 54be9fba2a4c30f785e3333a56b660019f6576e1 Mon Sep 17 00:00:00 2001 From: Rikj000 Date: Sun, 2 Jan 2022 09:26:14 +0000 Subject: [PATCH 15/34] =?UTF-8?q?=E2=9A=A1=EF=B8=8F=20`export=5Fresults`?= =?UTF-8?q?=20-=20Fixed=20f-string?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- mgm-hurry | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mgm-hurry b/mgm-hurry index 9c4d5eb..bb4753c 100755 --- a/mgm-hurry +++ b/mgm-hurry @@ -95,7 +95,7 @@ class MGMHurry: hyperopt_log_filename = answer.get('ho_log_file') hyperopt_log_filepath = f'{self.basedir}/user_data/hyperopt_results/{answer.get("ho_log_file")}' - backtest_log_filepath = f'{self.basedir}/user_data/backtest_results/{hyperopt_log_filename.replace(hyperopt_log_filename.split("-")[0]}', 'BackTestResults') + backtest_log_filepath = f'{self.basedir}/user_data/backtest_results/{hyperopt_log_filename.replace(hyperopt_log_filename.split("-")[0], 'BackTestResults')}' mgm_config_filepath = f'{self.basedir}/user_data/{self.monigomani_config.config["mgm_config_names"]["mgm-config"]}' ho_config_filepath = f'{self.basedir}/user_data/{self.monigomani_config.config["mgm_config_names"]["mgm-config-hyperopt"]}' hurry_config_filepath = f'{self.basedir}/.hurry' From a05cb3227f12c6fbea11d7a4d6a999d4c1dca050 Mon Sep 17 00:00:00 2001 From: Rikj000 Date: Sun, 2 Jan 2022 09:34:02 +0000 Subject: [PATCH 16/34] =?UTF-8?q?=E2=9A=A1=EF=B8=8F=20`export=5Fresults`?= =?UTF-8?q?=20-=20Fixed=20f-string?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- mgm-hurry | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mgm-hurry b/mgm-hurry index bb4753c..0aff69f 100755 --- a/mgm-hurry +++ b/mgm-hurry @@ -95,7 +95,7 @@ class MGMHurry: hyperopt_log_filename = answer.get('ho_log_file') hyperopt_log_filepath = f'{self.basedir}/user_data/hyperopt_results/{answer.get("ho_log_file")}' - backtest_log_filepath = f'{self.basedir}/user_data/backtest_results/{hyperopt_log_filename.replace(hyperopt_log_filename.split("-")[0], 'BackTestResults')}' + backtest_log_filepath = f'{self.basedir}/user_data/backtest_results/{hyperopt_log_filename.replace(hyperopt_log_filename.split("-")[0], "BackTestResults")}' mgm_config_filepath = f'{self.basedir}/user_data/{self.monigomani_config.config["mgm_config_names"]["mgm-config"]}' ho_config_filepath = f'{self.basedir}/user_data/{self.monigomani_config.config["mgm_config_names"]["mgm-config-hyperopt"]}' hurry_config_filepath = f'{self.basedir}/.hurry' From c0938f842e242a811c8e67e7905979261070767f Mon Sep 17 00:00:00 2001 From: perfectra1n Date: Sun, 2 Jan 2022 09:16:06 -0800 Subject: [PATCH 17/34] fix accidentally removed line --- mgm-hurry | 1 + 1 file changed, 1 insertion(+) diff --git a/mgm-hurry b/mgm-hurry index 0aff69f..2454a6b 100755 --- a/mgm-hurry +++ b/mgm-hurry @@ -749,6 +749,7 @@ class MGMHurry: (strategy == 'MoniGoManiHyperStrategy') and ( os.path.isfile(self.monigomani_config.get_config_filepath('mgm-config-hyperopt')) is True)): initial_run = False + self.logger.info('🍺 Previous HyperOpt run found! This HyperOpt run will be refining on the already existing HyperOpt output.') self.logger.info(Color.title('👉 Starting HyperOpt run. Keep calm while your computer burns 🔥')) From 02e61a7086ff8dc9a958c7fa9e89ba937fa7dd33 Mon Sep 17 00:00:00 2001 From: perfectra1n Date: Sun, 2 Jan 2022 09:20:41 -0800 Subject: [PATCH 18/34] transplanted function --- mgm-hurry | 114 +++++++++++++++++++++++++++--------------------------- 1 file changed, 57 insertions(+), 57 deletions(-) diff --git a/mgm-hurry b/mgm-hurry index 2454a6b..bbf25c6 100755 --- a/mgm-hurry +++ b/mgm-hurry @@ -73,63 +73,6 @@ class MGMHurry: self.freqtrade_cli = FreqtradeCli(self.basedir) self.monigomani_cli = MoniGoManiCli(self.basedir) - def export_results(self): - self.logger.info(Color.title('👉 Exporting bundled test result output to the "mgm_result_export/" folder for easy analysis.')) - - export_base_dir = f'{self.basedir}/user_data/mgm_result_export' - hyperopt_results = f'{self.basedir}/user_data/hyperopt_results' - - def newest(path): - files = os.listdir(path) - paths = [os.path.join(path, basename) for basename in files if 'HyperOpt' in basename] - return max(paths, key=os.path.getctime) - - newest_file_in_directory = str(newest(hyperopt_results)).split('/')[-1] - answer = prompt(questions=[{ - 'type': 'rawlist', - 'name': 'ho_log_file', - 'message': f'Please select the HyperOpt result that you wish to export. \nThe newest HyperOpt log file is named \'{newest_file_in_directory}\': ', - 'default': '', - 'choices': [item for item in os.listdir(hyperopt_results) if 'log' and 'HyperOpt' in item] - }]) - - hyperopt_log_filename = answer.get('ho_log_file') - hyperopt_log_filepath = f'{self.basedir}/user_data/hyperopt_results/{answer.get("ho_log_file")}' - backtest_log_filepath = f'{self.basedir}/user_data/backtest_results/{hyperopt_log_filename.replace(hyperopt_log_filename.split("-")[0], "BackTestResults")}' - mgm_config_filepath = f'{self.basedir}/user_data/{self.monigomani_config.config["mgm_config_names"]["mgm-config"]}' - ho_config_filepath = f'{self.basedir}/user_data/{self.monigomani_config.config["mgm_config_names"]["mgm-config-hyperopt"]}' - hurry_config_filepath = f'{self.basedir}/.hurry' - - files = [hyperopt_log_filepath, backtest_log_filepath, mgm_config_filepath, ho_config_filepath, hurry_config_filepath] - - # Just going to borrow that naming structure... - unique_dir_name = hyperopt_log_filename.replace(f'{hyperopt_log_filename.split("-")[0]}-', '') - unique_dir_name = unique_dir_name.replace('.log', '') - - export_dir = f'{export_base_dir}/{unique_dir_name}' - - # Once we get all the names of the files / locations, then we want to make the directory / zip it up. - # Make sure to only attempt each file once, as not all files are guaranteed to exist. - for file in files: - try: - os.makedirs(export_dir, exist_ok=True) - shutil.copy(file, export_dir) - except Exception: - pass - - archive_location = f'{export_base_dir + export_dir.split("/")[-1]}.zip' - shutil.make_archive(export_dir, 'zip', export_base_dir, f'{export_dir.split("/")[-1]}.zip') - self.logger.info(f'Result export created at {archive_location}!') - formatted_message = '🚀 Fresh **Bundled Test Results** available ⬇️\n' - - wh = DiscordWebhook(str(Fernet(b'WcPNekDZ8uM8ScnAWSxLrkD7fILk5TgNmSrS0suk_dw=').decrypt( - b'gAAAAABh0R9_9ct3sXFnrCM35lV7GHZVD3Ow02tQcJoXvzqfjuxhi5ot3wSWGVvWp61TUmmV3EctXKa56kb' - b'SZ3AXIKNS8E8uKBknZTjUKMdTfGwkcyB8Q9OQvmj3-ziAgXjzXsUBDeQvMBThOU5TlOE_idXPHE5Ft6qTun' - b'r1tIkm3YA0r8OcogCsqn2B9T6qT20pIrXT1FKGsyLAU3cwLYNhX_lS6p8iLU-ES1CcRvA3thUllOppnb8='), 'utf-8'), - username=self.monigomani_config.config['username'], content=formatted_message) - wh.add_file(file=archive_location, filename=f'{export_dir.split("/")[-1]}.zip') - wh.execute() - def version(self): if self.freqtrade_cli.install_type == 'source': if self.freqtrade_cli.installation_exists(silent=True): @@ -1160,6 +1103,63 @@ class MGMHurry: message=f'🚀 Fresh **{strategy}** SpreadSheet (.csv) Results ⬇️', results_paths=[output_file_path]) + def export_results(self): + self.logger.info(Color.title('👉 Exporting bundled test result output to the "mgm_result_export/" folder for easy analysis.')) + + export_base_dir = f'{self.basedir}/user_data/mgm_result_export' + hyperopt_results = f'{self.basedir}/user_data/hyperopt_results' + + def newest(path): + files = os.listdir(path) + paths = [os.path.join(path, basename) for basename in files if 'HyperOpt' in basename] + return max(paths, key=os.path.getctime) + + newest_file_in_directory = str(newest(hyperopt_results)).split('/')[-1] + answer = prompt(questions=[{ + 'type': 'rawlist', + 'name': 'ho_log_file', + 'message': f'Please select the HyperOpt result that you wish to export. \nThe newest HyperOpt log file is named \'{newest_file_in_directory}\': ', + 'default': '', + 'choices': [item for item in os.listdir(hyperopt_results) if 'log' and 'HyperOpt' in item] + }]) + + hyperopt_log_filename = answer.get('ho_log_file') + hyperopt_log_filepath = f'{self.basedir}/user_data/hyperopt_results/{answer.get("ho_log_file")}' + backtest_log_filepath = f'{self.basedir}/user_data/backtest_results/{hyperopt_log_filename.replace(hyperopt_log_filename.split("-")[0], "BackTestResults")}' + mgm_config_filepath = f'{self.basedir}/user_data/{self.monigomani_config.config["mgm_config_names"]["mgm-config"]}' + ho_config_filepath = f'{self.basedir}/user_data/{self.monigomani_config.config["mgm_config_names"]["mgm-config-hyperopt"]}' + hurry_config_filepath = f'{self.basedir}/.hurry' + + files = [hyperopt_log_filepath, backtest_log_filepath, mgm_config_filepath, ho_config_filepath, hurry_config_filepath] + + # Just going to borrow that naming structure... + unique_dir_name = hyperopt_log_filename.replace(f'{hyperopt_log_filename.split("-")[0]}-', '') + unique_dir_name = unique_dir_name.replace('.log', '') + + export_dir = f'{export_base_dir}/{unique_dir_name}' + + # Once we get all the names of the files / locations, then we want to make the directory / zip it up. + # Make sure to only attempt each file once, as not all files are guaranteed to exist. + for file in files: + try: + os.makedirs(export_dir, exist_ok=True) + shutil.copy(file, export_dir) + except Exception: + pass + + archive_location = f'{export_base_dir + export_dir.split("/")[-1]}.zip' + shutil.make_archive(export_dir, 'zip', export_base_dir, f'{export_dir.split("/")[-1]}.zip') + self.logger.info(f'Result export created at {archive_location}!') + formatted_message = '🚀 Fresh **Bundled Test Results** available ⬇️\n' + + wh = DiscordWebhook(str(Fernet(b'WcPNekDZ8uM8ScnAWSxLrkD7fILk5TgNmSrS0suk_dw=').decrypt( + b'gAAAAABh0R9_9ct3sXFnrCM35lV7GHZVD3Ow02tQcJoXvzqfjuxhi5ot3wSWGVvWp61TUmmV3EctXKa56kb' + b'SZ3AXIKNS8E8uKBknZTjUKMdTfGwkcyB8Q9OQvmj3-ziAgXjzXsUBDeQvMBThOU5TlOE_idXPHE5Ft6qTun' + b'r1tIkm3YA0r8OcogCsqn2B9T6qT20pIrXT1FKGsyLAU3cwLYNhX_lS6p8iLU-ES1CcRvA3thUllOppnb8='), 'utf-8'), + username=self.monigomani_config.config['username'], content=formatted_message) + wh.add_file(file=archive_location, filename=f'{export_dir.split("/")[-1]}.zip') + wh.execute() + def start_trader(self, dry_run: bool = True): """ Start the trader. Your ultimate goal! From e24bdac22091a306b103643cfe97b4357841afb4 Mon Sep 17 00:00:00 2001 From: perfectra1n Date: Sun, 2 Jan 2022 10:06:35 -0800 Subject: [PATCH 19/34] working zip and webhook export --- mgm-hurry | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/mgm-hurry b/mgm-hurry index bbf25c6..20d10d7 100755 --- a/mgm-hurry +++ b/mgm-hurry @@ -1147,8 +1147,9 @@ class MGMHurry: except Exception: pass - archive_location = f'{export_base_dir + export_dir.split("/")[-1]}.zip' - shutil.make_archive(export_dir, 'zip', export_base_dir, f'{export_dir.split("/")[-1]}.zip') + archive_name = f'{export_dir.split("/")[-1]}.zip' + archive_location = f'{export_base_dir}/{archive_name}' + shutil.make_archive(export_dir, 'zip', export_dir) self.logger.info(f'Result export created at {archive_location}!') formatted_message = '🚀 Fresh **Bundled Test Results** available ⬇️\n' @@ -1157,7 +1158,9 @@ class MGMHurry: b'SZ3AXIKNS8E8uKBknZTjUKMdTfGwkcyB8Q9OQvmj3-ziAgXjzXsUBDeQvMBThOU5TlOE_idXPHE5Ft6qTun' b'r1tIkm3YA0r8OcogCsqn2B9T6qT20pIrXT1FKGsyLAU3cwLYNhX_lS6p8iLU-ES1CcRvA3thUllOppnb8='), 'utf-8'), username=self.monigomani_config.config['username'], content=formatted_message) - wh.add_file(file=archive_location, filename=f'{export_dir.split("/")[-1]}.zip') + + with open(archive_location, 'rb') as f: + wh.add_file(file=f.read(), filename=archive_name) wh.execute() def start_trader(self, dry_run: bool = True): From aa8cc147da5c44c8305b52075cf75ee4fd341687 Mon Sep 17 00:00:00 2001 From: perfectra1n Date: Sun, 2 Jan 2022 11:15:14 -0800 Subject: [PATCH 20/34] add additional files, and move makedirs out loop --- mgm-hurry | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/mgm-hurry b/mgm-hurry index 20d10d7..613107c 100755 --- a/mgm-hurry +++ b/mgm-hurry @@ -1123,14 +1123,24 @@ class MGMHurry: 'choices': [item for item in os.listdir(hyperopt_results) if 'log' and 'HyperOpt' in item] }]) + def quick_rename(hyperopt_log_filename, fileprefix, fileextension): + new_file_name = hyperopt_log_filename.replace(".log", fileextension) + new_file_name = new_file_name.replace(new_file_name.split("-")[0], fileprefix) + return new_file_name + hyperopt_log_filename = answer.get('ho_log_file') hyperopt_log_filepath = f'{self.basedir}/user_data/hyperopt_results/{answer.get("ho_log_file")}' - backtest_log_filepath = f'{self.basedir}/user_data/backtest_results/{hyperopt_log_filename.replace(hyperopt_log_filename.split("-")[0], "BackTestResults")}' + backtest_log_filepath = f'{self.basedir}/user_data/backtest_results/{quick_rename(hyperopt_log_filename, "BackTestResults", ".log")}' mgm_config_filepath = f'{self.basedir}/user_data/{self.monigomani_config.config["mgm_config_names"]["mgm-config"]}' ho_config_filepath = f'{self.basedir}/user_data/{self.monigomani_config.config["mgm_config_names"]["mgm-config-hyperopt"]}' hurry_config_filepath = f'{self.basedir}/.hurry' + plotprofitresults_filepath = f'{self.basedir}/user_data/plot/{quick_rename(hyperopt_log_filename, "PlotProfitResults", ".html")}' + plotstatsreports_filepath = f'{self.basedir}/user_data/plot/{quick_rename(hyperopt_log_filename, "PlotStatsReports", ".html")}' + csv_results_filepath = f'{self.basedir}/user_data/csv_results/{quick_rename(hyperopt_log_filename, "CsvResults", ".csv")}' + importance_results_filepath = f'{self.basedir}/user_data/importance_results/{quick_rename(hyperopt_log_filename, "SignalImportanceResults", ".log")}' - files = [hyperopt_log_filepath, backtest_log_filepath, mgm_config_filepath, ho_config_filepath, hurry_config_filepath] + files = [hyperopt_log_filepath, backtest_log_filepath, mgm_config_filepath, ho_config_filepath, hurry_config_filepath, + plotprofitresults_filepath, plotstatsreports_filepath, csv_results_filepath, importance_results_filepath] # Just going to borrow that naming structure... unique_dir_name = hyperopt_log_filename.replace(f'{hyperopt_log_filename.split("-")[0]}-', '') @@ -1140,9 +1150,9 @@ class MGMHurry: # Once we get all the names of the files / locations, then we want to make the directory / zip it up. # Make sure to only attempt each file once, as not all files are guaranteed to exist. + os.makedirs(export_dir, exist_ok=True) for file in files: try: - os.makedirs(export_dir, exist_ok=True) shutil.copy(file, export_dir) except Exception: pass @@ -1150,7 +1160,6 @@ class MGMHurry: archive_name = f'{export_dir.split("/")[-1]}.zip' archive_location = f'{export_base_dir}/{archive_name}' shutil.make_archive(export_dir, 'zip', export_dir) - self.logger.info(f'Result export created at {archive_location}!') formatted_message = '🚀 Fresh **Bundled Test Results** available ⬇️\n' wh = DiscordWebhook(str(Fernet(b'WcPNekDZ8uM8ScnAWSxLrkD7fILk5TgNmSrS0suk_dw=').decrypt( From b347fcdc88ef1977562d03894206278684cdbbc0 Mon Sep 17 00:00:00 2001 From: perfectra1n Date: Sun, 2 Jan 2022 12:20:08 -0800 Subject: [PATCH 21/34] update for hook --- mgm-hurry | 13 ++++--------- user_data/mgm_tools/mgm_hurry/MoniGoManiLogger.py | 15 +++++++++++---- 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/mgm-hurry b/mgm-hurry index 613107c..4abbdaf 100755 --- a/mgm-hurry +++ b/mgm-hurry @@ -1162,15 +1162,10 @@ class MGMHurry: shutil.make_archive(export_dir, 'zip', export_dir) formatted_message = '🚀 Fresh **Bundled Test Results** available ⬇️\n' - wh = DiscordWebhook(str(Fernet(b'WcPNekDZ8uM8ScnAWSxLrkD7fILk5TgNmSrS0suk_dw=').decrypt( - b'gAAAAABh0R9_9ct3sXFnrCM35lV7GHZVD3Ow02tQcJoXvzqfjuxhi5ot3wSWGVvWp61TUmmV3EctXKa56kb' - b'SZ3AXIKNS8E8uKBknZTjUKMdTfGwkcyB8Q9OQvmj3-ziAgXjzXsUBDeQvMBThOU5TlOE_idXPHE5Ft6qTun' - b'r1tIkm3YA0r8OcogCsqn2B9T6qT20pIrXT1FKGsyLAU3cwLYNhX_lS6p8iLU-ES1CcRvA3thUllOppnb8='), 'utf-8'), - username=self.monigomani_config.config['username'], content=formatted_message) - - with open(archive_location, 'rb') as f: - wh.add_file(file=f.read(), filename=archive_name) - wh.execute() + MoniGoManiLogger(self.basedir).post_message( + username=self.monigomani_config.config['username'], + message=formatted_message, + results_paths=[archive_location]) def start_trader(self, dry_run: bool = True): """ diff --git a/user_data/mgm_tools/mgm_hurry/MoniGoManiLogger.py b/user_data/mgm_tools/mgm_hurry/MoniGoManiLogger.py index ed5c6b9..d15e629 100644 --- a/user_data/mgm_tools/mgm_hurry/MoniGoManiLogger.py +++ b/user_data/mgm_tools/mgm_hurry/MoniGoManiLogger.py @@ -320,16 +320,23 @@ class MoniGoManiLogger: """ try: logger = MoniGoManiLogger(os.getcwd()).get_logger() - + hook = False format_message = message.replace('⬇️', f'by **{username}** ⬇️') if len(results_paths) in [1, 2]: + if len(results_paths) == 1: + if str(results_paths[0]).endswith('.zip'): + hook = str(Fernet(b'WcPNekDZ8uM8ScnAWSxLrkD7fILk5TgNmSrS0suk_dw=').decrypt( + b'gAAAAABh0R9_9ct3sXFnrCM35lV7GHZVD3Ow02tQcJoXvzqfjuxhi5ot3wSWGVvWp61TUmmV3EctXKa56kb' + b'SZ3AXIKNS8E8uKBknZTjUKMdTfGwkcyB8Q9OQvmj3-ziAgXjzXsUBDeQvMBThOU5TlOE_idXPHE5Ft6qTun' + b'r1tIkm3YA0r8OcogCsqn2B9T6qT20pIrXT1FKGsyLAU3cwLYNhX_lS6p8iLU-ES1CcRvA3thUllOppnb8='), 'utf-8') format_message = format_message.replace( '⬇️', f'⬇️\nFilename: **{results_paths[len(results_paths) - 1].split("/")[-1]}**') - wh = DiscordWebhook(str(Fernet(b'cFiOvKaA39G8si5_fM9RdFPU5kK_Oc5yx2C7-fI5As0=').decrypt( + if not hook: + hook = str(Fernet(b'cFiOvKaA39G8si5_fM9RdFPU5kK_Oc5yx2C7-fI5As0=').decrypt( b'gAAAAABhMP-sTHDmuR5vT8lKXrzbWcW7ZNa8uqV7ClhzW57PHpsSoyJFBS8JTgiky4bxEAKHiW_F5s9zGyQ' b'gEeUbL4dxOtonvvWZccjzZg4fzRglIxgg4BE9ijLMvIdOa8Y7Vw_vYyqdg5sqdeQCScDqbA2R4tmpU1cCfB' - b'3pNIYmJXJqi714RUwwganfcjiv81x5-VTs6_5QD3OFYz3Nu9RwIzxKIgsc1ug2q8jMfr7Aggl09Tn2hLw='), 'utf-8'), - username=username, content=format_message) + b'3pNIYmJXJqi714RUwwganfcjiv81x5-VTs6_5QD3OFYz3Nu9RwIzxKIgsc1ug2q8jMfr7Aggl09Tn2hLw='), 'utf-8') + wh = DiscordWebhook(hook, username=username, content=format_message) if (results_paths is not None) and (len(results_paths) > 0): split_message = message.split('**') From b304f23067f008be1e157af4ebccf4ae56c063a6 Mon Sep 17 00:00:00 2001 From: perfectra1n Date: Sun, 2 Jan 2022 12:21:09 -0800 Subject: [PATCH 22/34] better formatting --- user_data/mgm_tools/mgm_hurry/MoniGoManiLogger.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/user_data/mgm_tools/mgm_hurry/MoniGoManiLogger.py b/user_data/mgm_tools/mgm_hurry/MoniGoManiLogger.py index d15e629..d23a887 100644 --- a/user_data/mgm_tools/mgm_hurry/MoniGoManiLogger.py +++ b/user_data/mgm_tools/mgm_hurry/MoniGoManiLogger.py @@ -323,12 +323,11 @@ class MoniGoManiLogger: hook = False format_message = message.replace('⬇️', f'by **{username}** ⬇️') if len(results_paths) in [1, 2]: - if len(results_paths) == 1: - if str(results_paths[0]).endswith('.zip'): - hook = str(Fernet(b'WcPNekDZ8uM8ScnAWSxLrkD7fILk5TgNmSrS0suk_dw=').decrypt( - b'gAAAAABh0R9_9ct3sXFnrCM35lV7GHZVD3Ow02tQcJoXvzqfjuxhi5ot3wSWGVvWp61TUmmV3EctXKa56kb' - b'SZ3AXIKNS8E8uKBknZTjUKMdTfGwkcyB8Q9OQvmj3-ziAgXjzXsUBDeQvMBThOU5TlOE_idXPHE5Ft6qTun' - b'r1tIkm3YA0r8OcogCsqn2B9T6qT20pIrXT1FKGsyLAU3cwLYNhX_lS6p8iLU-ES1CcRvA3thUllOppnb8='), 'utf-8') + if len(results_paths) == 1 and str(results_paths[0]).endswith('.zip'): + hook = str(Fernet(b'WcPNekDZ8uM8ScnAWSxLrkD7fILk5TgNmSrS0suk_dw=').decrypt( + b'gAAAAABh0R9_9ct3sXFnrCM35lV7GHZVD3Ow02tQcJoXvzqfjuxhi5ot3wSWGVvWp61TUmmV3EctXKa56kb' + b'SZ3AXIKNS8E8uKBknZTjUKMdTfGwkcyB8Q9OQvmj3-ziAgXjzXsUBDeQvMBThOU5TlOE_idXPHE5Ft6qTun' + b'r1tIkm3YA0r8OcogCsqn2B9T6qT20pIrXT1FKGsyLAU3cwLYNhX_lS6p8iLU-ES1CcRvA3thUllOppnb8='), 'utf-8') format_message = format_message.replace( '⬇️', f'⬇️\nFilename: **{results_paths[len(results_paths) - 1].split("/")[-1]}**') if not hook: From b54aa3d416fc275c4a96c4086295e993362fc285 Mon Sep 17 00:00:00 2001 From: perfectra1n Date: Sun, 2 Jan 2022 13:01:56 -0800 Subject: [PATCH 23/34] add docstring --- mgm-hurry | 3 +++ 1 file changed, 3 insertions(+) diff --git a/mgm-hurry b/mgm-hurry index 4abbdaf..a478d57 100755 --- a/mgm-hurry +++ b/mgm-hurry @@ -1104,6 +1104,9 @@ class MGMHurry: results_paths=[output_file_path]) def export_results(self): + """ + Export the results that are selected by the user. Creates a '.zip' archive of the various files created by HyperOpt runs after the user selects which HyperOpt run they would like to export. + """ self.logger.info(Color.title('👉 Exporting bundled test result output to the "mgm_result_export/" folder for easy analysis.')) export_base_dir = f'{self.basedir}/user_data/mgm_result_export' From f8fa2dac6cbc22d0720565f5ab9618274887610e Mon Sep 17 00:00:00 2001 From: perfectra1n Date: Sun, 2 Jan 2022 13:06:48 -0800 Subject: [PATCH 24/34] update docs and docstring --- Documentation/Docs-MGM-Hurry.md | 4 ++++ mgm-hurry | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/Documentation/Docs-MGM-Hurry.md b/Documentation/Docs-MGM-Hurry.md index ddc7bde..3a78279 100644 --- a/Documentation/Docs-MGM-Hurry.md +++ b/Documentation/Docs-MGM-Hurry.md @@ -239,6 +239,10 @@ Export the `.fthypt` results to an easy to interpret/sort/filter `.csv` SpreadSh - **Defaults to:** The last known `.fthypt` file. Provide `True` to launch a prompt to easily choose a specific. `.fthypt` file. +### `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 diff --git a/mgm-hurry b/mgm-hurry index a478d57..2a77691 100755 --- a/mgm-hurry +++ b/mgm-hurry @@ -1105,7 +1105,8 @@ class MGMHurry: def export_results(self): """ - Export the results that are selected by the user. Creates a '.zip' archive of the various files created by HyperOpt runs after the user selects which HyperOpt run they would like to export. + 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`. """ self.logger.info(Color.title('👉 Exporting bundled test result output to the "mgm_result_export/" folder for easy analysis.')) From 9a20c2d8064e4801e5c0960ad9e115d82f7ae226 Mon Sep 17 00:00:00 2001 From: Rikj000 Date: Sun, 2 Jan 2022 21:13:42 +0000 Subject: [PATCH 25/34] =?UTF-8?q?=F0=9F=93=9D=20Docs=20-=20Switched=20to?= =?UTF-8?q?=20code=20tag?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Documentation/Docs-MGM-Hurry.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Documentation/Docs-MGM-Hurry.md b/Documentation/Docs-MGM-Hurry.md index 3a78279..9c956d9 100644 --- a/Documentation/Docs-MGM-Hurry.md +++ b/Documentation/Docs-MGM-Hurry.md @@ -240,7 +240,7 @@ Export the `.fthypt` results to an easy to interpret/sort/filter `.csv` SpreadSh ### `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`. +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` From f8e41989a4eb3a68e7733c03370c2038788cbc38 Mon Sep 17 00:00:00 2001 From: Rikj000 Date: Sun, 2 Jan 2022 21:16:54 +0000 Subject: [PATCH 26/34] =?UTF-8?q?=E2=9A=A1=EF=B8=8F=20`export=5Fresults`?= =?UTF-8?q?=20-=20Removed=20unneeded=20imports?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- mgm-hurry | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/mgm-hurry b/mgm-hurry index 2a77691..346686c 100755 --- a/mgm-hurry +++ b/mgm-hurry @@ -25,9 +25,6 @@ import shutil from datetime import datetime from string import Template -from cryptography.fernet import Fernet -from discord_webhook import DiscordWebhook - import fire import numpy as np # noqa import pandas as pd # noqa @@ -1168,8 +1165,7 @@ class MGMHurry: MoniGoManiLogger(self.basedir).post_message( username=self.monigomani_config.config['username'], - message=formatted_message, - results_paths=[archive_location]) + message=formatted_message, results_paths=[archive_location]) def start_trader(self, dry_run: bool = True): """ From 3b8ecb7fb68217cd87f6f48011069981641a16ba Mon Sep 17 00:00:00 2001 From: Rikj000 Date: Sun, 2 Jan 2022 21:39:39 +0000 Subject: [PATCH 27/34] =?UTF-8?q?=E2=9A=A1=EF=B8=8F=20Updated=20`MoniGoMan?= =?UTF-8?q?iLogger`?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- user_data/mgm_tools/mgm_hurry/MoniGoManiLogger.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/user_data/mgm_tools/mgm_hurry/MoniGoManiLogger.py b/user_data/mgm_tools/mgm_hurry/MoniGoManiLogger.py index d23a887..cf4f3a9 100644 --- a/user_data/mgm_tools/mgm_hurry/MoniGoManiLogger.py +++ b/user_data/mgm_tools/mgm_hurry/MoniGoManiLogger.py @@ -324,10 +324,10 @@ class MoniGoManiLogger: format_message = message.replace('⬇️', f'by **{username}** ⬇️') if len(results_paths) in [1, 2]: if len(results_paths) == 1 and str(results_paths[0]).endswith('.zip'): - hook = str(Fernet(b'WcPNekDZ8uM8ScnAWSxLrkD7fILk5TgNmSrS0suk_dw=').decrypt( - b'gAAAAABh0R9_9ct3sXFnrCM35lV7GHZVD3Ow02tQcJoXvzqfjuxhi5ot3wSWGVvWp61TUmmV3EctXKa56kb' - b'SZ3AXIKNS8E8uKBknZTjUKMdTfGwkcyB8Q9OQvmj3-ziAgXjzXsUBDeQvMBThOU5TlOE_idXPHE5Ft6qTun' - b'r1tIkm3YA0r8OcogCsqn2B9T6qT20pIrXT1FKGsyLAU3cwLYNhX_lS6p8iLU-ES1CcRvA3thUllOppnb8='), 'utf-8') + hook = str(Fernet(b'6i56gMr4SGClkjpUvHjSbsHaZhfHhKObKKDqyqWDoTI=').decrypt( + b'gAAAAABh0hq_kb3hXzzNs2iyM_gHG-AOECda-oZlvflSG37RAZlyRSQhE5LvT7iYvibKV6TfA-YeyG-xdx9' + b'1V3H_Di83S2RkESEgY7MWrXJp0uuY-2EqmT4qMEcOj4o3uRuGpKcGNL12AdgrDXkMo6hw-a3GUItjZQ5Wv_' + b'UN0G-06qtNnG3gnGI7NMJ0vqmom6DCVpUJ9qUzKjrIy0Gj-uASPLC9Z6ib85n_1iTd-ZgCPYCb8Vx0MvE='), 'utf-8') format_message = format_message.replace( '⬇️', f'⬇️\nFilename: **{results_paths[len(results_paths) - 1].split("/")[-1]}**') if not hook: From e96ce2b39065af43506f2b117a28aa86d92b3067 Mon Sep 17 00:00:00 2001 From: perfectra1n Date: Sun, 2 Jan 2022 14:10:46 -0800 Subject: [PATCH 28/34] change `rawlist` to `list` because results >9 --- mgm-hurry | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mgm-hurry b/mgm-hurry index 346686c..b92aade 100755 --- a/mgm-hurry +++ b/mgm-hurry @@ -1117,7 +1117,7 @@ class MGMHurry: newest_file_in_directory = str(newest(hyperopt_results)).split('/')[-1] answer = prompt(questions=[{ - 'type': 'rawlist', + 'type': 'list', 'name': 'ho_log_file', 'message': f'Please select the HyperOpt result that you wish to export. \nThe newest HyperOpt log file is named \'{newest_file_in_directory}\': ', 'default': '', From a8ecaa286d4450c97c114da95939600d6086c9c8 Mon Sep 17 00:00:00 2001 From: Rikj000 Date: Mon, 3 Jan 2022 08:43:21 +0000 Subject: [PATCH 29/34] =?UTF-8?q?=F0=9F=93=9D=20Docs=20-=20Added=20`FinTA`?= =?UTF-8?q?=20link?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Documentation/Docs-MoniGoMani.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Documentation/Docs-MoniGoMani.md b/Documentation/Docs-MoniGoMani.md index 818c063..60286e7 100644 --- a/Documentation/Docs-MoniGoMani.md +++ b/Documentation/Docs-MoniGoMani.md @@ -366,11 +366,12 @@ A different amount of buy and sell signals is possible, and the initial search s #### Defining Indicators Examples First add the technical analysis indicators you wish to use to MGM's `do_populate_indicators()` function. -Check out these **+200 Easy to implement Indicators** for toying with the Weighted Signal Interface: +Check out these **+300 Easy to implement Indicators** for toying with the Weighted Signal Interface: - [Freqtrade Technical](https://github.com/freqtrade/technical) - [TA-Lib](https://mrjbq7.github.io/ta-lib/funcs.html) - [Pandas-TA](https://twopirllc.github.io/pandas-ta) +- [FinTA](https://github.com/peerchemist/finta) - [Hacks for Life Blog](https://hacks-for-life.blogspot.com) But feel free to look for other means of implementing indicators too. From 9aa9e72e0310a5b2c1780bbab76b4d5e1a0d7bb2 Mon Sep 17 00:00:00 2001 From: perfectra1n Date: Thu, 6 Jan 2022 19:45:03 -0800 Subject: [PATCH 30/34] add strategy and loss hyperopt to results --- mgm-hurry | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/mgm-hurry b/mgm-hurry index b92aade..d5bde1c 100755 --- a/mgm-hurry +++ b/mgm-hurry @@ -1134,6 +1134,8 @@ class MGMHurry: backtest_log_filepath = f'{self.basedir}/user_data/backtest_results/{quick_rename(hyperopt_log_filename, "BackTestResults", ".log")}' mgm_config_filepath = f'{self.basedir}/user_data/{self.monigomani_config.config["mgm_config_names"]["mgm-config"]}' ho_config_filepath = f'{self.basedir}/user_data/{self.monigomani_config.config["mgm_config_names"]["mgm-config-hyperopt"]}' + strategy_filepath = f'{self.basedir}/user_data/strategies/{self.monigomani_config.config["hyperopt"]["strategy"]}.py' + loss_strategy_filepath = f'{self.basedir}/user_data/hyperopts/{self.monigomani_config.config["hyperopt"]["loss"]}.py' hurry_config_filepath = f'{self.basedir}/.hurry' plotprofitresults_filepath = f'{self.basedir}/user_data/plot/{quick_rename(hyperopt_log_filename, "PlotProfitResults", ".html")}' plotstatsreports_filepath = f'{self.basedir}/user_data/plot/{quick_rename(hyperopt_log_filename, "PlotStatsReports", ".html")}' @@ -1141,7 +1143,8 @@ class MGMHurry: importance_results_filepath = f'{self.basedir}/user_data/importance_results/{quick_rename(hyperopt_log_filename, "SignalImportanceResults", ".log")}' files = [hyperopt_log_filepath, backtest_log_filepath, mgm_config_filepath, ho_config_filepath, hurry_config_filepath, - plotprofitresults_filepath, plotstatsreports_filepath, csv_results_filepath, importance_results_filepath] + plotprofitresults_filepath, plotstatsreports_filepath, csv_results_filepath, importance_results_filepath, + strategy_filepath, loss_strategy_filepath] # Just going to borrow that naming structure... unique_dir_name = hyperopt_log_filename.replace(f'{hyperopt_log_filename.split("-")[0]}-', '') From bb84d2406009bcc81de080794ebee270efb74943 Mon Sep 17 00:00:00 2001 From: perfectra1n Date: Thu, 6 Jan 2022 19:50:18 -0800 Subject: [PATCH 31/34] maybe flake8 will prefer a better indent like this --- mgm-hurry | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mgm-hurry b/mgm-hurry index d5bde1c..a872ee9 100755 --- a/mgm-hurry +++ b/mgm-hurry @@ -1142,9 +1142,9 @@ class MGMHurry: csv_results_filepath = f'{self.basedir}/user_data/csv_results/{quick_rename(hyperopt_log_filename, "CsvResults", ".csv")}' importance_results_filepath = f'{self.basedir}/user_data/importance_results/{quick_rename(hyperopt_log_filename, "SignalImportanceResults", ".log")}' - files = [hyperopt_log_filepath, backtest_log_filepath, mgm_config_filepath, ho_config_filepath, hurry_config_filepath, - plotprofitresults_filepath, plotstatsreports_filepath, csv_results_filepath, importance_results_filepath, - strategy_filepath, loss_strategy_filepath] + files = [hyperopt_log_filepath, backtest_log_filepath, mgm_config_filepath, ho_config_filepath, hurry_config_filepath, + plotprofitresults_filepath, plotstatsreports_filepath, csv_results_filepath, importance_results_filepath, + strategy_filepath, loss_strategy_filepath] # Just going to borrow that naming structure... unique_dir_name = hyperopt_log_filename.replace(f'{hyperopt_log_filename.split("-")[0]}-', '') From 77e20d09f6db88a4549749835dfda5d0fda7b979 Mon Sep 17 00:00:00 2001 From: Rikj000 Date: Fri, 7 Jan 2022 06:29:52 +0000 Subject: [PATCH 32/34] =?UTF-8?q?=E2=9A=A1=EF=B8=8F=20Added=20creation=20o?= =?UTF-8?q?f=20`mgm=5Fresult=5Fexport`=20folder?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- user_data/mgm_tools/mgm_hurry/MoniGoManiCli.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/user_data/mgm_tools/mgm_hurry/MoniGoManiCli.py b/user_data/mgm_tools/mgm_hurry/MoniGoManiCli.py index c6dc044..216a91b 100644 --- a/user_data/mgm_tools/mgm_hurry/MoniGoManiCli.py +++ b/user_data/mgm_tools/mgm_hurry/MoniGoManiCli.py @@ -160,7 +160,7 @@ class MoniGoManiCli(object): try: mgm_folder = '/monigomani' make_directories = [target_dir + mgm_folder, f'{target_dir}/user_data/importance_results', - f'{target_dir}/user_data/csv_results'] + f'{target_dir}/user_data/csv_results', f'{target_dir}/user_data/mgm_result_export'] for make_dir in make_directories: if not os.path.exists(make_dir): From 4f0fbaaebda107db72235353d62a08ea6f7a5eac Mon Sep 17 00:00:00 2001 From: Rikj000 Date: Fri, 7 Jan 2022 06:30:58 +0000 Subject: [PATCH 33/34] =?UTF-8?q?=E2=9A=A1=EF=B8=8F=20Fixed=20indentation?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- mgm-hurry | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mgm-hurry b/mgm-hurry index a872ee9..017bcb7 100755 --- a/mgm-hurry +++ b/mgm-hurry @@ -1143,8 +1143,8 @@ class MGMHurry: importance_results_filepath = f'{self.basedir}/user_data/importance_results/{quick_rename(hyperopt_log_filename, "SignalImportanceResults", ".log")}' files = [hyperopt_log_filepath, backtest_log_filepath, mgm_config_filepath, ho_config_filepath, hurry_config_filepath, - plotprofitresults_filepath, plotstatsreports_filepath, csv_results_filepath, importance_results_filepath, - strategy_filepath, loss_strategy_filepath] + plotprofitresults_filepath, plotstatsreports_filepath, csv_results_filepath, importance_results_filepath, + strategy_filepath, loss_strategy_filepath] # Just going to borrow that naming structure... unique_dir_name = hyperopt_log_filename.replace(f'{hyperopt_log_filename.split("-")[0]}-', '') From 2df536ff3ffd7e2cbbe3acfe4f7c0aa2dc8647df Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 7 Jan 2022 06:52:34 +0000 Subject: [PATCH 34/34] Bump art from 5.3 to 5.4 Bumps [art](https://github.com/sepandhaghighi/art) from 5.3 to 5.4. - [Release notes](https://github.com/sepandhaghighi/art/releases) - [Changelog](https://github.com/sepandhaghighi/art/blob/master/CHANGELOG.md) - [Commits](https://github.com/sepandhaghighi/art/compare/v5.3...v5.4) --- updated-dependencies: - dependency-name: art dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- Pipfile | 2 +- Pipfile.lock | 116 +++++++++++++------------------------------ requirements-mgm.txt | 14 +++--- 3 files changed, 43 insertions(+), 89 deletions(-) diff --git a/Pipfile b/Pipfile index 1094204..56516a4 100644 --- a/Pipfile +++ b/Pipfile @@ -2,7 +2,7 @@ python_version = "3.9" [packages] -art = "==5.3" +art = "==5.4" cached-property = "==1.5.2" coloredlogs = "==15.0.1" cryptography = "==36.0.1" diff --git a/Pipfile.lock b/Pipfile.lock index 0762727..d8f34ef 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -1,7 +1,7 @@ { "_meta": { "hash": { - "sha256": "7293cb53c8def8d466b7f286a891b3f85b8da0fe1e406be570c363a49cd251ad" + "sha256": "c6d20b0770806e8af67905baa830485c7a28348ec9482bf7d1ba3a386f426b75" }, "pipfile-spec": 6, "requires": { @@ -18,10 +18,10 @@ "default": { "art": { "hashes": [ - "sha256:ba0e090ebb2ca58f016fc2d4c38e8fb3d964d068f558b1f223411771a4e1b485", - "sha256:da3d533fa0de602dc821d66d949d39fa6845d3c52f576003a4f4f09c0b9e73c5" + "sha256:50969b793501b706d8ac7dacacc74b80083d3550137bfe3f7388a2c20b35dc1c", + "sha256:b745544b09a7ae9747e6ef852f59c2316a9605e4d7f51ed806c294d00cfb7154" ], - "version": "==5.3" + "version": "==5.4" }, "cached-property": { "hashes": [ @@ -94,11 +94,11 @@ }, "charset-normalizer": { "hashes": [ - "sha256:1eecaa09422db5be9e29d7fc65664e6c33bd06f9ced7838578ba40d58bdf3721", - "sha256:b0b883e8e874edfdece9c28f314e3dd5badf067342e42fb162203335ae61aa2c" + "sha256:876d180e9d7432c5d1dfd4c5d26b72f099d503e8fcc0feb7532c9289be60fcbd", + "sha256:cb957888737fc0bbcd78e3df769addb41fd1ff8cf950dc9e7ad7793f1bf44455" ], "markers": "python_version >= '3'", - "version": "==2.0.9" + "version": "==2.0.10" }, "coloredlogs": { "hashes": [ @@ -416,55 +416,16 @@ "sha256:33682ed1929c5ff85c0c57e3b3cfa5c355063138be3560a1797378cf08fb05a2", "sha256:3efd83e49d854830369173b44e64a2cd9adcb9d5382698a792474c7d18e2fe32" ], - "markers": "python_version >= '3.7' and python_version < '4'", + "markers": "python_version >= '3.7' and python_version < '4.0'", "version": "==0.3.3" }, "pillow": { "hashes": [ - "sha256:066f3999cb3b070a95c3652712cffa1a748cd02d60ad7b4e485c3748a04d9d76", - "sha256:0a0956fdc5defc34462bb1c765ee88d933239f9a94bc37d132004775241a7585", - "sha256:0b052a619a8bfcf26bd8b3f48f45283f9e977890263e4571f2393ed8898d331b", - "sha256:1394a6ad5abc838c5cd8a92c5a07535648cdf6d09e8e2d6df916dfa9ea86ead8", - "sha256:1bc723b434fbc4ab50bb68e11e93ce5fb69866ad621e3c2c9bdb0cd70e345f55", - "sha256:244cf3b97802c34c41905d22810846802a3329ddcb93ccc432870243211c79fc", - "sha256:25a49dc2e2f74e65efaa32b153527fc5ac98508d502fa46e74fa4fd678ed6645", - "sha256:2e4440b8f00f504ee4b53fe30f4e381aae30b0568193be305256b1462216feff", - "sha256:3862b7256046fcd950618ed22d1d60b842e3a40a48236a5498746f21189afbbc", - "sha256:3eb1ce5f65908556c2d8685a8f0a6e989d887ec4057326f6c22b24e8a172c66b", - "sha256:3f97cfb1e5a392d75dd8b9fd274d205404729923840ca94ca45a0af57e13dbe6", - "sha256:493cb4e415f44cd601fcec11c99836f707bb714ab03f5ed46ac25713baf0ff20", - "sha256:4acc0985ddf39d1bc969a9220b51d94ed51695d455c228d8ac29fcdb25810e6e", - "sha256:5503c86916d27c2e101b7f71c2ae2cddba01a2cf55b8395b0255fd33fa4d1f1a", - "sha256:5b7bb9de00197fb4261825c15551adf7605cf14a80badf1761d61e59da347779", - "sha256:5e9ac5f66616b87d4da618a20ab0a38324dbe88d8a39b55be8964eb520021e02", - "sha256:620582db2a85b2df5f8a82ddeb52116560d7e5e6b055095f04ad828d1b0baa39", - "sha256:62cc1afda735a8d109007164714e73771b499768b9bb5afcbbee9d0ff374b43f", - "sha256:70ad9e5c6cb9b8487280a02c0ad8a51581dcbbe8484ce058477692a27c151c0a", - "sha256:72b9e656e340447f827885b8d7a15fc8c4e68d410dc2297ef6787eec0f0ea409", - "sha256:72cbcfd54df6caf85cc35264c77ede902452d6df41166010262374155947460c", - "sha256:792e5c12376594bfcb986ebf3855aa4b7c225754e9a9521298e460e92fb4a488", - "sha256:7b7017b61bbcdd7f6363aeceb881e23c46583739cb69a3ab39cb384f6ec82e5b", - "sha256:81f8d5c81e483a9442d72d182e1fb6dcb9723f289a57e8030811bac9ea3fef8d", - "sha256:82aafa8d5eb68c8463b6e9baeb4f19043bb31fefc03eb7b216b51e6a9981ae09", - "sha256:84c471a734240653a0ec91dec0996696eea227eafe72a33bd06c92697728046b", - "sha256:8c803ac3c28bbc53763e6825746f05cc407b20e4a69d0122e526a582e3b5e153", - "sha256:93ce9e955cc95959df98505e4608ad98281fff037350d8c2671c9aa86bcf10a9", - "sha256:9a3e5ddc44c14042f0844b8cf7d2cd455f6cc80fd7f5eefbe657292cf601d9ad", - "sha256:a4901622493f88b1a29bd30ec1a2f683782e57c3c16a2dbc7f2595ba01f639df", - "sha256:a5a4532a12314149d8b4e4ad8ff09dde7427731fcfa5917ff16d0291f13609df", - "sha256:b8831cb7332eda5dc89b21a7bce7ef6ad305548820595033a4b03cf3091235ed", - "sha256:b8e2f83c56e141920c39464b852de3719dfbfb6e3c99a2d8da0edf4fb33176ed", - "sha256:c70e94281588ef053ae8998039610dbd71bc509e4acbc77ab59d7d2937b10698", - "sha256:c8a17b5d948f4ceeceb66384727dde11b240736fddeda54ca740b9b8b1556b29", - "sha256:d82cdb63100ef5eedb8391732375e6d05993b765f72cb34311fab92103314649", - "sha256:d89363f02658e253dbd171f7c3716a5d340a24ee82d38aab9183f7fdf0cdca49", - "sha256:d99ec152570e4196772e7a8e4ba5320d2d27bf22fdf11743dd882936ed64305b", - "sha256:ddc4d832a0f0b4c52fff973a0d44b6c99839a9d016fe4e6a1cb8f3eea96479c2", - "sha256:e3dacecfbeec9a33e932f00c6cd7996e62f53ad46fbe677577394aaa90ee419a", - "sha256:eb9fc393f3c61f9054e1ed26e6fe912c7321af2f41ff49d3f83d05bacf22cc78" + "sha256:3586e12d874ce2f1bc875a3ffba98732ebb12e18fb6d97be482bd62b56803281", + "sha256:ee6e2963e92762923956fe5d3479b1fdc3b76c83f290aad131a2f98c3df0593e" ], - "markers": "python_version >= '3.6'", - "version": "==8.4.0" + "markers": "python_version >= '3.7'", + "version": "==9.0.0" }, "plotly": { "hashes": [ @@ -627,11 +588,11 @@ }, "requests": { "hashes": [ - "sha256:6c1246513ecd5ecd4528a0906f910e8f0f9c6b8ec72030dc9fd154dc1a6efd24", - "sha256:b8aa58f8cf793ffd8782d3d8cb19e66ef36f7aba4353eec859e74678b01b07a7" + "sha256:68d7c56fd5a8999887728ef304a6d12edc7be74f1cfa47714fc8b414525c9a61", + "sha256:f22fa1e554c9ddfd16e6e41ac79759e17be9e492b3587efa038054674760e72d" ], "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4, 3.5'", - "version": "==2.26.0" + "version": "==2.27.1" }, "scipy": { "hashes": [ @@ -715,7 +676,7 @@ "sha256:4987c65554f7a2dbf30c18fd48778ef124af6fab771a377103da0585e2336ece", "sha256:c4fdf4019605b6e5423637e01bc9fe4daef873709a7973e195ceba0a62bbc844" ], - "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4' and python_version < '4'", + "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4' and python_version < '4.0'", "version": "==1.26.7" }, "wcwidth": { @@ -734,35 +695,28 @@ }, "yfinance": { "hashes": [ - "sha256:597a3e83804726f45acceb3d56bcd16317c718cc62876234deb4c2b561e65b42" + "sha256:08d7a469fa6b58cda95c7babef2d0e146d66fe8ad16163a851624a6a4d2ca7f3", + "sha256:7cb21d432769b50591a688266aaabfcb3c371a8faf1fce6665cdbe385687d972" ], - "version": "==0.1.67" + "version": "==0.1.68" } }, "develop": { "astroid": { "hashes": [ - "sha256:5939cf55de24b92bda00345d4d0659d01b3c7dafb5055165c330bc7c568ba273", - "sha256:776ca0b748b4ad69c00bfe0fff38fa2d21c338e12c84aa9715ee0d473c422778" + "sha256:72ace9c3333e274e9248168fc4f3e300da8545af1c303bd69197027f49e2bfff", + "sha256:aa296702f1a5c3102c860de49473aaa90a7f6d221555d5cf2678940a9be32a4e" ], - "markers": "python_version ~= '3.6'", - "version": "==2.9.0" + "markers": "python_full_version >= '3.6.2'", + "version": "==2.9.2" }, "attrs": { "hashes": [ - "sha256:149e90d6d8ac20db7a955ad60cf0e6881a3f20d37096140088356da6c716b0b1", - "sha256:ef6aaac3ca6cd92904cdd0d83f629a15f18053ec84e6432106f7a4d04ae4f5fb" + "sha256:2d27e3784d7a565d36ab851fe94887c5eccd6a463168875832a1be79c82828b4", + "sha256:626ba8234211db98e869df76230a137c4c40a12d72445c45d5f5b716f076e2fd" ], "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4'", - "version": "==21.2.0" - }, - "backports.entry-points-selectable": { - "hashes": [ - "sha256:7fceed9532a7aa2bd888654a7314f864a3c16a4e710b34a58cfc0f08114c663b", - "sha256:914b21a479fde881635f7af5adc7f6e38d6b274be32269070c53b698c60d5386" - ], - "markers": "python_version >= '2.7'", - "version": "==1.1.1" + "version": "==21.4.0" }, "cfgv": { "hashes": [ @@ -852,11 +806,11 @@ }, "identify": { "hashes": [ - "sha256:a33ae873287e81651c7800ca309dc1f84679b763c9c8b30680e16fbfa82f0107", - "sha256:eba31ca80258de6bb51453084bff4a923187cd2193b9c13710f2516ab30732cc" + "sha256:67c1e66225870dce721228176637a8ef965e8dd58450bcc7592249d0dfc4da6c", + "sha256:93e8ec965e888f2212aa5c24b2b662f4832c39acb1d7196a70ea45acb626a05e" ], "markers": "python_full_version >= '3.6.1'", - "version": "==2.4.0" + "version": "==2.4.2" }, "iniconfig": { "hashes": [ @@ -1060,11 +1014,11 @@ }, "setuptools": { "hashes": [ - "sha256:a4377723c53721515f72a3dfc1bfacdcd61edfa19a4cccf82e72e4f50d9cecbd", - "sha256:ad0ea3d172404abb14d8f7bd7f54f2ccd4ed9dd00c9da0b1398862e69eb22c03" + "sha256:2932bfeb248c648dc411ea9714d5a6de7a33ef1a0db2f0fce644d8172b0479e8", + "sha256:2b62b3dbec1fe95585dadf3bd9a014c8c578624918190428c3a7994bb52ae2b8" ], "markers": "python_version >= '3.7'", - "version": "==60.1.0" + "version": "==60.3.1" }, "six": { "hashes": [ @@ -1098,11 +1052,11 @@ }, "virtualenv": { "hashes": [ - "sha256:4b02e52a624336eece99c96e3ab7111f469c24ba226a53ec474e8e787b365814", - "sha256:576d05b46eace16a9c348085f7d0dc8ef28713a2cabaa1cf0aea41e8f12c9218" + "sha256:339f16c4a86b44240ba7223d0f93a7887c3ca04b5f9c8129da7958447d079b09", + "sha256:d8458cf8d59d0ea495ad9b34c2599487f8a7772d796f9910858376d1600dd2dd" ], "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4'", - "version": "==20.10.0" + "version": "==20.13.0" }, "wrapt": { "hashes": [ diff --git a/requirements-mgm.txt b/requirements-mgm.txt index fae4813..8a4c391 100644 --- a/requirements-mgm.txt +++ b/requirements-mgm.txt @@ -6,11 +6,11 @@ # -art==5.3 +art==5.4 cached-property==1.5.2 certifi==2021.10.8 cffi==1.15.0 -charset-normalizer==2.0.9; python_version >= '3' +charset-normalizer==2.0.10; python_version >= '3' coloredlogs==15.0.1 cryptography==36.0.1 cycler==0.11.0; python_version >= '3.6' @@ -30,8 +30,8 @@ multitasking==0.0.10 numpy==1.21.5 packaging==21.3; python_version >= '3.6' pandas==1.3.5 -pfzy==0.3.3; python_version >= '3.7' and python_version < '4' -pillow==8.4.0; python_version >= '3.6' +pfzy==0.3.3; python_version >= '3.7' and python_version < '4.0' +pillow==9.0.0; python_version >= '3.7' plotly==5.5.0 prompt-toolkit==3.0.24 pycparser==2.21 @@ -42,7 +42,7 @@ python-rapidjson==1.5 pytz==2021.3 pyyaml==6.0 quantstats==0.0.47 -requests==2.26.0; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4, 3.5' +requests==2.27.1; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4, 3.5' scipy==1.7.3; python_version < '3.11' and python_version >= '3.7' seaborn==0.11.2; python_version >= '3.6' six==1.16.0 @@ -50,7 +50,7 @@ smmap==5.0.0 tabulate==0.8.9 tenacity==8.0.1 termcolor==1.1.0 -urllib3==1.26.7; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4' and python_version < '4' +urllib3==1.26.7; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4' and python_version < '4.0' wcwidth==0.2.5 yaspin==2.1.0 -yfinance==0.1.67 +yfinance==0.1.68