pine files

This commit is contained in:
Miha Kralj
2026-01-31 14:05:53 -08:00
parent 51e885a4a6
commit 5ed4b6c0fc
102 changed files with 2883 additions and 593 deletions
+4 -17
View File
@@ -6,25 +6,12 @@ namespace QuanTAlib;
/// ADX: Average Directional Index
/// </summary>
/// <remarks>
/// ADX measures the strength of a trend, regardless of its direction.
/// It is derived from the Smoothed Directional Movement Index (DX).
/// Trend strength indicator [0-100] regardless of direction (Wilder).
/// Derived from smoothed DX using +DI/-DI relationship. Values above 25 indicate strong trend.
///
/// Calculation:
/// 1. Calculate True Range (TR), +DM, and -DM
/// 2. Smooth TR, +DM, -DM using RMA (Wilder's Moving Average)
/// - First value is SMA of first Period values
/// - Subsequent values: Previous + (Input - Previous) / Period
/// 3. Calculate +DI = (+DM_smooth / TR_smooth) * 100
/// 4. Calculate -DI = (-DM_smooth / TR_smooth) * 100
/// 5. Calculate DX = |(+DI - -DI) / (+DI + -DI)| * 100
/// 6. ADX = RMA(DX)
/// - First value is SMA of first Period DX values
/// - Subsequent values: Previous + (Input - Previous) / Period
///
/// Sources:
/// https://www.investopedia.com/terms/a/adx.asp
/// "New Concepts in Technical Trading Systems" by J. Welles Wilder
/// Calculation: <c>ADX = RMA(DX)</c> where <c>DX = |+DI - -DI| / (+DI + -DI) × 100</c>.
/// </remarks>
/// <seealso href="Adx.md">Detailed documentation</seealso>
[SkipLocalsInit]
public sealed class Adx : ITValuePublisher
{
+4 -8
View File
@@ -7,16 +7,12 @@ namespace QuanTAlib;
/// ADXR: Average Directional Movement Rating
/// </summary>
/// <remarks>
/// ADXR quantifies the change in momentum of the ADX. It is calculated by averaging
/// the current ADX value and the ADX value from 'Period' bars ago.
/// ADX momentum measure averaging current ADX with ADX from N periods ago (Wilder).
/// Smooths ADX to reduce noise and confirm sustained trend strength changes.
///
/// Calculation:
/// ADXR = (ADX + ADX[Period]) / 2
///
/// Sources:
/// https://www.investopedia.com/terms/a/adxr.asp
/// "New Concepts in Technical Trading Systems" by J. Welles Wilder
/// Calculation: <c>ADXR = (ADX + ADX[Period]) / 2</c>.
/// </remarks>
/// <seealso href="Adxr.md">Detailed documentation</seealso>
[SkipLocalsInit]
public sealed class Adxr : ITValuePublisher
{
+4 -17
View File
@@ -8,25 +8,12 @@ namespace QuanTAlib;
/// AMAT: Archer Moving Averages Trends
/// </summary>
/// <remarks>
/// AMAT is a trend identification system that uses multiple EMAs to identify
/// trend direction and strength. Unlike simple crossovers, AMAT requires alignment
/// of both fast and slow moving averages in the same direction.
/// Trend system requiring fast/slow EMA alignment in same direction for signals.
/// Returns +1 (bullish), -1 (bearish), or 0 (neutral) with strength percentage.
///
/// Calculation:
/// 1. Calculate Fast and Slow EMAs
/// 2. Bullish (+1): Fast EMA > Slow EMA AND Fast EMA rising AND Slow EMA rising
/// 3. Bearish (-1): Fast EMA &lt; Slow EMA AND Fast EMA falling AND Slow EMA falling
/// 4. Neutral (0): Mixed conditions
/// 5. Strength = |Fast EMA - Slow EMA| / Slow EMA * 100
///
/// Key features:
/// - Direction alignment reduces false signals
/// - Trend strength measurement for conviction assessment
/// - Clear +1/-1/0 trend signals
///
/// Sources:
/// Tom Joseph (2009), based on Mark Whistler (Archer) concepts
/// Signal: <c>+1</c> when FastEMA > SlowEMA and both rising; <c>-1</c> when FastEMA &lt; SlowEMA and both falling.
/// </remarks>
/// <seealso href="Amat.md">Detailed documentation</seealso>
[SkipLocalsInit]
public sealed class Amat : ITValuePublisher, IDisposable
{
+5 -13
View File
@@ -4,23 +4,15 @@ using System.Runtime.CompilerServices;
namespace QuanTAlib;
/// <summary>
/// Aroon Indicator
/// AROON: Aroon Indicator
/// </summary>
/// <remarks>
/// The Aroon indicator is used to identify trend changes in the price of an asset, as well as the strength of that trend.
/// It consists of two lines: Aroon Up and Aroon Down.
/// Trend timing indicator measuring bars since period high/low (Chande).
/// Outputs Up [0-100], Down [0-100], and Oscillator (Up - Down).
///
/// Calculation:
/// Aroon Up = ((Period - Days Since Period High) / Period) * 100
/// Aroon Down = ((Period - Days Since Period Low) / Period) * 100
/// Aroon Oscillator = Aroon Up - Aroon Down
///
/// The indicator requires Period + 1 samples to fully calculate "Period" days ago.
///
/// Sources:
/// https://www.investopedia.com/terms/a/aroon.asp
/// Tushar Chande (1995)
/// Calculation: <c>Up = (Period - DaysSinceHigh) / Period × 100</c>; <c>Down = (Period - DaysSinceLow) / Period × 100</c>.
/// </remarks>
/// <seealso href="Aroon.md">Detailed documentation</seealso>
[SkipLocalsInit]
public sealed class Aroon : ITValuePublisher
{
+5 -13
View File
@@ -3,23 +3,15 @@ using System.Runtime.CompilerServices;
namespace QuanTAlib;
/// <summary>
/// Aroon Oscillator
/// AROONOSC: Aroon Oscillator
/// </summary>
/// <remarks>
/// The Aroon Oscillator is a trend-following indicator that uses aspects of the Aroon Indicator (Aroon Up and Aroon Down)
/// to gauge the strength of a current trend and the likelihood that it will continue.
/// Single-line trend indicator derived from Aroon Up minus Aroon Down (Chande).
/// Range [-100, +100]: positive = uptrend, negative = downtrend.
///
/// Calculation:
/// Aroon Up = ((Period - Days Since Period High) / Period) * 100
/// Aroon Down = ((Period - Days Since Period Low) / Period) * 100
/// Aroon Oscillator = Aroon Up - Aroon Down
///
/// The indicator requires Period + 1 samples to fully calculate "Period" days ago.
///
/// Sources:
/// https://www.investopedia.com/terms/a/aroonoscillator.asp
/// Tushar Chande (1995)
/// Calculation: <c>AroonOsc = AroonUp - AroonDown</c>.
/// </remarks>
/// <seealso href="AroonOsc.md">Detailed documentation</seealso>
[SkipLocalsInit]
public sealed class AroonOsc : ITValuePublisher
{
+8 -3
View File
@@ -5,10 +5,15 @@ using System.Runtime.InteropServices;
namespace QuanTAlib;
/// <summary>
/// DMX Jurik Directional Movement Index
/// A smoother, lower-lag alternative to Welles Wilders DMI/ADX.
/// Uses Jurik Moving Average (JMA) for smoothing directional movement components.
/// DMX: Jurik Directional Movement Index
/// </summary>
/// <remarks>
/// Smoother DMI alternative using JMA instead of Wilder smoothing (Jurik).
/// Lower lag than ADX while maintaining directional trend detection.
///
/// Calculation: <c>DMX = DI+ - DI-</c> where DI values use JMA-smoothed +DM/-DM/TR.
/// </remarks>
/// <seealso href="Dmx.md">Detailed documentation</seealso>
[SkipLocalsInit]
public sealed class Dmx : ITValuePublisher
{
+8 -2
View File
@@ -4,9 +4,15 @@ using System.Runtime.InteropServices;
namespace QuanTAlib;
/// <summary>
/// SuperTrend Indicator
/// A trend-following indicator that uses ATR to define upper and lower bands.
/// SUPER: SuperTrend Indicator
/// </summary>
/// <remarks>
/// ATR-based trend follower that switches between upper/lower bands on price breakouts.
/// Returns current SuperTrend level plus bullish/bearish state.
///
/// Calculation: <c>Bands = HL2 ± Multiplier × ATR</c>; trend flips when price crosses opposite band.
/// </remarks>
/// <seealso href="Super.md">Detailed documentation</seealso>
[SkipLocalsInit]
public sealed class Super : ITValuePublisher
{