Skip to main content

Send backtest results for jesse trade to discord

Project description

Jesse discord reporting library

Post the results of backtests to a discord channel using a webhook.

example

The library is published on pypi here: https://pypi.org/project/JesseReportDiscord/

So that to install you can run from a command line in your operating system:

pip install JesseReportDiscord

Update:

pip install JesseReportDiscord --upgrade

Once it's installed you just add the following lines to your Jesse strategy:

import JesseReportDiscord

	def terminate(self):
		JesseReportDiscord.sendJesseReportToDiscord('https://discordapp.com/api/webhooks/your/generated/webhook')

Where https://discordapp.com/api/webhooks/your/generated/webhook is the url of the webhook you generate in the discord server's channel settings.

It publishes everything that you get after enabling all the options for your backtest (except debug logs) and a little more:

  • strategy name,
  • routes,
  • hyperparameters,
  • git branch,
  • git commit SHA,
  • json report,
  • csv report (dates updated to human readable),
  • legacy chart,
  • quantstats report,
  • tradingview pine editor script
  • summary metrics

Note that if the attachment files are too large for discord (8MB) they will be zipped into a zip archive. In case they are still too large the archive will be broken up into several uploads with the index _n for each file where n is incrementing. To recombine these for example in wondows download all the parts and then run:

Downloads> COPY /B cb611e9b-458d-4450-a6c4-bfc19b194559_1.tvreport.html.zip + cb611e9b-458d-4450-a6c4-bfc19b194559_2.tvreport.html.zip test.zip

The library will break the upload up into several consecutive posts in case it can't all fit into one.

Users can add any number of additonal reports with a second argument passed as a map for example:

JesseReportDiscord.sendJesseReportToDiscord('http://mydiscordgeneratedwebhook', {'tvreport.html':'relative/path/to/custom/report.html'})

Don't use the in built indexes which are 'json', 'html', 'tradingview', 'csv' unless you want to overwrite those.

Generation of data is controlled via the map config eg:

myConfig = {'generate_json':True, generate_tradingview:False, generate_csv:False, generate_chart_overview:False, generate_quantstats_report:False, generate_version:False, generate_hyper_parameters:False, generate_portfolio_metrics:False, generate_study_name:False}
JesseReportDiscord.sendJesseReportToDiscord('http://mydiscordgeneratedwebhook',config=myConfig)

or for this example more briefly:

myConfig = {'generate_json':True, 'generate_none':True}
JesseReportDiscord.sendJesseReportToDiscord('http://mydiscordgeneratedwebhook',config=myConfig)

Custom text can be posted with customMessage, so to only send a custom message to the channel:

JesseReportDiscord.sendJesseReportToDiscord('http://mydiscordgeneratedwebhook', customMessage='hello', generation_config={'none':True} )

CHANGELOG 1.0.11, remove quantstats report for versions 0.39 and above due to new candle management changes in jesse 0.39.+ 1.1.0, support live trading 1.2.0, added config to control which info is posted, and customMessage. 1.2.1, added timeouts to discord posts, and catching any exceptions to prevent disruptions to trading. Noted to be caused by discord rate limits.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

JesseReportDiscord-1.2.1.tar.gz (10.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

JesseReportDiscord-1.2.1-py3-none-any.whl (6.4 kB view details)

Uploaded Python 3

File details

Details for the file JesseReportDiscord-1.2.1.tar.gz.

File metadata

  • Download URL: JesseReportDiscord-1.2.1.tar.gz
  • Upload date:
  • Size: 10.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.14

File hashes

Hashes for JesseReportDiscord-1.2.1.tar.gz
Algorithm Hash digest
SHA256 2f300b1e71efc0ec992ad617a616a752df309941d2297cda008ddce1f4ee5393
MD5 39be82ab44b882c7d57db4d12830a0f2
BLAKE2b-256 999bd8baeef5faad0acab0864652e1eab1f7dc21bc75a4dc0ebdeb5ec0c815a6

See more details on using hashes here.

File details

Details for the file JesseReportDiscord-1.2.1-py3-none-any.whl.

File metadata

File hashes

Hashes for JesseReportDiscord-1.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 546eb6d144abac18de76dd2a05d3b7ab8665cdc512c6348ca476ef966bffaed1
MD5 f07f2f27733d8f5055c85ff48493986d
BLAKE2b-256 a4b1da40a4bed482be66beb32f863b271ff8355aece6a7a96f960da0ffdb6268

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page