mirror of
https://github.com/mihakralj/QuanTAlib.git
synced 2026-08-19 02:58:05 +00:00
pine files
This commit is contained in:
@@ -6,18 +6,12 @@ namespace QuanTAlib;
|
||||
/// ADR: Average Daily Range
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// ADR measures the average price movement range over a specified period.
|
||||
/// Unlike ATR, ADR uses only the High-Low range without accounting for gaps.
|
||||
/// Smoothed average of High-Low ranges; simpler than ATR (no gap accounting).
|
||||
/// Supports SMA/EMA/WMA smoothing methods.
|
||||
///
|
||||
/// Calculation:
|
||||
/// 1. Daily Range = High - Low
|
||||
/// 2. ADR = MA(Daily Range, period)
|
||||
///
|
||||
/// Supports three smoothing methods:
|
||||
/// - SMA (Simple Moving Average) - default
|
||||
/// - EMA (Exponential Moving Average)
|
||||
/// - WMA (Weighted Moving Average)
|
||||
/// Calculation: <c>ADR = MA(High - Low, period)</c>.
|
||||
/// </remarks>
|
||||
/// <seealso href="Adr.md">Detailed documentation</seealso>
|
||||
[SkipLocalsInit]
|
||||
public sealed class Adr : AbstractBase
|
||||
{
|
||||
|
||||
@@ -6,17 +6,12 @@ namespace QuanTAlib;
|
||||
/// ATR: Average True Range
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// ATR measures the volatility of an asset.
|
||||
/// It is the moving average (typically RMA/Wilder's) of the True Range.
|
||||
/// Wilder's volatility measure using RMA-smoothed True Range.
|
||||
/// Accounts for gaps via max of H-L, |H-PrevClose|, |L-PrevClose|.
|
||||
///
|
||||
/// Calculation:
|
||||
/// 1. True Range (TR) = Max(High - Low, |High - PrevClose|, |Low - PrevClose|)
|
||||
/// - For the first bar, TR = High - Low
|
||||
/// 2. ATR = RMA(TR)
|
||||
///
|
||||
/// Sources:
|
||||
/// "New Concepts in Technical Trading Systems" by J. Welles Wilder
|
||||
/// Calculation: <c>ATR = RMA(TR, period)</c>.
|
||||
/// </remarks>
|
||||
/// <seealso href="Atr.md">Detailed documentation</seealso>
|
||||
[SkipLocalsInit]
|
||||
public sealed class Atr : AbstractBase
|
||||
{
|
||||
|
||||
@@ -7,18 +7,12 @@ namespace QuanTAlib;
|
||||
/// ATRN: Average True Range Normalized
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// ATRN normalizes the ATR to a [0,1] range using min-max scaling over a lookback window.
|
||||
/// This makes volatility comparable across different price scales and time periods.
|
||||
/// ATR normalized to [0,1] via min-max scaling over 10×period lookback.
|
||||
/// Enables cross-asset volatility comparison regardless of price scale.
|
||||
///
|
||||
/// Calculation:
|
||||
/// 1. Calculate ATR using RMA smoothing
|
||||
/// 2. Find min/max ATR over lookback window (10 * period)
|
||||
/// 3. Normalize: (ATR - minATR) / (maxATR - minATR)
|
||||
/// 4. If maxATR equals minATR, return 0.5
|
||||
///
|
||||
/// Sources:
|
||||
/// Derived from ATR by J. Welles Wilder, normalized for cross-asset comparison.
|
||||
/// Calculation: <c>ATRN = (ATR - minATR) / (maxATR - minATR)</c>.
|
||||
/// </remarks>
|
||||
/// <seealso href="Atrn.md">Detailed documentation</seealso>
|
||||
[SkipLocalsInit]
|
||||
public sealed class Atrn : AbstractBase
|
||||
{
|
||||
|
||||
@@ -7,23 +7,12 @@ namespace QuanTAlib;
|
||||
/// ATRP: Average True Range Percent
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// ATRP normalizes ATR as a percentage of the closing price, enabling volatility
|
||||
/// comparison across different assets regardless of their price levels.
|
||||
/// ATR as percentage of closing price for cross-asset volatility comparison.
|
||||
/// Higher values indicate greater relative volatility; typical range 0-10%.
|
||||
///
|
||||
/// Calculation:
|
||||
/// 1. True Range (TR) = Max(High - Low, |High - PrevClose|, |Low - PrevClose|)
|
||||
/// - For the first bar, TR = High - Low
|
||||
/// 2. ATR = RMA(TR, Period) with warmup compensation
|
||||
/// 3. ATRP = (ATR / Close) × 100
|
||||
///
|
||||
/// Key characteristics:
|
||||
/// - Normalized volatility allows cross-asset comparison
|
||||
/// - Higher ATRP indicates higher relative volatility
|
||||
/// - Typical values range from 0 to 10+ depending on asset class
|
||||
///
|
||||
/// Sources:
|
||||
/// Derived from ATR by J. Welles Wilder, expressed as percentage.
|
||||
/// Calculation: <c>ATRP = (ATR / Close) × 100</c>.
|
||||
/// </remarks>
|
||||
/// <seealso href="Atrp.md">Detailed documentation</seealso>
|
||||
[SkipLocalsInit]
|
||||
public sealed class Atrp : AbstractBase
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user