CandleHelper

StockSharp.Algo.Candles

Extension class for candles.

Methods

BuyVolAbovePoC(VolumeProfileBuilder) : decimal

The total volume of bids which was above VolumeProfileBuilder).

volumeProfile
Volume profile.

Returns: The total volume of bids.

BuyVolBelowPoC(VolumeProfileBuilder) : decimal

The total volume of bids which was below VolumeProfileBuilder).

volumeProfile
Volume profile.

Returns: The total volume of bids.

Compress(IAsyncEnumerable<CandleMessage>, BiggerTimeFrameCandleCompressor, bool) : IAsyncEnumerable<CandleMessage>

Compress candles to bigger time-frame candles.

source
Smaller time-frame candles.
compressor
Compressor of candles from smaller time-frames to bigger.
includeLastCandle
Output last active candle as finished.

Returns: Bigger time-frame candles.

Compress(IEnumerable<CandleMessage>, BiggerTimeFrameCandleCompressor, bool) : IAsyncEnumerable<CandleMessage>

Compress candles to bigger time-frame candles.

source
Smaller time-frame candles.
compressor
Compressor of candles from smaller time-frames to bigger.
includeLastCandle
Output last active candle as finished.

Returns: Bigger time-frame candles.

ConvertToTrades(ICandleMessage, decimal, int, ValueTuple<Sides?, decimal, decimal, DateTime>[])

To create tick trades from candle.

candleMsg
Candle.
volumeStep
Volume step.
decimals
The number of decimal places for the volume.
ticks
Array to tick trades.
Delta(VolumeProfileBuilder) : decimal

The difference between VolumeProfileBuilder) and VolumeProfileBuilder).

volumeProfile
Volume profile.

Returns: Delta.

DeltaAbovePoC(VolumeProfileBuilder) : decimal

The total Delta which was above VolumeProfileBuilder).

volumeProfile
Volume profile.

Returns: Delta.

DeltaBelowPoC(VolumeProfileBuilder) : decimal

The total Delta which was below VolumeProfileBuilder).

volumeProfile
Volume profile.

Returns: Delta.

FilterSmallerTimeFrames(IEnumerable<TimeSpan>, TimeSpan) : IEnumerable<TimeSpan>

Filter time-frames to find multiple smaller time-frames.

timeFrames
All time-frames.
original
Original time-frame.

Returns: Multiple smaller time-frames.

GetBody(ICandleMessage) : decimal

To get the candle body.

candle
The candle for which you need to get the body.

Returns: The candle body.

GetBottomShadow(ICandleMessage) : decimal

To get the candle lower shadow length.

candle
The candle for which you need to get the lower shadow length.

Returns: The candle lower shadow length. If 0, there is no shadow.

GetCandleBounds(TimeSpan, DateTime, BoardMessage) : Range<DateTime>

To get candle time frames relatively to the exchange working hours.

timeFrame
The time frame for which you need to get time range.
currentTime
The current time within the range of time frames.
board
The information about the board from which WorkingTime working hours will be taken.

Returns: The candle time frames.

GetCandleBounds(TimeSpan, DateTime, ExchangeBoard) : Range<DateTime>

To get candle time frames relatively to the exchange working hours.

timeFrame
The time frame for which you need to get time range.
currentTime
The current time within the range of time frames.
board
The information about the board from which WorkingTime working hours will be taken.

Returns: The candle time frames.

GetLength(ICandleMessage) : decimal

To get the candle length.

candle
The candle for which you need to get a length.

Returns: The candle length.

GetMiddlePrice(ICandleMessage, decimal?) : decimal

To get the candle middle price.

candle
The candle for which you need to get a length.
priceStep
PriceStep

Returns: The candle length.

GetTimeFrameCount(Range<DateTime>, TimeSpan, BoardMessage) : long

To get the number of time frames within the specified time range.

range
The specified time range for which you need to get the number of time frames.
timeFrame
The time frame size.
board
BoardMessage.

Returns: The received number of time frames.

GetTimeFrameCount(Range<DateTime>, TimeSpan, ExchangeBoard) : long

To get the number of time frames within the specified time range.

range
The specified time range for which you need to get the number of time frames.
timeFrame
The time frame size.
board
ExchangeBoard.

Returns: The received number of time frames.

GetTopShadow(ICandleMessage) : decimal

To get the candle upper shadow length.

candle
The candle for which you need to get the upper shadow length.

Returns: The candle upper shadow length. If 0, there is no shadow.

GetValueArea``1(IEnumerable<T>)

To calculate the area for the candles group.

candles
Candles.

Returns: The area.

IsSame``1(T, T)

Determines the specified candles are same.

candle1
First.
candle2
Second.

Returns: Check result.

MaxPriceLevel(ICandleMessage) : CandlePriceLevel?

PriceLevels with maximum TotalVolume.

candle
ICandleMessage

Returns: PriceLevels with maximum TotalVolume.

MinPriceLevel(ICandleMessage) : CandlePriceLevel?

PriceLevels with minimum TotalVolume.

candle
ICandleMessage

Returns: PriceLevels with minimum TotalVolume.

PoC(VolumeProfileBuilder) : CandlePriceLevel

POC (Point Of Control) returns CandlePriceLevel which had the maximum volume.

volumeProfile
Volume profile.

Returns: The CandlePriceLevel which had the maximum volume.

PriceLevelOfMaxDelta(VolumeProfileBuilder) : CandlePriceLevel

It returns the price level at which the maximum VolumeProfileBuilder) is passed.

volumeProfile
Volume profile.

Returns: CandlePriceLevel.

