STARC Bands
Created by Manning Stoller, the Stoller Average Range Channel (STARC) Bands, are price ranges based on an SMA centerline and ATR band widths. See also Keltner Channels for an EMA centerline equivalent. [Discuss] 💬
// C# usage syntax
IReadOnlyList<StarcBandsResult> results =
bars.ToStarcBands(smaPeriods, multiplier, atrPeriods);Create a buffer list and add each bar as it arrives:
StarcBandsList starcBandsList = new(smaPeriods, multiplier, atrPeriods);
// call from your WebSocket or SSE message handler
void OnBarReceived(IBar bar) => starcBandsList.Add(bar);
// the list itself holds the results; fills as the handler runs
IReadOnlyList<StarcBandsResult> results = starcBandsList;See Buffer lists for the full usage guide.
Subscribe to a BarHub and add each bar as it arrives:
BarHub barHub = new();
StarcBandsHub observer = barHub.ToStarcBandsHub(smaPeriods, multiplier, atrPeriods);
// call from your WebSocket or SSE message handler
void OnBarReceived(IBar bar) => barHub.Add(bar);
// results fill as the handler runs
IReadOnlyList<StarcBandsResult> results = observer.Results;See Stream hubs for the full usage guide.
Parameters
| param | description |
|---|---|
smaPeriodsint | Number of lookback periods (S) for the center line moving average. Must be greater than 1 to calculate and is typically between 5 and 10. Default is 5. |
multiplierdouble | ATR Multiplier. Must be greater than 0. Default is 2. |
atrPeriodsint | Number of lookback periods (A) for the Average True Range. Must be greater than 1 to calculate and is typically the same value as smaPeriods. Default is 10. |
Historical price bars requirements
You must have at least S or A+100 periods of bars, whichever is more, to cover the warmup and convergence periods. Since this uses a smoothing technique, we recommend you use at least A+150 data points prior to the intended usage date for better precision.
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
IReadOnlyList<StarcBandsResult>- This method returns a time series of all available indicator values for the
barsprovided. - 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
N-1periods will havenullvalues since there's not enough data to calculate, whereNis the greater ofSorA.
StarcBandsList : IReadOnlyList<StarcBandsResult>- The list itself holds the results, one for each bar or value added, in timestamp order.
- It keeps up to 100,000 results by default and drops the oldest beyond that; set
MaxListSizeto keep fewer. - The first
N-1periods will havenullvalues since there's not enough data to calculate, whereNis the greater ofSorA.
IReadOnlyList<StarcBandsResult> results = observer.Results;observer.Resultsholds the results, one for each bar in theBarHubcache, in timestamp order.- Results update as bars arrive, including bars that arrive late or are revised.
- The cache keeps up to 100,000 results by default; set
maxCacheSizeon theBarHubto keep fewer. - The first
N-1periods will havenullvalues since there's not enough data to calculate, whereNis the greater ofSorA.
🚩 ⚞ Convergence warning
The first A+150 periods will have decreasing magnitude, convergence-related precision errors that can be as high as ~5% deviation in indicator values for earlier periods.
StarcBandsResult
| property | description |
|---|---|
TimestampDateTime | Date from evaluated TBar |
UpperBanddouble? | Upper STARC band |
Centerlinedouble? | SMA of price |
LowerBanddouble? | Lower STARC band |
Chaining
This indicator is not chain-enabled and must be generated from bars. It cannot be used for further processing by other chain-enabled indicators.
See Chaining indicators for more.
Utilities
Call these on the list itself, as in starcBandsList.Find(lookupDate). .Condense() returns a new list and leaves starcBandsList unchanged.
Warmup removal is left out. Once the list is full it drops its oldest results, so trimming by position would remove valid values.
Call these on observer.Results, as in observer.Results.Find(lookupDate). .Condense() returns a new list and leaves the hub's results unchanged.
Warmup removal is left out. Once the cache is full the hub drops its oldest results, so trimming by position would remove valid values.
See Utilities and helpers for more information.