mirror of
https://github.com/mihakralj/QuanTAlib.git
synced 2026-08-22 20:48:04 +00:00
Merge branch 'dev'
This commit is contained in:
@@ -13,9 +13,7 @@
|
||||
| **PineScript** | [harmean.pine](harmean.pine) |
|
||||
|
||||
- The Harmonic Mean computes the reciprocal of the arithmetic mean of reciprocals over a sliding window.
|
||||
- Parameterized by `period`.
|
||||
- Output range: Varies (see docs).
|
||||
- Requires `period` bars of warmup before first valid output (IsHot = true).
|
||||
- **Similar:** [Geomean](../geomean/Geomean.md), [CMA](../cma/Cma.md) | **Trading note:** Harmonic mean; appropriate for averaging rates/ratios. Always ≤ geometric mean ≤ arithmetic mean.
|
||||
- Validated against TA-Lib, Skender, and Tulip reference implementations where available.
|
||||
|
||||
The Harmonic Mean computes the reciprocal of the arithmetic mean of reciprocals over a sliding window. It is the correct average for quantities defined in terms of rates or ratios (speed, P/E ratios, yield). For financial time series, the harmonic mean gives the largest discount to outliers, making it the most conservative of the three Pythagorean means.
|
||||
@@ -128,4 +126,4 @@ Self-validated against mathematical properties and Wolfram Alpha known values.
|
||||
|
||||
- Bullen, P.S. "Handbook of Means and Their Inequalities." Kluwer Academic Publishers, 2003.
|
||||
- Ferger, W.F. "The Nature and Use of the Harmonic Mean." Journal of the American Statistical Association, 1931.
|
||||
- PineScript reference: `lib/statistics/harmean/harmean.pine`
|
||||
- PineScript reference: `lib/statistics/harmean/harmean.pine`
|
||||
Reference in New Issue
Block a user