Table of Contents

Class HeatmapControl

Namespace
OFT.Rendering.Heatmap
Assembly
OFT.Rendering.dll

Performs rendering of the heatmap to the offscreen image on GPU

Add all available levels to the AddBar(int, HeatmapLevel[], HeatmapMergeMode) method to update the internal data storage

This control is just a facade that is handled by a rendering engine.
It will be bind at the moment of first draw and then become fully functional

public class HeatmapControl
Inheritance
object
HeatmapControl
Extension Methods

Constructors

HeatmapControl(decimal)

Creates a heatmap with the given price step.

public HeatmapControl(decimal priceStep)

Parameters

priceStep decimal

Price distance between adjacent levels of the heatmap.

Exceptions

ArgumentOutOfRangeException

priceStep is not positive.

Properties

AnimationTime

Gets or sets time needed to heatmap to fully apply new color range when max and min visible volume changes Set 0 to update instantly, more the time the softer the transition will be. Default is 1 second Heatmap will trigger Updated events during this time

public TimeSpan AnimationTime { get; set; }

Property Value

TimeSpan

AverageVolume

Gets last calculated average volume of a visible area

public float? AverageVolume { get; set; }

Property Value

float?

BestAskColor

Color for best ask line

Added in ATAS 8.0.15.

public Color BestAskColor { get; set; }

Property Value

Color

BestBidColor

Color for best bid line

Added in ATAS 8.0.15.

public Color BestBidColor { get; set; }

Property Value

Color

BestPricesLineThickness

Thickness of best price lines in pixels

Added in ATAS 8.0.15.

public float BestPricesLineThickness { get; set; }

Property Value

float

Brightness

Opacity level of the map in [0..1] (1 = fully opaque, lower values make the map more transparent).

Added in ATAS 8.0.15.

public float Brightness { get; set; }

Property Value

float

BuyTradeColor

Color for buy trades

Added in ATAS 8.0.15.

public Color BuyTradeColor { get; set; }

Property Value

Color

Contrast

Also known as LowerCutOff, value in range 0;1

public float Contrast { get; set; }

Property Value

float

CustomColorStep

Number of discrete color steps the palette is reduced to; null or a non-positive value uses the continuous palette.

public int? CustomColorStep { get; set; }

Property Value

int?

DisplayLevelSplitter

Whether heatmap draws semi-transparent separator between levels?

public bool DisplayLevelSplitter { get; set; }

Property Value

bool

EffectiveMaxBound

Effective upper normalisation bound the renderer is currently using (percentile-based and animated, i.e. the exact value fed to the shader). Null when there is no data.

Added in ATAS 8.0.15.

public float? EffectiveMaxBound { get; set; }

Property Value

float?

EffectiveMinBound

Effective lower normalisation bound the renderer is currently using (percentile-based and animated, i.e. the exact value fed to the shader). Consumers can read this to colour other surfaces (e.g. the DOM ladder) identically to the heatmap. Null when there is no data.

Added in ATAS 8.0.15.

public float? EffectiveMinBound { get; set; }

Property Value

float?

EndBar

Index of the last (rightmost) bar to draw, inclusive. Nothing is drawn while it is less than StartBar.

public int EndBar { get; set; }

Property Value

int

FixedMaxVolume

Set this value to hardcode maximum level of volume. This will disable UpperCutOff property value
Set null to use UpperCutOff again

public float? FixedMaxVolume { get; set; }

Property Value

float?

FixedMinVolume

Set this value to hardcode minimum level of volume. This will disable Contrast property value
Set null to use Contrast again

public float? FixedMinVolume { get; set; }

Property Value

float?

HeatmapTypes

Color palette of the heatmap.

public HeatmapTypes HeatmapTypes { get; set; }

Property Value

HeatmapTypes

High

Highest price to draw: its level is the top row of the heatmap.

public decimal High { get; set; }

Property Value

decimal

