centaur_technical_indicators 1.2.0__tar.gz → 1.2.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- centaur_technical_indicators-1.2.2/.github/pull_request_template.md +18 -0
- {centaur_technical_indicators-1.2.0 → centaur_technical_indicators-1.2.2}/AGENTS.md +44 -1
- {centaur_technical_indicators-1.2.0 → centaur_technical_indicators-1.2.2}/CHANGELOG.md +34 -0
- {centaur_technical_indicators-1.2.0 → centaur_technical_indicators-1.2.2}/CONTRIBUTING.md +23 -0
- {centaur_technical_indicators-1.2.0 → centaur_technical_indicators-1.2.2}/Cargo.lock +4 -4
- {centaur_technical_indicators-1.2.0 → centaur_technical_indicators-1.2.2}/Cargo.toml +2 -2
- {centaur_technical_indicators-1.2.0 → centaur_technical_indicators-1.2.2}/PKG-INFO +1 -1
- centaur_technical_indicators-1.2.2/ai-policy.yaml +50 -0
- centaur_technical_indicators-1.2.2/docs/REPO_MAP.md +72 -0
- {centaur_technical_indicators-1.2.0 → centaur_technical_indicators-1.2.2}/src/trend_indicators.rs +0 -2
- {centaur_technical_indicators-1.2.0 → centaur_technical_indicators-1.2.2}/tests/test_momentum_indicators.py +24 -6
- centaur_technical_indicators-1.2.0/.github/copilot-instructions.md +0 -185
- {centaur_technical_indicators-1.2.0 → centaur_technical_indicators-1.2.2}/.github/CODEOWNERS +0 -0
- {centaur_technical_indicators-1.2.0 → centaur_technical_indicators-1.2.2}/.github/ISSUE_TEMPLATE/bug_report.md +0 -0
- {centaur_technical_indicators-1.2.0 → centaur_technical_indicators-1.2.2}/.github/ISSUE_TEMPLATE/feature_request.md +0 -0
- {centaur_technical_indicators-1.2.0 → centaur_technical_indicators-1.2.2}/.github/workflows/CI.yml +0 -0
- {centaur_technical_indicators-1.2.0 → centaur_technical_indicators-1.2.2}/.github/workflows/python-package.yml +0 -0
- {centaur_technical_indicators-1.2.0 → centaur_technical_indicators-1.2.2}/.gitignore +0 -0
- {centaur_technical_indicators-1.2.0 → centaur_technical_indicators-1.2.2}/CODE_OF_CONDUCT.md +0 -0
- {centaur_technical_indicators-1.2.0 → centaur_technical_indicators-1.2.2}/LICENSE-MIT +0 -0
- {centaur_technical_indicators-1.2.0 → centaur_technical_indicators-1.2.2}/README.md +0 -0
- {centaur_technical_indicators-1.2.0 → centaur_technical_indicators-1.2.2}/SECURITY.md +0 -0
- {centaur_technical_indicators-1.2.0 → centaur_technical_indicators-1.2.2}/assets/pytechnicalindicators_banner.png +0 -0
- {centaur_technical_indicators-1.2.0 → centaur_technical_indicators-1.2.2}/pyproject.toml +0 -0
- {centaur_technical_indicators-1.2.0 → centaur_technical_indicators-1.2.2}/requirements.txt +0 -0
- {centaur_technical_indicators-1.2.0 → centaur_technical_indicators-1.2.2}/src/candle_indicators.rs +0 -0
- {centaur_technical_indicators-1.2.0 → centaur_technical_indicators-1.2.2}/src/chart_trends.rs +0 -0
- {centaur_technical_indicators-1.2.0 → centaur_technical_indicators-1.2.2}/src/correlation_indicators.rs +0 -0
- {centaur_technical_indicators-1.2.0 → centaur_technical_indicators-1.2.2}/src/lib.rs +0 -0
- {centaur_technical_indicators-1.2.0 → centaur_technical_indicators-1.2.2}/src/momentum_indicators.rs +0 -0
- {centaur_technical_indicators-1.2.0 → centaur_technical_indicators-1.2.2}/src/moving_average.rs +0 -0
- {centaur_technical_indicators-1.2.0 → centaur_technical_indicators-1.2.2}/src/other_indicators.rs +0 -0
- {centaur_technical_indicators-1.2.0 → centaur_technical_indicators-1.2.2}/src/strength_indicators.rs +0 -0
- {centaur_technical_indicators-1.2.0 → centaur_technical_indicators-1.2.2}/src/volatility_indicators.rs +0 -0
- {centaur_technical_indicators-1.2.0 → centaur_technical_indicators-1.2.2}/test_requirements.txt +0 -0
- {centaur_technical_indicators-1.2.0 → centaur_technical_indicators-1.2.2}/tests/test_candle_indicators.py +0 -0
- {centaur_technical_indicators-1.2.0 → centaur_technical_indicators-1.2.2}/tests/test_chart_trends.py +0 -0
- {centaur_technical_indicators-1.2.0 → centaur_technical_indicators-1.2.2}/tests/test_correlation_indicators.py +0 -0
- {centaur_technical_indicators-1.2.0 → centaur_technical_indicators-1.2.2}/tests/test_moving_average.py +0 -0
- {centaur_technical_indicators-1.2.0 → centaur_technical_indicators-1.2.2}/tests/test_other_indicators.py +0 -0
- {centaur_technical_indicators-1.2.0 → centaur_technical_indicators-1.2.2}/tests/test_strength_indicators.py +0 -0
- {centaur_technical_indicators-1.2.0 → centaur_technical_indicators-1.2.2}/tests/test_trend_indicators.py +0 -0
- {centaur_technical_indicators-1.2.0 → centaur_technical_indicators-1.2.2}/tests/test_volatility_indicators.py +0 -0
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
## Summary
|
|
2
|
+
- What changed?
|
|
3
|
+
- Why was this change needed?
|
|
4
|
+
|
|
5
|
+
## Compatibility
|
|
6
|
+
- User-facing Python API impact:
|
|
7
|
+
- Migration notes (if any):
|
|
8
|
+
|
|
9
|
+
## Validation
|
|
10
|
+
- [ ] `maturin develop` (bindings compile cleanly)
|
|
11
|
+
- [ ] `python -m pytest` (all tests pass)
|
|
12
|
+
- [ ] `cargo fmt --check` (no formatting diffs)
|
|
13
|
+
|
|
14
|
+
Command output summary:
|
|
15
|
+
|
|
16
|
+
## Changelog
|
|
17
|
+
- [ ] `CHANGELOG.md` updated for user-facing changes
|
|
18
|
+
- Entry summary:
|
|
@@ -9,6 +9,10 @@ Guidance for coding agents working in this repository.
|
|
|
9
9
|
- `src/` → Rust implementation + Python bindings
|
|
10
10
|
- `tests/` → Python-facing smoke/behavior tests for bindings
|
|
11
11
|
|
|
12
|
+
## Docs to review before coding
|
|
13
|
+
- `docs/REPO_MAP.md`
|
|
14
|
+
- `CONTRIBUTING.md`
|
|
15
|
+
|
|
12
16
|
## Recommended workflow
|
|
13
17
|
1. **Set up an isolated environment**
|
|
14
18
|
```bash
|
|
@@ -42,6 +46,30 @@ Guidance for coding agents working in this repository.
|
|
|
42
46
|
- Keep naming and argument conventions consistent with neighboring functions.
|
|
43
47
|
- Use clear, user-facing error messages for invalid inputs.
|
|
44
48
|
|
|
49
|
+
## Change scope discipline
|
|
50
|
+
- Keep changes minimal and focused on the requested task.
|
|
51
|
+
- Do not include opportunistic refactors unless explicitly requested.
|
|
52
|
+
- If you identify unrelated issues, note them separately instead of bundling them into the same change.
|
|
53
|
+
- Preserve existing file organization and naming conventions unless the task requires a structural change.
|
|
54
|
+
|
|
55
|
+
## Backward compatibility rules
|
|
56
|
+
When changing public Python APIs, preserve compatibility unless the task explicitly allows a breaking change:
|
|
57
|
+
|
|
58
|
+
1. Do not silently change indicator semantics, output ordering, or warmup behavior.
|
|
59
|
+
2. Do not remove or rename public functions, types, enums, or parameters without explicit approval.
|
|
60
|
+
3. If behavior changes are required, document them in docstrings and `CHANGELOG.md` with clear migration notes.
|
|
61
|
+
|
|
62
|
+
## Pre-PR quality gates (must pass)
|
|
63
|
+
Run these before opening a PR:
|
|
64
|
+
|
|
65
|
+
1. `maturin develop` (bindings compile cleanly)
|
|
66
|
+
2. `python -m pytest` (all tests pass)
|
|
67
|
+
3. `cargo fmt --check` (no formatting diffs)
|
|
68
|
+
|
|
69
|
+
## CI implementation policy
|
|
70
|
+
- Prefer native Python/maturin/cargo commands in workflows.
|
|
71
|
+
- Do not introduce third-party GitHub Actions unless explicitly approved by maintainers.
|
|
72
|
+
|
|
45
73
|
## Validation expectations before finishing
|
|
46
74
|
- Rebuild bindings after Rust changes: `maturin develop`.
|
|
47
75
|
- Run relevant tests (ideally full `python -m pytest`).
|
|
@@ -54,8 +82,22 @@ Guidance for coding agents working in this repository.
|
|
|
54
82
|
- [ ] Documentation/changelog updated when needed.
|
|
55
83
|
- [ ] Commit message clearly describes the change.
|
|
56
84
|
|
|
85
|
+
## PR expectations for agents
|
|
86
|
+
- Keep PRs focused and minimal.
|
|
87
|
+
- Summarize what the agent changed and what was manually verified.
|
|
88
|
+
- Include command output summary for the required quality gates.
|
|
89
|
+
- Explicitly note the `CHANGELOG.md` entry.
|
|
90
|
+
|
|
91
|
+
### Required PR summary format
|
|
92
|
+
Use this structure in PR descriptions/comments:
|
|
93
|
+
|
|
94
|
+
1. `Summary`: what changed and why.
|
|
95
|
+
2. `Compatibility`: any user-facing behavior/API impact.
|
|
96
|
+
3. `Validation`: results summary for `maturin develop`, `pytest`, and `cargo fmt`.
|
|
97
|
+
4. `Changelog`: exact `CHANGELOG.md` entry added/updated.
|
|
98
|
+
|
|
57
99
|
## Repository expectations
|
|
58
|
-
- This is a public Rust library. Prioritize correctness, determinism, and backward compatibility.
|
|
100
|
+
- This is a public Python/Rust library. Prioritize correctness, determinism, and backward compatibility.
|
|
59
101
|
- Prefer minimal, focused diffs over broad refactors.
|
|
60
102
|
- Do not add new dependencies unless explicitly requested.
|
|
61
103
|
- Treat public APIs, documented behavior, and examples as stability-sensitive.
|
|
@@ -69,3 +111,4 @@ Guidance for coding agents working in this repository.
|
|
|
69
111
|
## Change boundaries
|
|
70
112
|
- Do not modify CI, licensing, security, or contributor-governance files unless explicitly requested.
|
|
71
113
|
- Keep unrelated formatting churn to a minimum.
|
|
114
|
+
|
|
@@ -6,6 +6,40 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
|
6
6
|
|
|
7
7
|
---
|
|
8
8
|
|
|
9
|
+
## [Unreleased]
|
|
10
|
+
|
|
11
|
+
## [1.2.2] - 2026-04-04
|
|
12
|
+
|
|
13
|
+
### Fixed
|
|
14
|
+
- Inherited fix for `relative_strength_index` (single and bulk) producing incorrect values via upstream crate update. The internal `previous_gains_loss` helper was only collecting non-zero gains/losses, discarding zero entries and causing misaligned averages.
|
|
15
|
+
|
|
16
|
+
### Changed
|
|
17
|
+
- Updated `centaur_technical_indicators` Rust crate dependency from `1.2.1` to `1.2.2`
|
|
18
|
+
|
|
19
|
+
### Removed
|
|
20
|
+
- Removed `AI_FRIENDLY_ROADMAP.md`, `docs/AI_ONBOARDING.md`, and `.github/copilot-instructions.md` — redundant with `AGENTS.md`
|
|
21
|
+
- Removed dangling references to removed files from `AGENTS.md`, `docs/REPO_MAP.md`, and `ai-policy.yaml`
|
|
22
|
+
- Simplified PR template from 7 sections to 4 (`Summary`, `Compatibility`, `Validation`, `Changelog`)
|
|
23
|
+
|
|
24
|
+
---
|
|
25
|
+
|
|
26
|
+
## [1.2.1] - 2026-03-01
|
|
27
|
+
|
|
28
|
+
### Changed
|
|
29
|
+
- Updated `centaur_technical_indicators` Rust crate dependency from `1.2.0` to `1.2.1`
|
|
30
|
+
- Removed `#[allow(deprecated)]` from `volume_price_trend` binding functions (`src/trend_indicators.rs`) as the upstream crate removed the deprecation marker in `1.2.1`
|
|
31
|
+
|
|
32
|
+
### Added
|
|
33
|
+
- Added `AI_FRIENDLY_ROADMAP.md` with module API surface, contributor-workflow, and library-feature roadmap adapted for this Python binding repository
|
|
34
|
+
- Added `docs/AI_ONBOARDING.md` as canonical start-here onboarding flow for coding agents
|
|
35
|
+
- Added `docs/REPO_MAP.md` with a quick repository map, extension points, and "if changing X, also check Y" guidance
|
|
36
|
+
- Added machine-readable repository policy file `ai-policy.yaml` for required checks, change obligations, and PR section requirements
|
|
37
|
+
- Added default pull request template at `.github/pull_request_template.md` with required sections (`Summary`, `Scope`, `Compatibility`, `Validation`, `Changelog`)
|
|
38
|
+
- Expanded `AGENTS.md` with change-scope discipline, backward compatibility rules, pre-PR quality gates, CI implementation policy, and required PR summary format
|
|
39
|
+
- Updated `CONTRIBUTING.md` with local quality gates and AI-assisted contribution checklist
|
|
40
|
+
|
|
41
|
+
---
|
|
42
|
+
|
|
9
43
|
## [1.2.0] - 2026-02-26
|
|
10
44
|
|
|
11
45
|
### Changed
|
|
@@ -51,5 +51,28 @@ See [open issues](https://github.com/ChironMind/CentaurTechnicalIndicators-Pytho
|
|
|
51
51
|
|
|
52
52
|
---
|
|
53
53
|
|
|
54
|
+
## 🔒 Local quality gates
|
|
55
|
+
|
|
56
|
+
Run these before opening a PR:
|
|
57
|
+
|
|
58
|
+
1. `maturin develop` — bindings compile cleanly
|
|
59
|
+
2. `python -m pytest` — all tests pass
|
|
60
|
+
3. `cargo fmt --check` — no formatting diffs
|
|
61
|
+
|
|
62
|
+
---
|
|
63
|
+
|
|
64
|
+
## 🤖 AI-assisted contribution checklist
|
|
65
|
+
|
|
66
|
+
If you used an AI agent to contribute:
|
|
67
|
+
|
|
68
|
+
- [ ] Reviewed all AI-generated changes for correctness
|
|
69
|
+
- [ ] Confirmed the scope is minimal and matches the task
|
|
70
|
+
- [ ] Verified `maturin develop` builds successfully
|
|
71
|
+
- [ ] Verified `python -m pytest` passes
|
|
72
|
+
- [ ] Updated `CHANGELOG.md` with a user-facing entry
|
|
73
|
+
- [ ] Disclosed AI assistance in the PR description
|
|
74
|
+
|
|
75
|
+
---
|
|
76
|
+
|
|
54
77
|
Thanks again for your interest and contributions!
|
|
55
78
|
|
|
@@ -10,17 +10,17 @@ checksum = "c08606f8c3cbf4ce6ec8e28fb0014a2c086708fe954eaa885384a6165172e7e8"
|
|
|
10
10
|
|
|
11
11
|
[[package]]
|
|
12
12
|
name = "centaur_technical_indicators"
|
|
13
|
-
version = "1.2.
|
|
13
|
+
version = "1.2.2"
|
|
14
14
|
dependencies = [
|
|
15
|
-
"centaur_technical_indicators 1.2.
|
|
15
|
+
"centaur_technical_indicators 1.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
|
16
16
|
"pyo3",
|
|
17
17
|
]
|
|
18
18
|
|
|
19
19
|
[[package]]
|
|
20
20
|
name = "centaur_technical_indicators"
|
|
21
|
-
version = "1.2.
|
|
21
|
+
version = "1.2.2"
|
|
22
22
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
23
|
-
checksum = "
|
|
23
|
+
checksum = "24ae4cb5750fab3c9d2ae9be158158df08bb4b052c6e5c398885be57e0590be9"
|
|
24
24
|
|
|
25
25
|
[[package]]
|
|
26
26
|
name = "heck"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[package]
|
|
2
2
|
name = "centaur_technical_indicators"
|
|
3
|
-
version = "1.2.
|
|
3
|
+
version = "1.2.2"
|
|
4
4
|
edition = "2021"
|
|
5
5
|
readme = "README.md"
|
|
6
6
|
|
|
@@ -11,4 +11,4 @@ crate-type = ["cdylib"]
|
|
|
11
11
|
|
|
12
12
|
[dependencies]
|
|
13
13
|
pyo3 = "0.25.0"
|
|
14
|
-
centaur_technical_indicators = "1.2.
|
|
14
|
+
centaur_technical_indicators = "1.2.2"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: centaur_technical_indicators
|
|
3
|
-
Version: 1.2.
|
|
3
|
+
Version: 1.2.2
|
|
4
4
|
Classifier: Development Status :: 5 - Production/Stable
|
|
5
5
|
Classifier: Intended Audience :: Financial and Insurance Industry
|
|
6
6
|
Classifier: Topic :: Software Development :: Libraries
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
version: 1
|
|
2
|
+
repository: CentaurTechnicalIndicators-Python
|
|
3
|
+
|
|
4
|
+
required_checks:
|
|
5
|
+
local_commands:
|
|
6
|
+
- maturin develop
|
|
7
|
+
- python -m pytest
|
|
8
|
+
- cargo fmt --check
|
|
9
|
+
benchmark:
|
|
10
|
+
required_for_paths:
|
|
11
|
+
- src/candle_indicators.rs
|
|
12
|
+
- src/chart_trends.rs
|
|
13
|
+
- src/correlation_indicators.rs
|
|
14
|
+
- src/momentum_indicators.rs
|
|
15
|
+
- src/moving_average.rs
|
|
16
|
+
- src/other_indicators.rs
|
|
17
|
+
- src/strength_indicators.rs
|
|
18
|
+
- src/trend_indicators.rs
|
|
19
|
+
- src/volatility_indicators.rs
|
|
20
|
+
companion_repo: https://github.com/ChironMind/CentaurTechnicalIndicators-benchmarks
|
|
21
|
+
|
|
22
|
+
change_requirements:
|
|
23
|
+
user_facing_change_requires:
|
|
24
|
+
- CHANGELOG.md
|
|
25
|
+
public_api_change_requires:
|
|
26
|
+
- Rust docstring updates for changed/new public binding functions
|
|
27
|
+
- tests in matching tests/ module
|
|
28
|
+
- PR Compatibility section summarizing API impact
|
|
29
|
+
|
|
30
|
+
coding_rules:
|
|
31
|
+
api_pattern:
|
|
32
|
+
instruction: Preserve the bulk/single function variant pattern for all indicators.
|
|
33
|
+
errors:
|
|
34
|
+
required_error_type: PyValueError
|
|
35
|
+
instruction: Surface all errors to Python as PyValueError with user-meaningful messages.
|
|
36
|
+
compatibility:
|
|
37
|
+
preserve_public_api_unless_explicit_breaking_approval: true
|
|
38
|
+
|
|
39
|
+
pr_report:
|
|
40
|
+
required_sections:
|
|
41
|
+
- Summary
|
|
42
|
+
- Compatibility
|
|
43
|
+
- Validation
|
|
44
|
+
- Changelog
|
|
45
|
+
|
|
46
|
+
notes:
|
|
47
|
+
source_of_truth:
|
|
48
|
+
- AGENTS.md
|
|
49
|
+
- CONTRIBUTING.md
|
|
50
|
+
purpose: Minimal machine-readable policy for AI agents and automation.
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
# Repository Map
|
|
2
|
+
|
|
3
|
+
Quick orientation for contributors and coding agents working in `CentaurTechnicalIndicators-Python`.
|
|
4
|
+
|
|
5
|
+
## Top-level layout
|
|
6
|
+
|
|
7
|
+
- `src/`: Rust source files (PyO3 binding implementations for each indicator module).
|
|
8
|
+
- `tests/`: Python test files (smoke tests for each binding module).
|
|
9
|
+
- `assets/`: Supporting artifacts (documentation assets, banner images).
|
|
10
|
+
- `.github/workflows/`: CI workflows (PR validation, release pipeline).
|
|
11
|
+
- `Cargo.toml`: Rust package version and dependency configuration.
|
|
12
|
+
- `pyproject.toml`: Python package metadata and maturin build settings.
|
|
13
|
+
- `CHANGELOG.md`: required entry point for every user-facing change.
|
|
14
|
+
- `AGENTS.md`: agent operating rules and PR/reporting expectations.
|
|
15
|
+
- `CONTRIBUTING.md`: contributor expectations and required validation gates.
|
|
16
|
+
|
|
17
|
+
## Source module map (`src/`)
|
|
18
|
+
|
|
19
|
+
- `lib.rs`: PyO3 module wiring, shared enum type definitions (`PyConstantModelType`, `DeviationModel`, `MovingAverageType`).
|
|
20
|
+
- `candle_indicators.rs`: candle/band/channel/envelope-style indicator bindings.
|
|
21
|
+
- `chart_trends.rs`: peak/valley and trend-structure analysis bindings.
|
|
22
|
+
- `correlation_indicators.rs`: pairwise/statistical relationship indicator bindings.
|
|
23
|
+
- `momentum_indicators.rs`: momentum/oscillator indicator bindings.
|
|
24
|
+
- `moving_average.rs`: moving average bindings.
|
|
25
|
+
- `other_indicators.rs`: miscellaneous indicator bindings.
|
|
26
|
+
- `strength_indicators.rs`: strength/participation indicator bindings.
|
|
27
|
+
- `trend_indicators.rs`: trend direction/strength indicator bindings.
|
|
28
|
+
- `volatility_indicators.rs`: volatility/range-expansion indicator bindings.
|
|
29
|
+
|
|
30
|
+
## Test module map (`tests/`)
|
|
31
|
+
|
|
32
|
+
- `test_<module_name>.py` mirrors `src/<module_name>.rs` — each test file covers binding smoke tests for the matching source module.
|
|
33
|
+
|
|
34
|
+
## Extension points
|
|
35
|
+
|
|
36
|
+
- New indicator binding: add to the appropriate `src/*_indicators.rs` file and wire through `src/lib.rs`.
|
|
37
|
+
- New shared type/enum: add to `src/lib.rs` following the existing string-dispatch pattern.
|
|
38
|
+
- Python tests: add to the matching `tests/test_<module_name>.py` file.
|
|
39
|
+
- Public exports: wire through `src/lib.rs`.
|
|
40
|
+
|
|
41
|
+
## If changing X, also check Y
|
|
42
|
+
|
|
43
|
+
- If changing an indicator's parameter names or accepted string values:
|
|
44
|
+
- Also update the corresponding docstring in `src/<module_name>.rs`.
|
|
45
|
+
- Also update or add tests in `tests/test_<module_name>.py`.
|
|
46
|
+
- If updating the upstream `centaur_technical_indicators` Rust crate version:
|
|
47
|
+
- Also update the package `version` in `Cargo.toml`.
|
|
48
|
+
- Also check for deprecation changes and adjust `#[allow(deprecated)]` annotations accordingly.
|
|
49
|
+
- Also add a user-facing entry in `CHANGELOG.md`.
|
|
50
|
+
- If adding/changing public Python-facing APIs:
|
|
51
|
+
- Also update docstrings.
|
|
52
|
+
- Also add a user-facing entry in `CHANGELOG.md`.
|
|
53
|
+
- If changing indicator math/outputs:
|
|
54
|
+
- Also update/add tests in the matching test module.
|
|
55
|
+
- If adding new user-visible behavior:
|
|
56
|
+
- Also update `README.md` and/or examples when appropriate.
|
|
57
|
+
- Also update `CHANGELOG.md`.
|
|
58
|
+
|
|
59
|
+
## Required local validation gates
|
|
60
|
+
|
|
61
|
+
Run these before opening a PR:
|
|
62
|
+
|
|
63
|
+
1. `maturin develop` (bindings compile cleanly)
|
|
64
|
+
2. `python -m pytest` (all tests pass)
|
|
65
|
+
3. `cargo fmt --check` (no formatting diffs)
|
|
66
|
+
|
|
67
|
+
## Minimal PR content checklist
|
|
68
|
+
|
|
69
|
+
- What changed and why.
|
|
70
|
+
- Compatibility/user-impact notes.
|
|
71
|
+
- Validation command summary.
|
|
72
|
+
- Explicit `CHANGELOG.md` entry note.
|
{centaur_technical_indicators-1.2.0 → centaur_technical_indicators-1.2.2}/src/trend_indicators.rs
RENAMED
|
@@ -335,7 +335,6 @@ fn bulk_directional_movement_system(
|
|
|
335
335
|
///
|
|
336
336
|
/// Returns:
|
|
337
337
|
/// VPT value
|
|
338
|
-
#[allow(deprecated)]
|
|
339
338
|
#[pyfunction(name = "volume_price_trend")]
|
|
340
339
|
fn single_volume_price_trend(
|
|
341
340
|
current_price: f64,
|
|
@@ -360,7 +359,6 @@ fn single_volume_price_trend(
|
|
|
360
359
|
///
|
|
361
360
|
/// Returns:
|
|
362
361
|
/// List of VPT values
|
|
363
|
-
#[allow(deprecated)]
|
|
364
362
|
#[pyfunction(name = "volume_price_trend")]
|
|
365
363
|
fn bulk_volume_price_trend(
|
|
366
364
|
prices: Vec<f64>,
|
|
@@ -30,23 +30,41 @@ volume = [1000.0, 1500.0, 1200.0, 900.0, 1300.0]
|
|
|
30
30
|
|
|
31
31
|
def test_single_relative_strength_index():
|
|
32
32
|
assert momentum_indicators.single.relative_strength_index(prices, "simple") == 42.857142857142854
|
|
33
|
-
assert momentum_indicators.single.relative_strength_index(prices, "smoothed") ==
|
|
34
|
-
assert momentum_indicators.single.relative_strength_index(prices, "exponential") ==
|
|
35
|
-
assert momentum_indicators.single.relative_strength_index(prices, "median") ==
|
|
36
|
-
assert momentum_indicators.single.relative_strength_index(prices, "mode") ==
|
|
33
|
+
assert momentum_indicators.single.relative_strength_index(prices, "smoothed") == 28.662420382165607
|
|
34
|
+
assert momentum_indicators.single.relative_strength_index(prices, "exponential") == 19.839679358717433
|
|
35
|
+
assert momentum_indicators.single.relative_strength_index(prices, "median") == 33.33333333333333
|
|
36
|
+
assert momentum_indicators.single.relative_strength_index(prices, "mode") == 0.0
|
|
37
37
|
with pytest.raises(ValueError):
|
|
38
38
|
momentum_indicators.single.relative_strength_index(prices, "")
|
|
39
39
|
|
|
40
40
|
|
|
41
41
|
def test_bulk_relative_strength_index():
|
|
42
42
|
assert momentum_indicators.bulk.relative_strength_index(prices, "simple", 3) == [100.0, 33.33333333333333, 0.0]
|
|
43
|
-
assert momentum_indicators.bulk.relative_strength_index(prices, "smoothed", 3) == [100.0,
|
|
44
|
-
assert momentum_indicators.bulk.relative_strength_index(prices, "exponential", 3) == [100.0,
|
|
43
|
+
assert momentum_indicators.bulk.relative_strength_index(prices, "smoothed", 3) == [100.0, 20.0, 0.0]
|
|
44
|
+
assert momentum_indicators.bulk.relative_strength_index(prices, "exponential", 3) == [100.0, 14.285714285714292, 0.0]
|
|
45
45
|
assert momentum_indicators.bulk.relative_strength_index(prices, "median", 3) == [100.0, 33.33333333333333, 0.0]
|
|
46
46
|
assert momentum_indicators.bulk.relative_strength_index(prices, "mode", 3) == [100.0, 33.33333333333333, 0.0]
|
|
47
47
|
with pytest.raises(ValueError):
|
|
48
48
|
momentum_indicators.bulk.relative_strength_index(prices, "", 3)
|
|
49
49
|
|
|
50
|
+
flat_prices = [100.0, 100.0, 100.0, 102.0, 101.0]
|
|
51
|
+
|
|
52
|
+
def test_single_relative_strength_index_zero_change_regression():
|
|
53
|
+
"""Regression: zero-change periods must not be discarded from RSI calculation (upstream fix in v1.2.2)."""
|
|
54
|
+
assert momentum_indicators.single.relative_strength_index(flat_prices, "simple") == 66.66666666666666
|
|
55
|
+
assert momentum_indicators.single.relative_strength_index(flat_prices, "smoothed") == 60.0
|
|
56
|
+
assert momentum_indicators.single.relative_strength_index(flat_prices, "exponential") == 54.54545454545455
|
|
57
|
+
assert momentum_indicators.single.relative_strength_index(flat_prices, "median") == 0.0
|
|
58
|
+
assert momentum_indicators.single.relative_strength_index(flat_prices, "mode") == 0.0
|
|
59
|
+
|
|
60
|
+
def test_bulk_relative_strength_index_zero_change_regression():
|
|
61
|
+
"""Regression: zero-change periods must not be discarded from bulk RSI calculation (upstream fix in v1.2.2)."""
|
|
62
|
+
assert momentum_indicators.bulk.relative_strength_index(flat_prices, "simple", 3) == [0.0, 100.0, 66.66666666666666]
|
|
63
|
+
assert momentum_indicators.bulk.relative_strength_index(flat_prices, "smoothed", 3) == [0.0, 100.0, 50.0]
|
|
64
|
+
assert momentum_indicators.bulk.relative_strength_index(flat_prices, "exponential", 3) == [0.0, 100.0, 40.0]
|
|
65
|
+
assert momentum_indicators.bulk.relative_strength_index(flat_prices, "median", 3) == [0.0, 100.0, 66.66666666666666]
|
|
66
|
+
assert momentum_indicators.bulk.relative_strength_index(flat_prices, "mode", 3) == [0.0, 100.0, 66.66666666666666]
|
|
67
|
+
|
|
50
68
|
def test_single_stochastic_oscillator():
|
|
51
69
|
assert momentum_indicators.single.stochastic_oscillator(prices) == 0.0
|
|
52
70
|
|
|
@@ -1,185 +0,0 @@
|
|
|
1
|
-
# Copilot Instructions for Centaur Technical Indicators
|
|
2
|
-
|
|
3
|
-
## Repository Overview
|
|
4
|
-
|
|
5
|
-
**Centaur Technical Indicators** is a production-ready Python library providing 60+ technical indicators for financial analysis, built on a high-performance Rust backend. The project uses PyO3 and maturin to create Python bindings for the underlying Rust implementation.
|
|
6
|
-
|
|
7
|
-
**Key Stats:**
|
|
8
|
-
- **Languages:** Rust (backend), Python (bindings/tests)
|
|
9
|
-
- **Build System:** maturin (Rust-Python integration)
|
|
10
|
-
- **Python Support:** 3.10+ (tested through 3.14)
|
|
11
|
-
- **Test Suite:** 107 tests, ~0.31s runtime
|
|
12
|
-
- **License:** MIT
|
|
13
|
-
|
|
14
|
-
## Build Instructions & Validated Commands
|
|
15
|
-
|
|
16
|
-
### Bootstrap & Environment Setup (Required)
|
|
17
|
-
**Always create a virtual environment before building:**
|
|
18
|
-
```bash
|
|
19
|
-
python -m venv .venv
|
|
20
|
-
source .venv/bin/activate
|
|
21
|
-
python -m pip install --upgrade pip
|
|
22
|
-
```
|
|
23
|
-
|
|
24
|
-
### Install Dependencies (Required)
|
|
25
|
-
```bash
|
|
26
|
-
pip install -r test_requirements.txt
|
|
27
|
-
```
|
|
28
|
-
**Contents:** maturin==1.9.1, pytest==8.4.1, and supporting packages
|
|
29
|
-
|
|
30
|
-
### Build the Project (Required)
|
|
31
|
-
```bash
|
|
32
|
-
maturin develop
|
|
33
|
-
```
|
|
34
|
-
- **Duration:** ~14 seconds for full compilation
|
|
35
|
-
- **Function:** Compiles Rust code and installs Python package in editable mode
|
|
36
|
-
- **Output:** Installs `centaur_technical_indicators` package locally
|
|
37
|
-
|
|
38
|
-
### Run Tests (Validation)
|
|
39
|
-
```bash
|
|
40
|
-
python -m pytest
|
|
41
|
-
```
|
|
42
|
-
- **Expected:** 107 tests pass in ~0.31s
|
|
43
|
-
- **Coverage:** All indicator modules with bulk/single function variants
|
|
44
|
-
|
|
45
|
-
### Format Code (Optional)
|
|
46
|
-
```bash
|
|
47
|
-
cargo fmt --check # Check Rust formatting
|
|
48
|
-
```
|
|
49
|
-
|
|
50
|
-
### Environment Versions (Reference)
|
|
51
|
-
- **Python:** 3.12.3+
|
|
52
|
-
- **Rust:** 1.89.0+
|
|
53
|
-
- **maturin:** 1.9.1
|
|
54
|
-
|
|
55
|
-
## Project Layout & Architecture
|
|
56
|
-
|
|
57
|
-
### Root Directory Structure
|
|
58
|
-
```
|
|
59
|
-
/
|
|
60
|
-
├── .github/ # Workflows, issue templates, CODEOWNERS
|
|
61
|
-
├── src/ # Rust source modules
|
|
62
|
-
├── tests/ # Python test files (mirror src/ structure)
|
|
63
|
-
├── assets/ # Documentation assets, banner images
|
|
64
|
-
├── pyproject.toml # Python project configuration, maturin settings
|
|
65
|
-
├── Cargo.toml # Rust project configuration, dependencies
|
|
66
|
-
├── requirements.txt # Runtime dependencies (minimal)
|
|
67
|
-
├── test_requirements.txt # Development/test dependencies
|
|
68
|
-
└── README.md # Comprehensive project documentation
|
|
69
|
-
```
|
|
70
|
-
|
|
71
|
-
### Source Code Architecture (`src/`)
|
|
72
|
-
**Modular Design by Analysis Area:**
|
|
73
|
-
- `lib.rs` - Main module, PyO3 bindings setup, type definitions
|
|
74
|
-
- `candle_indicators.rs` - Ichimoku, Bollinger Bands, Keltner, Supertrend
|
|
75
|
-
- `momentum_indicators.rs` - RSI, MACD, CCI, Williams %R, Stochastic
|
|
76
|
-
- `moving_average.rs` - Simple, Exponential, Smoothed, McGinley Dynamic
|
|
77
|
-
- `standard_indicators.rs` - Basic indicators, moving averages
|
|
78
|
-
- `trend_indicators.rs` - Aroon, Parabolic SAR, DM, TSI
|
|
79
|
-
- `volatility_indicators.rs` - Ulcer Index, Volatility System
|
|
80
|
-
- `strength_indicators.rs` - A/D, PVI, NVI, RVI
|
|
81
|
-
- `chart_trends.rs` - Trend analysis, peak/valley detection
|
|
82
|
-
- `correlation_indicators.rs` - Asset price correlation
|
|
83
|
-
- `other_indicators.rs` - ROI, True Range, ATR
|
|
84
|
-
|
|
85
|
-
### API Design Patterns
|
|
86
|
-
- **Dual Function Variants:** Each indicator has `bulk` (returns list) and `single` (returns scalar) versions
|
|
87
|
-
- **Type System:** Custom enums (`PyConstantModelType`, `DeviationModel`, `MovingAverageType`) for configuration
|
|
88
|
-
- **Error Handling:** Uses `PyValueError` for invalid inputs with descriptive messages
|
|
89
|
-
|
|
90
|
-
### Test Structure (`tests/`)
|
|
91
|
-
- **Naming Convention:** `test_<module_name>.py` mirrors `src/<module_name>.rs`
|
|
92
|
-
- **Purpose:** Binding verification, not exhaustive testing (core logic tested in RustTI)
|
|
93
|
-
- **Pattern:** Basic smoke tests to ensure Python-Rust interface works
|
|
94
|
-
|
|
95
|
-
## CI/CD & Validation Pipelines
|
|
96
|
-
|
|
97
|
-
### GitHub Workflows
|
|
98
|
-
1. **`python-package.yml`** - Pull request validation
|
|
99
|
-
- Tests across Python 3.10-3.14 on Ubuntu
|
|
100
|
-
- Steps: checkout → setup Python → install deps → maturin develop → pytest
|
|
101
|
-
|
|
102
|
-
2. **`CI.yml`** - Release pipeline (maturin-generated)
|
|
103
|
-
- Multi-platform wheel building (Linux, Windows, macOS)
|
|
104
|
-
- Multiple architectures (x86_64, ARM, etc.)
|
|
105
|
-
- Automatic PyPI publication on tags
|
|
106
|
-
|
|
107
|
-
### Pre-commit Validation Steps
|
|
108
|
-
```bash
|
|
109
|
-
# Recommended validation sequence:
|
|
110
|
-
source .venv/bin/activate
|
|
111
|
-
pip install -r test_requirements.txt
|
|
112
|
-
maturin develop
|
|
113
|
-
python -m pytest
|
|
114
|
-
cargo fmt --check # Optional: check Rust formatting
|
|
115
|
-
```
|
|
116
|
-
|
|
117
|
-
## Development Guidelines
|
|
118
|
-
|
|
119
|
-
### Making Code Changes
|
|
120
|
-
1. **Rust Changes:** Edit files in `src/`, then run `maturin develop` to rebuild
|
|
121
|
-
2. **Python Tests:** Add corresponding tests in `tests/` following existing patterns
|
|
122
|
-
3. **API Consistency:** Maintain `bulk`/`single` function variants for new indicators
|
|
123
|
-
4. **Type Safety:** Use existing enum types or add new ones following the pattern in `lib.rs`
|
|
124
|
-
|
|
125
|
-
### Performance Considerations
|
|
126
|
-
- **Rust Backend:** Core calculations optimized for microsecond-level performance
|
|
127
|
-
- **Bulk vs Single:** Use `bulk` for time series, `single` for latest values
|
|
128
|
-
- **Memory:** Rust handles memory management; Python side is minimal overhead
|
|
129
|
-
|
|
130
|
-
### Dependencies & Updates
|
|
131
|
-
- **Rust Dependencies:** Managed in `Cargo.toml` (pyo3, rust_ti)
|
|
132
|
-
- **Python Dependencies:** Keep `test_requirements.txt` minimal
|
|
133
|
-
- **Version Constraints:** Python 3.10+ required for modern features
|
|
134
|
-
|
|
135
|
-
## Common Workflows & Commands
|
|
136
|
-
|
|
137
|
-
### Complete Development Setup
|
|
138
|
-
```bash
|
|
139
|
-
git clone <repo>
|
|
140
|
-
cd CentaurTechnicalIndicators-Python
|
|
141
|
-
python -m venv .venv
|
|
142
|
-
source .venv/bin/activate
|
|
143
|
-
pip install -r test_requirements.txt
|
|
144
|
-
maturin develop
|
|
145
|
-
python -m pytest
|
|
146
|
-
```
|
|
147
|
-
|
|
148
|
-
### Iterative Development
|
|
149
|
-
```bash
|
|
150
|
-
# After making Rust changes:
|
|
151
|
-
maturin develop # Rebuild and reinstall
|
|
152
|
-
python -m pytest # Verify no regressions
|
|
153
|
-
|
|
154
|
-
# After making Python test changes:
|
|
155
|
-
python -m pytest # Run updated tests
|
|
156
|
-
```
|
|
157
|
-
|
|
158
|
-
### Release Preparation
|
|
159
|
-
```bash
|
|
160
|
-
cargo fmt # Format Rust code
|
|
161
|
-
python -m pytest # Ensure all tests pass
|
|
162
|
-
# CI handles wheel building and PyPI publication
|
|
163
|
-
```
|
|
164
|
-
|
|
165
|
-
## Key Files & Configuration
|
|
166
|
-
|
|
167
|
-
### Build Configuration
|
|
168
|
-
- **`pyproject.toml`:** Python packaging, maturin settings, project metadata
|
|
169
|
-
- **`Cargo.toml`:** Rust compilation, dependencies (pyo3, rust_ti)
|
|
170
|
-
- **`.gitignore`:** Excludes `target/`, `.venv/`, `__pycache__/`, build artifacts
|
|
171
|
-
|
|
172
|
-
### Documentation Resources
|
|
173
|
-
- **`README.md`:** Complete user documentation, examples, API reference
|
|
174
|
-
- **`CONTRIBUTING.md`:** Contribution guidelines, new indicator process
|
|
175
|
-
- **Wiki:** Full API reference and usage examples
|
|
176
|
-
- **External:** Tutorials, benchmarks, and how-to guides in separate repos
|
|
177
|
-
|
|
178
|
-
## Trust These Instructions
|
|
179
|
-
|
|
180
|
-
These instructions are validated and complete. Only perform additional repository exploration if:
|
|
181
|
-
- The build process fails unexpectedly
|
|
182
|
-
- Dependencies have changed significantly
|
|
183
|
-
- New requirements are introduced in documentation
|
|
184
|
-
|
|
185
|
-
The provided build sequence works reliably and efficiently for the current codebase.
|
{centaur_technical_indicators-1.2.0 → centaur_technical_indicators-1.2.2}/.github/CODEOWNERS
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{centaur_technical_indicators-1.2.0 → centaur_technical_indicators-1.2.2}/.github/workflows/CI.yml
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{centaur_technical_indicators-1.2.0 → centaur_technical_indicators-1.2.2}/CODE_OF_CONDUCT.md
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{centaur_technical_indicators-1.2.0 → centaur_technical_indicators-1.2.2}/src/candle_indicators.rs
RENAMED
|
File without changes
|
{centaur_technical_indicators-1.2.0 → centaur_technical_indicators-1.2.2}/src/chart_trends.rs
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{centaur_technical_indicators-1.2.0 → centaur_technical_indicators-1.2.2}/src/momentum_indicators.rs
RENAMED
|
File without changes
|
{centaur_technical_indicators-1.2.0 → centaur_technical_indicators-1.2.2}/src/moving_average.rs
RENAMED
|
File without changes
|
{centaur_technical_indicators-1.2.0 → centaur_technical_indicators-1.2.2}/src/other_indicators.rs
RENAMED
|
File without changes
|
{centaur_technical_indicators-1.2.0 → centaur_technical_indicators-1.2.2}/src/strength_indicators.rs
RENAMED
|
File without changes
|
|
File without changes
|
{centaur_technical_indicators-1.2.0 → centaur_technical_indicators-1.2.2}/test_requirements.txt
RENAMED
|
File without changes
|
|
File without changes
|
{centaur_technical_indicators-1.2.0 → centaur_technical_indicators-1.2.2}/tests/test_chart_trends.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|