Merge branch 'dev'

This commit is contained in:
Miha Kralj
2026-03-13 13:47:10 -07:00
404 changed files with 2754 additions and 1763 deletions
+1 -3
View File
@@ -14,8 +14,6 @@
- AVGPRICE computes the arithmetic mean of a bar's four canonical prices: Open, High, Low, and Close.
- No configurable parameters; computation is stateless per bar.
- Output range: Varies (see docs).
- Requires `1` bars of warmup before first valid output (IsHot = true).
- Validated against TA-Lib, Skender, and Tulip reference implementations where available.
AVGPRICE computes the arithmetic mean of a bar's four canonical prices: Open, High, Low, and Close. The formula $\frac{O + H + L + C}{4}$ produces a single representative price that weights all four price components equally, unlike Typical Price (which excludes Open) or Weighted Close (which double-weights Close). This equal weighting makes AVGPRICE the least biased single-bar summary statistic, useful as a neutral input to downstream indicators when no particular price component deserves emphasis. The calculation is stateless, requires no warmup, and costs a single FMA instruction per bar.
@@ -96,4 +94,4 @@ $O(1)$ per bar. Two additions, one FMA. No memory allocation. Always hot after t
## Resources
- **TA-Lib** `TA_AVGPRICE` function reference.
- **Murphy, J.J.** *Technical Analysis of the Financial Markets*. New York Institute of Finance, 1999.
- **Murphy, J.J.** *Technical Analysis of the Financial Markets*. New York Institute of Finance, 1999.
+1 -3
View File
@@ -14,8 +14,6 @@
- HA transforms standard OHLC bars into smoothed Heikin-Ashi candles by averaging each component with its predecessor.
- No configurable parameters; computation is stateless per bar.
- Output range: Varies (see docs).
- Requires `1` bars of warmup before first valid output (IsHot = true).
- Validated against TA-Lib, Skender, and Tulip reference implementations where available.
HA transforms standard OHLC bars into smoothed Heikin-Ashi candles by averaging each component with its predecessor. The Close is the bar's four-price mean $(O+H+L+C)/4$, the Open is a recursive midpoint of the prior HA Open and HA Close, and High/Low are clamped extremes that guarantee the HA body always fits inside the HA wick. Unlike most indicators that reduce a bar to a single scalar, HA outputs a complete `TBar` — four smoothed prices per bar — making it a bar-to-bar transform rather than a bar-to-value reduction. The recursive Open gives HA an IIR character: each bar carries a decaying memory of the entire price history, which is what flattens trend noise but also why HA prices do not match any actual traded price.
@@ -202,4 +200,4 @@ Validated against external libraries in `Ha.Validation.Tests.cs`. HA is widely i
- **Valcu, D.** (2004). "Using The Heikin-Ashi Technique." *Technical Analysis of Stocks & Commodities*, Vol. 22, No. 2.
- **Nison, S.** (1991). *Japanese Candlestick Charting Techniques*. New York Institute of Finance.
- **Vervoort, S.** (2008). "Smoothing Heikin-Ashi." *Technical Analysis of Stocks & Commodities*.
- [Investopedia: Heikin-Ashi](https://www.investopedia.com/terms/h/heikinashi.asp) — accessible introduction to the technique and its trading applications.
- [Investopedia: Heikin-Ashi](https://www.investopedia.com/terms/h/heikinashi.asp) — accessible introduction to the technique and its trading applications.
+1 -3
View File
@@ -14,8 +14,6 @@
- MEDPRICE computes the midpoint of a bar's High and Low: $(H + L) \times 0.5$.
- No configurable parameters; computation is stateless per bar.
- Output range: Varies (see docs).
- Requires `1` bars of warmup before first valid output (IsHot = true).
- Validated against TA-Lib, Skender, and Tulip reference implementations where available.
MEDPRICE computes the midpoint of a bar's High and Low: $(H + L) \times 0.5$. This is the simplest possible estimate of a bar's "fair value," splitting the difference between the session's extremes while ignoring both the opening gap and closing settlement. The result represents the geometric center of the bar's vertical range. Because it excludes Open and Close, MEDPRICE responds purely to the supply/demand boundaries that the market tested, making it a useful input for range-based indicators like CCI or as a detrending reference. Stateless, zero-warmup, one addition and one multiply per bar.
@@ -95,4 +93,4 @@ $O(1)$ per bar. One addition, one multiply. No memory allocation. Always hot aft
## Resources
- **TA-Lib** `TA_MEDPRICE` function reference.
- **Murphy, J.J.** *Technical Analysis of the Financial Markets*. New York Institute of Finance, 1999.
- **Murphy, J.J.** *Technical Analysis of the Financial Markets*. New York Institute of Finance, 1999.
+2 -4
View File
@@ -13,9 +13,7 @@
| **PineScript** | [midpoint.pine](midpoint.pine) |
- Single-series rolling midpoint: `(Highest(V, N) + Lowest(V, N)) * 0.5`.
- Parameterized by `period`.
- Output range: Varies (see docs).
- Requires `period` bars of warmup before first valid output (IsHot = true).
- **Similar:** [MidPrice](../midprice/Midprice.md), [Midbody](../midbody/Midbody.md) | **Trading note:** (Highest+Lowest)/2 over period; simple support/resistance level.
- Validated against TA-Lib, Skender, and Tulip reference implementations where available.
Single-series rolling midpoint: `(Highest(V, N) + Lowest(V, N)) * 0.5`. Returns the center of the value range within a lookback window. TA-Lib compatible (`MIDPOINT` function). Unlike MIDPRICE which operates on separate High/Low bar channels, MIDPOINT operates on a single value series.
@@ -108,4 +106,4 @@ The span-based `Batch` method uses a single `RingBuffer` with linear scan for ma
## References
- TA-Lib `MIDPOINT` function documentation
- Murphy, J. *Technical Analysis of the Financial Markets* (range-based indicators)
- Murphy, J. *Technical Analysis of the Financial Markets* (range-based indicators)
+2 -4
View File
@@ -13,9 +13,7 @@
| **PineScript** | [midprice.pine](midprice.pine) |
- MIDPRICE computes the center of a rolling price channel by averaging the highest High and lowest Low over the past $N$ bars: $(\text{Highest}(H, N)...
- Parameterized by `period`.
- Output range: Varies (see docs).
- Requires `period` bars of warmup before first valid output (IsHot = true).
- **Similar:** [MidPoint](../midpoint/Midpoint.md), [TypPrice](../typprice/typprice.md) | **Trading note:** (High+Low)/2; common price proxy for indicators avoiding close bias.
- Validated against TA-Lib, Skender, and Tulip reference implementations where available.
MIDPRICE computes the center of a rolling price channel by averaging the highest High and lowest Low over the past $N$ bars: $(\text{Highest}(H, N) + \text{Lowest}(L, N)) \times 0.5$. Unlike the stateless price transforms (AVGPRICE, MEDPRICE, TYPPRICE, WCLPRICE) that operate on a single bar, MIDPRICE maintains a lookback window and produces a rolling estimate of the price range's midpoint. This makes it a simplified channel center line, equivalent to the midpoint of a Donchian Channel. The calculation uses two internal RingBuffers for $O(N)$ max/min computation per bar. TA-Lib compatible via `TA_MIDPRICE`.
@@ -116,4 +114,4 @@ A monotonic deque (sliding window max/min) would reduce per-bar cost from $O(N)$
- **TA-Lib** `TA_MIDPRICE` function reference.
- **Donchian, R.** "High Finance in Copper." *Financial Analysts Journal*, 1960. (Origin of channel-based price analysis)
- **Achelis, S.B.** *Technical Analysis from A to Z*. McGraw-Hill, 2000.
- **Achelis, S.B.** *Technical Analysis from A to Z*. McGraw-Hill, 2000.
+1 -3
View File
@@ -11,8 +11,6 @@
- `SimdExtensions` provides high-performance, SIMD-accelerated extension methods for `ReadOnlySpan<double>`.
- No configurable parameters; computation is stateless per bar.
- Output range: Varies (see docs).
- Requires 1 bar of warmup before first valid output (IsHot = true).
- Validated against TA-Lib, Skender, and Tulip reference implementations where available.
`SimdExtensions` provides high-performance, SIMD-accelerated extension methods for `ReadOnlySpan<double>`. It leverages .NET's `Vector<T>` to achieve 4-8x speedups on supported hardware (AVX2, AVX-512) while automatically falling back to scalar implementations on older hardware.
@@ -64,4 +62,4 @@ bool hasInvalid = span.ContainsNonFinite();
// Calculate dot product
double dot = span.DotProduct(otherSpan);
```
```
+1 -3
View File
@@ -11,8 +11,6 @@
- `TBar` is a lightweight, immutable struct representing a single OHLCV (Open, High, Low, Close, Volume) bar.
- No configurable parameters; computation is stateless per bar.
- Output range: Varies (see docs).
- Requires 1 bar of warmup before first valid output (IsHot = true).
- Validated against TA-Lib, Skender, and Tulip reference implementations where available.
## What It Does
@@ -137,4 +135,4 @@ TBar is a 48-byte struct (DateTime + 5 doubles). Field access and construction a
## References
* [OHLC Chart](https://en.wikipedia.org/wiki/Open-high-low-close_chart)
* [C# Record Structs](https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/builtin-types/record)
* [C# Record Structs](https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/builtin-types/record)
+1 -3
View File
@@ -11,8 +11,6 @@
- `TBarSeries` is a high-performance collection of OHLCV bars.
- No configurable parameters; computation is stateless per bar.
- Output range: Varies (see docs).
- Requires 1 bar of warmup before first valid output (IsHot = true).
- Validated against TA-Lib, Skender, and Tulip reference implementations where available.
## What It Does
@@ -146,4 +144,4 @@ SoA layout enables SIMD processing: each field array is contiguous in memory. Co
## References
* [Structure of Arrays (SoA)](https://en.wikipedia.org/wiki/AOS_and_SOA)
* [Data Locality](https://gameprogrammingpatterns.com/data-locality.html)
* [Data Locality](https://gameprogrammingpatterns.com/data-locality.html)
+1 -3
View File
@@ -11,8 +11,6 @@
- `TSeries` is a high-performance, memory-efficient container for time-series data.
- No configurable parameters; computation is stateless per bar.
- Output range: Varies (see docs).
- Requires 1 bar of warmup before first valid output (IsHot = true).
- Validated against TA-Lib, Skender, and Tulip reference implementations where available.
## What It Does
@@ -140,4 +138,4 @@ The Pub/Sub dispatch dominates practical throughput when multiple subscribers ar
## References
* [Data-Oriented Design](https://en.wikipedia.org/wiki/Data-oriented_design)
* [SIMD in .NET](https://learn.microsoft.com/en-us/dotnet/standard/simd)
* [SIMD in .NET](https://learn.microsoft.com/en-us/dotnet/standard/simd)
+1 -3
View File
@@ -11,8 +11,6 @@
- `TValue` is the fundamental atomic unit of data in QuanTAlib.
- No configurable parameters; computation is stateless per bar.
- Output range: Varies (see docs).
- Requires 1 bar of warmup before first valid output (IsHot = true).
- Validated against TA-Lib, Skender, and Tulip reference implementations where available.
## What It Does
@@ -131,4 +129,4 @@ TValue is a 16-byte struct (DateTime + double). Construction and field access ar
## References
* [Structure of Arrays (SoA)](https://en.wikipedia.org/wiki/AOS_and_SOA)
* [C# Struct Performance](https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/builtin-types/struct)
* [C# Struct Performance](https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/builtin-types/struct)
+1 -3
View File
@@ -14,8 +14,6 @@
- TYPPRICE computes the equal-weighted average of Open, High, and Low: $(O + H + L) \times \frac{1}{3}$.
- No configurable parameters; computation is stateless per bar.
- Output range: Varies (see docs).
- Requires `1` bars of warmup before first valid output (IsHot = true).
- Equivalent to `TBar.OHL3` computed property.
TYPPRICE computes the equal-weighted average of Open, High, and Low: $(O + H + L) \times \frac{1}{3}$. This three-component mean captures the opening price and the full intra-bar range without including the settlement (Close). By excluding Close, Typical Price isolates the session's initial positioning and range extremes, making it useful as an input where you want a price representative that is independent of closing action. The calculation is stateless and costs a single FMA instruction per bar.
@@ -92,4 +90,4 @@ Division by a non-power-of-two constant is 4-5x more expensive than multiplicati
## Resources
- **QuanTAlib** `TBar.OHL3` computed property reference.
- **QuanTAlib** `TBar.OHL3` computed property reference.
+1 -3
View File
@@ -14,8 +14,6 @@
- WCLPRICE computes a Close-biased average of High, Low, and Close by double-weighting the closing price: $(H + L + 2C) \times 0.25$.
- No configurable parameters; computation is stateless per bar.
- Output range: Varies (see docs).
- Requires `1` bars of warmup before first valid output (IsHot = true).
- Validated against TA-Lib, Skender, and Tulip reference implementations where available.
WCLPRICE computes a Close-biased average of High, Low, and Close by double-weighting the closing price: $(H + L + 2C) \times 0.25$. This gives Close 50% of the total weight versus 25% each for High and Low, reflecting the widely held belief that the closing price is the most important price of the bar because it represents the final consensus of buyers and sellers. The calculation is stateless, costs a single FMA instruction per bar, and is TA-Lib compatible (`TA_WCLPRICE`).
@@ -100,4 +98,4 @@ $O(1)$ per bar. One addition, one FMA. No memory allocation. Always hot after th
## Resources
- **TA-Lib** `TA_WCLPRICE` function reference.
- **Achelis, S.B.** *Technical Analysis from A to Z*. McGraw-Hill, 2000. (Weighted Close definition)
- **Achelis, S.B.** *Technical Analysis from A to Z*. McGraw-Hill, 2000. (Weighted Close definition)