PriceLevelOfMinDelta(VolumeProfileBuilder) : CandlePriceLevel

It returns the price level at which the minimum VolumeProfileBuilder) is passed.

volumeProfile
Volume profile.

Returns: The price level.

SellVolAbovePoC(VolumeProfileBuilder) : decimal

The total volume of asks which was above VolumeProfileBuilder).

volumeProfile
Volume profile.

Returns: The total volume of asks.

SellVolBelowPoC(VolumeProfileBuilder) : decimal

The total volume of asks which was below VolumeProfileBuilder).

volumeProfile
Volume profile.

Returns: The total volume of asks.

ToCandles(IEnumerable<ExecutionMessage>, MarketDataMessage, CandleBuilderProvider) : IAsyncEnumerable<CandleMessage>

To create candles from the tick trades collection.

executions
Tick data.
mdMsg
Market data subscription.
candleBuilderProvider
Candle builders provider.

Returns: Candles.

ToCandles(IAsyncEnumerable<ExecutionMessage>, Subscription, CandleBuilderProvider) : IAsyncEnumerable<CandleMessage>

To create candles from the tick trades collection.

executions
Tick data.
subscription
Market data subscription.
candleBuilderProvider
Candle builders provider.

Returns: Candles.

ToCandles(IAsyncEnumerable<ExecutionMessage>, MarketDataMessage, CandleBuilderProvider) : IAsyncEnumerable<CandleMessage>

To create candles from the tick trades collection.

executions
Tick data.
mdMsg
Market data subscription.
candleBuilderProvider
Candle builders provider.

Returns: Candles.

ToCandles(IEnumerable<QuoteChangeMessage>, MarketDataMessage, Level1Fields, CandleBuilderProvider) : IAsyncEnumerable<CandleMessage>

To create candles from the order books collection.

depths
Market depths.
mdMsg
Market data subscription.
type
Type of candle depth based data.
candleBuilderProvider
Candle builders provider.

Returns: Candles.

ToCandles(IAsyncEnumerable<QuoteChangeMessage>, Subscription, Level1Fields, CandleBuilderProvider) : IAsyncEnumerable<CandleMessage>

To create candles from the order books collection.

depths
Market depths.
subscription
Market data subscription.
type
Type of candle depth based data.
candleBuilderProvider
Candle builders provider.

Returns: Candles.

ToCandles(IEnumerable<QuoteChangeMessage>, Subscription, Level1Fields, CandleBuilderProvider) : IAsyncEnumerable<CandleMessage>

To create candles from the order books collection.

depths
Market depths.
subscription
Market data subscription.
type
Type of candle depth based data.
candleBuilderProvider
Candle builders provider.

Returns: Candles.

ToCandles(IAsyncEnumerable<QuoteChangeMessage>, MarketDataMessage, Level1Fields, CandleBuilderProvider) : IAsyncEnumerable<CandleMessage>

To create candles from the order books collection.

depths
Market depths.
mdMsg
Market data subscription.
type
Type of candle depth based data.
candleBuilderProvider
Candle builders provider.

Returns: Candles.

ToCandles(IEnumerable<ExecutionMessage>, Subscription, CandleBuilderProvider) : IAsyncEnumerable<CandleMessage>

To create candles from the tick trades collection.

executions
Tick data.
subscription
Market data subscription.
candleBuilderProvider
Candle builders provider.

Returns: Candles.

TotalBuyCount(VolumeProfileBuilder) : decimal

The total number of bids in the VolumeProfileBuilder.

volumeProfile
Volume profile.

Returns: The total number of bids.

TotalBuyVolume(VolumeProfileBuilder) : decimal

The total volume of bids in the VolumeProfileBuilder.

volumeProfile
Volume profile.

Returns: The total volume of bids.

TotalSellCount(VolumeProfileBuilder) : decimal

The total number of asks in the VolumeProfileBuilder.

volumeProfile
Volume profile.

Returns: The total number of asks.

TotalSellVolume(VolumeProfileBuilder) : decimal

The total volume of asks in the VolumeProfileBuilder.

volumeProfile
Volume profile.

Returns: The total volume of asks.

ToTickMessage(ValueTuple<Sides?, decimal, decimal, DateTime>, SecurityId, DateTime) : ExecutionMessage

Convert tick info into ExecutionMessage.

tick
Tick info.
securityId
SecurityId
localTime
LocalTime

Returns: ExecutionMessage

ToTrades``1(IEnumerable<T>, decimal)

To create tick trades from candles.

candles
Candles.
volumeStep
Volume step.

Returns: Tick trades.

ToTrades``1(IAsyncEnumerable<T>, decimal)

To create tick trades from candles.

candles
Candles.
volumeStep
Volume step.

Returns: Tick trades.

TryGetCandlesBuildFromAsync(IMessageAdapter, MarketDataMessage, CandleBuilderProvider, CancellationToken) : ValueTask<DataType>

Try get suitable market-data type for candles compression.

adapter
Adapter.
subscription
Subscription.
provider
Candle builders provider.
cancellationToken
CancellationToken

Returns: Which market-data type is used as a source value. if compression is impossible.

Update(VolumeProfileBuilder, ICandleBuilderValueTransform)

To update the profile with new value.

volumeProfile
Volume profile.
transform
The data source transformation.
VolumeAbovePoC(VolumeProfileBuilder) : decimal

The total volume which was above VolumeProfileBuilder).

volumeProfile
Volume profile.

Returns: Total volume.

VolumeBelowPoC(VolumeProfileBuilder) : decimal

The total volume which was below VolumeProfileBuilder).

volumeProfile
Volume profile.

Returns: Total volume.