Skip to content

Volatility Stop

Created by J. Welles Wilder, Volatility Stop, also known his Volatility System, is an ATR based indicator used to determine trend direction, stops, and reversals. It is similar to Wilder's Parabolic SAR and SuperTrend. [Discuss] 💬

csharp
// C# usage syntax (Series)
IReadOnlyList<VolatilityStopResult> results =
  bars.ToVolatilityStop(lookbackPeriods, multiplier);

// Usage with BarHub (streaming)
BarHub barHub = new();
VolatilityStopHub observer = barHub.ToVolatilityStopHub(lookbackPeriods, multiplier);

Parameters

paramtypedescription
lookbackPeriodsintNumber of periods (N) ATR lookback window. Must be greater than 1. Default is 7.
multiplierdoubleATR multiplier for the offset. Must be greater than 0. Default is 3.0.

Historical price bars requirements

You must have at least N+100 periods of bars to cover the warmup and convergence periods. Since the underlying ATR uses a smoothing technique, we recommend you use at least N+250 data points prior to the intended usage date for better precision. Initial values prior to the first reversal are not accurate and are excluded from the results. Therefore, provide sufficient bars to capture prior trend reversals.

bars is a collection of generic TBar historical price bars. It should have a consistent frequency (day, hour, minute, etc). See the Guide for more information.

Response

csharp
IReadOnlyList<VolatilityStopResult>
  • This method returns a time series of all available indicator values for the bars provided.
  • It always returns the same number of elements as there are in the historical price bars.
  • It does not return a single incremental indicator value.
  • The first trend will have null values since it is not accurate and based on an initial guess.

🚩 ⚞ Convergence warning

The first N+100 periods will have decreasing magnitude, convergence-related precision errors that can be as high as ~5% deviation in indicator values for earlier periods.

VolatilityStopResult

propertytypedescription
TimestampDateTimeDate from evaluated TBar
SardoubleStop and Reverse value contains both Upper and Lower segments
IsStopboolIndicates a trend reversal
UpperBanddoubleUpper band only (bearish/red)
LowerBanddoubleLower band only (bullish/green)

UpperBand and LowerBand values are provided to differentiate bullish vs bearish trends and to clearly demark trend reversal. Sar is the contiguous combination of both upper and lower line data.

Utilities

See Utilities and helpers for more information.

Chaining

Results can be further processed on Sar with additional chain-enabled indicators.

csharp
// example
var results = bars
    .ToVolatilityStop(..)
    .ToEma(..);

This indicator must be generated from bars and cannot be generated from results of another chain-enabled indicator or method.

See Chaining indicators for more.

Streaming

Use the buffer-style List<T> when you need incremental calculations without a hub:

csharp
VolatilityStopList volatilityStopList = new(lookbackPeriods, multiplier);

foreach (IBar bar in bars)  // simulating stream
{
  volatilityStopList.Add(bar);
}

// based on `ICollection<VolatilityStopResult>`
IReadOnlyList<VolatilityStopResult> results = volatilityStopList;

Subscribe to a BarHub for advanced streaming scenarios:

csharp
BarHub barHub = new();
VolatilityStopHub observer = barHub.ToVolatilityStopHub(lookbackPeriods, multiplier);

foreach (IBar bar in bars)  // simulating stream
{
  barHub.Add(bar);
}

IReadOnlyList<VolatilityStopResult> results = observer.Results;

See Buffer lists and Stream hubs for full usage guides.