InfiniteDomMode

Gets or sets if map should be filled with last added bar values till the end

public bool InfiniteDomMode { get; set; }

Property Value

bool

LastBar

Gets last added bar

public int LastBar { get; }

Property Value

int

Low

Lower price bound of the drawn area: levels at or below it are not drawn. Nothing is drawn while High is not greater than it.

public decimal Low { get; set; }

Property Value

decimal

LowLevelTransparency

True to make low volumes transparent: the opacity of a cell grows with the square of its position in the color range. False draws all cells with volume opaque.

public bool LowLevelTransparency { get; set; }

Property Value

bool

MaxTextureSize

Gets maximum size of each dimensions of the heatmap

public static int MaxTextureSize { get; set; }

Property Value

int

MaxVisibleVolume

Gets last updated max volume in the heatmap visible area

public float? MaxVisibleVolume { get; set; }

Property Value

float?

MaxVolumeFilterColor

Color of the cells whose volume reaches MaxVolumeFilterValue; red by default.

public Color MaxVolumeFilterColor { get; set; }

Property Value

Color

MaxVolumeFilterValue

Set null to disable maxVolumeFilter

public float? MaxVolumeFilterValue { get; set; }

Property Value

float?

MinVisibleVolume

Gets last updated min volume in the heatmap visible area

public float? MinVisibleVolume { get; set; }

Property Value

float?

PowBase

Exponent applied to the volumes and the color range bounds when UsePowerScale is true; System.Math.E by default.

public float PowBase { get; set; }

Property Value

float

PriceStep

Gets price step used to create map, you cannot change this value, create new map instead

public decimal PriceStep { get; }

Property Value

decimal

Region

Screen area of the heatmap, in pixels. Informational: the renderers draw into the rectangle passed to the draw call and do not read this property.

public Rectangle Region { get; set; }

Property Value

Rectangle

RemoveBarsUntil

Removes all bars until specified value

public int? RemoveBarsUntil { get; set; }

Property Value

int?

SellTradeColor

Color for sell trades

Added in ATAS 8.0.15.

public Color SellTradeColor { get; set; }

Property Value

Color

ShowBestPrices

Whether to display best bid/ask price lines

Added in ATAS 8.0.15.

public bool ShowBestPrices { get; set; }

Property Value

bool

ShowTrades

Whether to display trade circles

Added in ATAS 8.0.15.

public bool ShowTrades { get; set; }

Property Value

bool

SplitMode

true to use color texture as two separate textures for asks and bids

public bool SplitMode { get; set; }

Property Value

bool

StartBar

Index of the first (leftmost) bar to draw.

public int StartBar { get; set; }

Property Value

int

TradeCircleBaseRadius

Base radius for trade circles in pixels

Added in ATAS 8.0.15.

public float TradeCircleBaseRadius { get; set; }

Property Value

float

TradeCircleMaxRadius

Maximum radius for trade circles in pixels

Added in ATAS 8.0.15.

public float TradeCircleMaxRadius { get; set; }

Property Value

float

TradeCircleVolumeScale

Scale factor for volume-based circle sizing

Added in ATAS 8.0.15.

public float TradeCircleVolumeScale { get; set; }

Property Value

float

TradeMinVolume

Minimum volume to display a trade circle (filter noise)

Added in ATAS 8.0.15.

public decimal TradeMinVolume { get; set; }

Property Value

decimal

UpperCutOff

value in range 0;1

public float UpperCutOff { get; set; }

Property Value

float

UsePowerScale

If true, the volumes and the color range bounds are raised to the power PowBase before the color is sampled.

public bool UsePowerScale { get; set; }

Property Value

bool

VerticalBlurValue

Gets or sets how much vertical blur should be done when rendering the texture Use null to disable vertical blur

public float? VerticalBlurValue { get; set; }

Property Value

float?

Methods

AddBar(int, HeatmapLevel[], HeatmapMergeMode)

