{"id":25228036,"url":"https://github.com/nersent/qpace","last_synced_at":"2026-03-10T06:33:18.902Z","repository":{"id":275775979,"uuid":"847431286","full_name":"nersent/qpace","owner":"nersent","description":"📊 The Quant SDK for Python and Javascript. Written in Rust.","archived":false,"fork":false,"pushed_at":"2025-11-24T13:11:13.000Z","size":28368,"stargazers_count":23,"open_issues_count":14,"forks_count":6,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-02-20T19:43:55.184Z","etag":null,"topics":["backtest","finance","indicator","javascript","pandas-ta","pinescript","python","quant","ta","ta-lib","technical-analysis","trading","tradingview","vectorized"],"latest_commit_sha":null,"homepage":"https://qpace.dev","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nersent.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-08-25T19:55:37.000Z","updated_at":"2025-12-24T12:58:52.000Z","dependencies_parsed_at":"2025-07-02T08:23:23.914Z","dependency_job_id":"1419d613-6d5a-4ebc-b218-24c2fd91297f","html_url":"https://github.com/nersent/qpace","commit_stats":null,"previous_names":["nersent/qpace"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/nersent/qpace","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nersent%2Fqpace","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nersent%2Fqpace/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nersent%2Fqpace/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nersent%2Fqpace/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nersent","download_url":"https://codeload.github.com/nersent/qpace/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nersent%2Fqpace/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30326891,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-10T05:25:20.737Z","status":"ssl_error","status_checked_at":"2026-03-10T05:25:17.430Z","response_time":106,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["backtest","finance","indicator","javascript","pandas-ta","pinescript","python","quant","ta","ta-lib","technical-analysis","trading","tradingview","vectorized"],"created_at":"2025-02-11T09:19:27.174Z","updated_at":"2026-03-10T06:33:18.868Z","avatar_url":"https://github.com/nersent.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n  \u003cimg src=\"static/logo.svg\" width=\"184\"\u003e\n\n\u003cbr /\u003e\n\n\u003ch1\u003e\u003cb\u003ePACE\u003c/b\u003e\u003c/h1\u003e\n\n\u003ca href=\"https://nersent.com\"\u003e\u003cimg src=\"https://cdn.nersent.com/public/badges/made_by_nersent.svg\" alt=\"Made by Nersent\" /\u003e\u003c/a\u003e\n\u003ca href=\"https://nersent.com\"\u003e\u003cimg src=\"https://cdn.nersent.com/public/badges/stage_in_dev.svg\" alt=\"In development\" /\u003e\u003c/a\u003e\n\u003ca href=\"https://discord.gg/P7Vn4VX\"\u003e\u003cimg src=\"https://cdn.nersent.com/public/badges/discord.svg\" alt=\"Discord\" /\u003e\u003c/a\u003e\n\n\u003c/div\u003e\n\n**PACE**: Technical analysis library written in Rust, designed to be compatible with PineScript.\n\nFast, zero runtime cost and memory-safe, but with very high learning curve.\n\nThe core feature of Pace is incremental architecture, which allows O(1) constant-time updates of indicators, making it ideal for time-sensitive low-frequency live trading.\n\n\u003e Note: This library is in an early development stage. Expect breaking changes.\n\n## PineScript\n\nAll Pace components and indicators have been tested against PineScript, ensuring the same results and easy migration.\n\nSee [migration from PineScript](/docs/pinescript_migration.md)\n\n## Features\n\n- Results of TA functions same as in PineScript\n\n- Strategy metrics from TradingView\n\n  ![tradingview_strategy_overview](/static/strategy_overview_tradingview.png)\n\n  ![pace_strategy_overview](/static/strategy_overview_pace.png)\n\n  ![pace_strategy_performance](/static/strategy_performance_pace.png)\n\n- Simple testing utilities\n\n- Support for [Polars](https://github.com/pola-rs/polars) library\n\n- Risk indicators\n\n  - Sharpe ratio\n  - Sortino ratio\n  - Omega ratio\n  - Max Drawdown\n  - Max Run-up\n\n- Default technical indicators and strategies from TradingView\n\n  - Aroon\n  - Average True Range\n  - Awesome Oscillator\n  - Balance of Power\n  - Bollinger Bands %B\n  - Bollinger Bands Width\n  - Chaikin Money Flow\n  - Chande Kroll Stop\n  - Choppiness Index\n  - Commodity Channel Index\n  - Connors Relative Strength Index\n  - Coppock Curve\n  - Cross\n  - Deviation\n  - Directional Movement Index\n  - Donchian Channels\n  - Exponential Moving Average\n  - Highest Bars\n  - Lowest Bars\n  - Lowest Bars\n  - MACD\n  - Percent Rank\n  - Price Oscillator\n  - Rate of Change\n  - Relative Strength Index\n  - Relative Vigor Index\n  - Relative Volatility Index\n  - Simple Moving Averageq\n  - Standard Deviation\n  - Stoch Relative Strength Index\n  - Stochastic\n  - Sum\n  - Symmetrically Weighted Moving Average\n  - True Range\n  - Ultimate Oscillator\n  - Volume Oscillator\n  - Vortex Indicator\n  - Weighted Moving Average\n  - Williams %R\n\n## Roadmap\n\n- [ ] Python bindings\n- [ ] Improve performance\n- [ ] Release stable version\n- [ ] Additionaly support vectorized calculations\n- [ ] Implement Pace -\u003e PineScript strategy exporter\n- [ ] Implement more TradingView strategy tab metrics\n- [ ] Implement exact TradingView sharpe/sortino\n- [ ] Basic chart plotting capabilities\n- [ ] Support custom fill order size\n- [ ] Implement more risk metrics\n- [ ] Parameter optimization\n- [ ] Add more benchmarks\n- [ ] [Probabilistic Sharpe Ratio](https://quantdare.com/probabilistic-sharpe-ratio/)\n\n## Getting Started\n\nYou can use already configured [boilerplate project](https://github.com/nersent/pace-starter) with an example indicator and strategy.\n\n## Examples\n\nSee already implemented indicators and strategies [here](pace/src/content).\n\n## Installation\n\n```bash\ncargo add nersent_pace\ncargo add polars\n```\n\n## Documentation\n\nVisit [docs](/docs/readme.md) to view the full documentation.\n\n## Motivation\n\n1. State-of-the art\n\n   One of the SOTA technical analysis libraries is the industry golden standard [talib](https://ta-lib.org/), which is written in C and is tailored towards vector calculations. The problem with talib is that it's old (started in 1999) and unmaintained. Adding new features without sacrificing the performance is a great challenge and requires C expertise.\n\n2. PineScript\n\n   No TA lib tries to be compatible with PineScript, which is the most popular way of creating trading strategies. This is crucial as the majority of trading strategies are written in PineScript. Users are limited by TradingView capabilities as there is no way to efficiently optimize strategy parameters.\n\n3. Architecture\n\n   There are different ways of calculating technical analysis indicators such as:\n\n   a. Plain loop\n\n   For each indicator, a loop is performed over the entire dataset. This is the most straightforward way of calculating indicators. It is easy to implement, but it is very slow and memory inefficient.\n\n   b. Vectorization\n\n   For each indicator, a loop is performed over the entire dataset, but the loop is vectorized, meaning CPU instructions are executed in parallel, leading to a significant performance boost. talib is an example of this approach. Vectorization is the best for batch processing, but it is hard to implement and maintain, as any new feature requires to be vectorized as well, which is not always possible. Also, if you want to compute multiple indicators, you have to perform multiple loops.\n\n   c. GPU\n\n   Similar to vectorization, but the calculations are performed on GPU, which is even faster than CPU. It is even harder to implement and maintain than vectorization. Keeping in mind, that there are tools and libraries that don't require you to write custom GPU kernels such as cupy/PyTorch, GPU TA still comes with it's own set of problems. It requires you to have GPU supporting software like CUDA and VRAM large enough. Also copying data from CPU to GPU and back is a performance bottleneck, which may be problematic sometimes.\n\n   d. Incremental\n\n   There is only one main loop, which iterates over the entire dataset. For every loop tick, each indicator is updated in constant O(1) time. This is the best approach if you care about computation delay, as it is fast and memory efficient. In the most cases, it's the easiest way to implement new features. Also, PineScript is incremental by design, so it's easy to port PineScript code to similar architecture.\n\n   Incremental architecture, has it's drawback - it is slower than vectorization, but not that much. For **1M** bars and `SMA(14)` the difference between Pace and talib is **2ms**.\n\n   See [benchmarks](#benchmarks) section below for more details.\n\n## Benchmarks\n\nWe performed multiple benchmarks for popular indicators across different technical analysis libraries:\n\n- [TA-Lib](https://github.com/TA-Lib/ta-lib-python)\n- [Pandas TA](https://github.com/twopirllc/pandas-ta)\n- [TALIpp](https://github.com/nardew/talipp)\n- [FinTA](https://github.com/peerchemist/finta)\n- [spectre](https://github.com/Heerozh/spectre)\n- [TA](https://github.com/bukosabino/ta)\n- \u003chttps://tulipindicators.org/\u003e\n- \u003chttps://kernc.github.io/backtesting.py/\u003e\n\n### Details\n\n- AMD Ryzen 5 3600\n- 16GB RAM\n- RTX 2060 Super 8GB VRAM\n- Windows 11\n- Rustc 1.67.0\n- Python 3.9\n- Pace benchmark uses [mimalloc allocator](https://github.com/purpleprotocol/mimalloc_rust) and has been compiled with [cargo pgo](https://github.com/Kobzol/cargo-pgo)\n\n### Interpretation\n\n- talib is the fastest library across all benchmarks, thanks to vectorization\n- Pace is the second fastest library, despite not being designed towards vector calculations\n- On smaller datasets, the gap between talib and Pace is not significant\n- Pandas and Numpy have both their own runtime overhead\n- It's not worth to do technical analysis on GPU for smaller datasets\n\n### Mean time (ms)\n\n\u003e Note: The less the better\n\n**Linear scale**:\n\n![1k_bars_log10](/static/benchmarks/1000_mean_time.png)\n\n![1m_bars_log10](/static/benchmarks/1000000_mean_time.png)\n\n**Logarithmic scale**:\n\n![1k_bars_log10](/static/benchmarks/1000_mean_time_log10.png)\n\n![1m_bars_log10](/static/benchmarks/1000000_mean_time_log10.png)\n\n### Mean time difference compared to Pace (ms)\n\n\u003e Note: The more the better\n\n**Linear scale**:\n\n![1k_bars_log10](/static/benchmarks/1000_time_diff.png)\n\n![1m_bars_log10](/static/benchmarks/1000000_time_diff.png)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnersent%2Fqpace","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnersent%2Fqpace","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnersent%2Fqpace/lists"}