Skip to main content

Algorizer is a framework for creating/backtesting and running trading algorythms. It is intended to work in a familiar way for those who have used Tradingview's Pinescript, from writing the scripts to visualizing them in lightweight-charts. It doesn't intend to mimic the language, but the structure should be familiar enough to you to feel comfortable.

What does it do: It connects to crypto exchanges using the CCXT library and downloads the historical data[1]. It saves it in cache and keeps updating it every time it's launched. It runs a backtest of your script on it, and then (if ordered to) it continues running it in realtime, casting webhook alerts to a webhook service (Like my own free webhook script).

[1] It does not require an API key and it will take a while to download for the first time. Note: Not all exchanges provide historical data. If it fails try another exchange.

Strategies can be multi-timeframe (minimum timeframe is 1 minute). Trades can be oneway or hedged. It takes into account the fees cost by fetching them from the exchange.

Most typical 'indicators' are already built in, and creating custom ones is relatively easy. By default all series are calculated using Numpy. Talib is used for some of them when it's present in the system. Talib provides a marginal speed increase..

** Quick Start **

  • Install the algorizer module python -m pip install algorizer

  • Create an empty python script and copy/paste the contents of the script template

  • Run it to verify everything is correct. Start writing your strategy.


Warning: In the v0.1.0 release there's a bug in the name of a key in the info dictionary passed to broker_event. The key is 'source ' (with a trailing space) instead of 'source'. The trailing space is removed in the repository and will be removed in the next release. You should add the trailing space to the template if you are working with v0.1.0. The bug is only triggered when a broker_event happens, so only when an order is issued in real time execution.


I'm slowly adding documentation in the DOC file: https://github.com/germangar/algorizer/blob/main/DOC.md
I also extensively commented the file example_misc.py: https://github.com/germangar/algorizer/blob/main/example_misc.py




The project is still a work in progress so you'll most likely find a few nuissances. However, fetching the historical candles, fetching the real time price updates, running the backtest and running your strategy realtime is reliable. Backtest and realtime execution match properly. There are no lookahead nor repainting issues.

Plotting capabilities: As of today it's capable of plots, histograms, lines (point to point) and markers (labels), as it's capable of creating subpanels and targetting these to them. Horizontal lines, boxes and tables remain in the to do list, and will probably stay there for quite some time.


image

Note on dependencies: Pandas is only used to load the data into the chart. Lightweight-chart requires it. It isn't used anywhere else. However, even if algorizer doesn't directly use it, CCXT does.

Future plans (aka to do list)

  • Add more indicators and drawing options.
  • Add inputs with ranges and steps for future batch-backtesting
  • Direct broker connection with the exchange for the strategy code to confirm operations
  • Low priority: Make the chart load bars in modular blocks so it doesn't take so long on high bar count (pandas is slow af).

. I will not make much work on the chart window UI. I'll make it able to change timeframe if the lightweight-charts gods allow it and that's it. But I'll gladly accept contributions on it. The script and the chart are in a client/server configuration so even whole new chart replacements other than lightweight-charts could be added
. I'll also be happy to accept contributions in making it work with stocks. Only needs a fetcher file and a way to get the realtime price updates, but I have no idea where one can obtain that information in the world of stocks.

Metadata

Release files for algorizer 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for algorizer 0.1.1
File Size Uploaded Provenance Actions
algorizer-0.1.1.tar.gz 97.8 kB Without provenance Details for algorizer-0.1.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for algorizer 0.1.1
File Interpreter ABI Platform Actions
algorizer-0.1.1-py3-none-any.whl Python 3 none any Details for algorizer-0.1.1-py3-none-any.whl

Total release size: 181.9 kB

Release files / algorizer-0.1.1.tar.gz

Download URL algorizer-0.1.1.tar.gz
Size 97.8 kB
Tags Source
SHA-256 checksum
How to use checksums
e980e2b894046f4f8417a2612f77cbd90473b6829f22ef590339aa1a146d96a2
BLAKE2b-256 checksum
How to use checksums
a9568574f4bf8b681fb8b95811a6f89fcee05bd511dd636141121cc274f6f6ad
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.5

Release files / algorizer-0.1.1-py3-none-any.whl

Download URL algorizer-0.1.1-py3-none-any.whl
Size 84.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
059626ea760b8bdef8f1e0cb70124cda77fa2dc17ae43accf3da69ec504a58c4
BLAKE2b-256 checksum
How to use checksums
4a37c423a4c5762f51e23021fb94db7496647806bc3127bddf847782ed31bd25
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.5

Security for algorizer 0.1.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page