Adds a new vertical slice (bar) to the heatmap. Pass all available data, not only visible.
items should be sorted by price descending

public void AddBar(int bar, HeatmapLevel[] items, HeatmapMergeMode mode = HeatmapMergeMode.NoMerge)

Parameters

bar int

index of a bar to add or update

items HeatmapLevel[]

volume levels at each price

mode HeatmapMergeMode

Specify mode for merge last bar values

AddBarData(HeatmapBarData, HeatmapMergeMode)

Adds complete bar data including all layers

Added in ATAS 8.0.15.

public void AddBarData(HeatmapBarData data, HeatmapMergeMode mode = HeatmapMergeMode.NoMerge)

Parameters

data HeatmapBarData

Complete bar data with all layers

mode HeatmapMergeMode

Merge mode for volume levels

AddBarWithPrices(int, HeatmapLevel[], decimal, decimal, HeatmapMergeMode)

Adds bar data with best bid/ask prices

Added in ATAS 8.0.15.

public void AddBarWithPrices(int bar, HeatmapLevel[] levels, decimal bestBid, decimal bestAsk, HeatmapMergeMode mode = HeatmapMergeMode.NoMerge)

Parameters

bar int

Bar index

levels HeatmapLevel[]

Volume levels (sorted by price descending)

bestBid decimal

Best bid price

bestAsk decimal

Best ask price

mode HeatmapMergeMode

Merge mode

AddOrUpdateLevel(int, HeatmapLevel, HeatmapMergeMode)

Adds or updates level in the heatmap latest bar.
Mergeable updates are coalesced per price until a render engine drains the queue, so a burst of depth updates produces a bounded amount of queued items.
Never waits for the render thread: it is called for every depth update of the market data feed

public void AddOrUpdateLevel(int bar, HeatmapLevel item, HeatmapMergeMode mode = HeatmapMergeMode.NoMerge)

Parameters

bar int

index of a bar to add or update

item HeatmapLevel

volume level to update

mode HeatmapMergeMode

Specify mode for merge last bar values

AddRegion(HeatmapRegionContainer)

Fills the square region on the heatmap

public void AddRegion(HeatmapRegionContainer volumes)

Parameters

volumes HeatmapRegionContainer

AddTrade(int, decimal, decimal, bool)

Adds a trade to the specified bar

Added in ATAS 8.0.15.

public void AddTrade(int bar, decimal price, decimal volume, bool isBuy)

Parameters

bar int

Bar index

price decimal

Trade price

volume decimal

Trade volume

isBuy bool

True if buy (taker bought)

AddTrades(int, AggregatedTrade[])

Adds multiple aggregated trades to the specified bar

Added in ATAS 8.0.15.

public void AddTrades(int bar, AggregatedTrade[] trades)

Parameters

bar int

Bar index

trades AggregatedTrade[]

Trades to add

Dispose()

Drops all queued updates and stored bars and detaches OFT.Rendering.Heatmap.HeatmapControl.GetVolumesHandler.

public void Dispose()

GetVolumes(HeatmapRectangle)

Gets volumes for a part of a heatmap, return null if heatmap was not bind to a render engine yet

public HeatmapRegionContainer? GetVolumes(HeatmapRectangle rectangle)

Parameters

rectangle HeatmapRectangle

Returns

HeatmapRegionContainer

RemoveAllBarsUntil(int)

This function allows to release unneeded resources all bars lower than bar will be removed

public void RemoveAllBarsUntil(int bar)

Parameters

bar int

Reset()

Deletes all bars and allows to re-fill heatmap

public void Reset()

UpdateBestPrices(int, decimal, decimal)

Updates best bid/ask prices for a bar

Added in ATAS 8.0.15.

public void UpdateBestPrices(int bar, decimal bestBid, decimal bestAsk)

Parameters

bar int

Bar index

bestBid decimal

Best bid price

bestAsk decimal

Best ask price