Contributing to polars-anta¶
We welcome contributions from quantitative researchers, Python developers, and the open-source community!
Development Setup¶
-
Clone the repository:
-
Create a virtual environment:
-
Install development dependencies:
Guidelines for New Indicators¶
When adding a new indicator:
- Pure Expression First: Implement using
pl.Exprwherever possible. Avoid Python loops over rows. - Support String or Expr: Use
parse_exprfrompolars_anta.coreso users can pass either column names ("close") or existing expressions (pl.col("close")). - Register on Dual Namespaces: Indicators added to
TechnicalAnalysisExprinpolars_anta/namespace.pyare automatically available under both.antaand.ta. - Multi-Asset Compatibility: Ensure the indicator executes without errors inside
.over("ticker"). - Structured Outputs: If the indicator produces multiple values (like bands or oscillators with signals), return a typed
pl.Struct. - Comprehensive Tests: Add test cases to the appropriate file in
tests/. Verify test coverage remains above 90%: - Code Quality: Ensure linter and formatter pass without errors:
Building Documentation Locally¶
Preview the documentation website with hot reload:
Build the static HTML site: