Class ConsecutiveCloseCompression
- Namespace
- Balsam.Compression
- Assembly
- Balsam.Backtester.dll
Builds compressed bars based on number of consecutive closes up or down in original timeframe.
public class ConsecutiveCloseCompression : CompressionProvider, ICompressionProvider
- Inheritance
-
ConsecutiveCloseCompression
- Implements
- Inherited Members
- Extension Methods
Constructors
ConsecutiveCloseCompression(int)
Instantiates a new ConsecutiveCloseCompression object with the specified streak.
public ConsecutiveCloseCompression(int streak)
Parameters
streak
int
ConsecutiveCloseCompression(int, int)
Use this constructor to creater compressed bars where x out of y bars closed in the same direction (e.g. 4 out of 5 closes)
public ConsecutiveCloseCompression(int streak, int capacity)
Parameters
Properties
Capacity
Gets the total number of bars over which to monitor for a streak.
public int Capacity { get; }
Property Value
EnforceMinimumBarSize
Gets/sets whether every compressed bar must be comprised of at least the number of bars as specified by the Streak property. If this property is false and you have another consecutive close in the same direction you could get a compressed bar that contains only a single observation.
public bool EnforceMinimumBarSize { get; set; }
Property Value
Streak
Gets the number of consecutive closes.
public int Streak { get; }
Property Value
Methods
OnCompress(ISeries, ICompressor)
Comresses the specified series.
protected override ISeries OnCompress(ISeries series, ICompressor compressor)
Parameters
series
ISeriescompressor
ICompressor