MarketDepthControl

StockSharp.Xaml

The visual control displaying the order book with quotes (IOrderBookMessage).

Inherits: BaseGridControl

Implements: IComponentConnector

Constructors

MarketDepthControl
public MarketDepthControl()
marketDepthControl = MarketDepthControl()

Initializes a new instance of the MarketDepthControl.

Properties

AllowOwnOrderDragDrop
public bool AllowOwnOrderDragDrop { get; set; }
value = marketDepthControl.AllowOwnOrderDragDrop
marketDepthControl.AllowOwnOrderDragDrop = value

Allow own orders drag and drop.

AllowSpreadToMove
public bool AllowSpreadToMove { get; set; }
value = marketDepthControl.AllowSpreadToMove
marketDepthControl.AllowSpreadToMove = value

Gets or sets a value indicating whether the spread is allowed to move. When , the spread can move up and down. When , the spread stays in the middle.

AnimationDuration
public TimeSpan AnimationDuration { get; set; }
value = marketDepthControl.AnimationDuration
marketDepthControl.AnimationDuration = value

Animation duration.

AutoUpdateFormat
public bool AutoUpdateFormat { get; set; }
value = marketDepthControl.AutoUpdateFormat
marketDepthControl.AutoUpdateFormat = value

Automatically update format by Security). By default is on.

CancelAnimationColor
public Color CancelAnimationColor { get; set; }
value = marketDepthControl.CancelAnimationColor
marketDepthControl.CancelAnimationColor = value

Cancel animation color.

DepthData
public IOrderBookMessage DepthData { get; set; }
value = marketDepthControl.DepthData
marketDepthControl.DepthData = value

Depth data for binding. Setting this property updates the order book display.

DepthSecurity
public Security DepthSecurity { get; set; }
value = marketDepthControl.DepthSecurity
marketDepthControl.DepthSecurity = value

Security for depth data binding.

ErrorAnimationColor
public Color ErrorAnimationColor { get; set; }
value = marketDepthControl.ErrorAnimationColor
marketDepthControl.ErrorAnimationColor = value

Error animation color.

FillBuyAnimationColor
public Color FillBuyAnimationColor { get; set; }
value = marketDepthControl.FillBuyAnimationColor
marketDepthControl.FillBuyAnimationColor = value

Fill buy animation color.

FillSellAnimationColor
public Color FillSellAnimationColor { get; set; }
value = marketDepthControl.FillSellAnimationColor
marketDepthControl.FillSellAnimationColor = value

Fill sell animation color.

FillTextAnimationColor
public Color FillTextAnimationColor { get; set; }
value = marketDepthControl.FillTextAnimationColor
marketDepthControl.FillTextAnimationColor = value

Fill text color.

GroupRange
public decimal? GroupRange { get; set; }
value = marketDepthControl.GroupRange
marketDepthControl.GroupRange = value

Range for Decimal).

IsBidsOnTop
public bool IsBidsOnTop { get; set; }
value = marketDepthControl.IsBidsOnTop
marketDepthControl.IsBidsOnTop = value

Whether to show the bids above. The default is off.

IsOwnOrderDragging
public bool IsOwnOrderDragging { get; private set; }
value = marketDepthControl.IsOwnOrderDragging
marketDepthControl.IsOwnOrderDragging = value

True if user is dragging an order.

MaxBuyVolume
public decimal MaxBuyVolume { get; set; }
value = marketDepthControl.MaxBuyVolume
marketDepthControl.MaxBuyVolume = value

The maximum volume of all bids.

MaxDepth
public int MaxDepth { get; set; }
value = marketDepthControl.MaxDepth
marketDepthControl.MaxDepth = value

The maximum depth of order book display. The default value is DefaultDepth.

MaxSellVolume
public decimal MaxSellVolume { get; set; }
value = marketDepthControl.MaxSellVolume
marketDepthControl.MaxSellVolume = value

The maximum volume of all asks.

MaxVolume
public decimal MaxVolume { get; set; }
value = marketDepthControl.MaxVolume
marketDepthControl.MaxVolume = value

The maximum volume of all quotes.

PriceTextFormat
public string PriceTextFormat { get; set; }
value = marketDepthControl.PriceTextFormat
marketDepthControl.PriceTextFormat = value

Price format.

RegisterAnimationColor
public Color RegisterAnimationColor { get; set; }
value = marketDepthControl.RegisterAnimationColor
marketDepthControl.RegisterAnimationColor = value

Register animation color.

RegisterOrderOn
public MarketDepthExecuteOn RegisterOrderOn { get; set; }
value = marketDepthControl.RegisterOrderOn
marketDepthControl.RegisterOrderOn = value

Execute order register trigger.

SelectedQuote
public QuoteChange? SelectedQuote { get; }
value = marketDepthControl.SelectedQuote

The selected quote.

ShowBoardColumn
public bool ShowBoardColumn { get; set; }
value = marketDepthControl.ShowBoardColumn
marketDepthControl.ShowBoardColumn = value

Show Board column.

ShowOwnVolumeColumns
public bool ShowOwnVolumeColumns { get; set; }
value = marketDepthControl.ShowOwnVolumeColumns
marketDepthControl.ShowOwnVolumeColumns = value

Show own volume columns.

ShowSingleVolumeColumn
public bool ShowSingleVolumeColumn { get; set; }
value = marketDepthControl.ShowSingleVolumeColumn
marketDepthControl.ShowSingleVolumeColumn = value

Show single Volume column. The default value is .

SparseRange
public decimal? SparseRange { get; set; }
value = marketDepthControl.SparseRange
marketDepthControl.SparseRange = value

Range for Int32).

UseOrderAnimations
public bool UseOrderAnimations { get; set; }
value = marketDepthControl.UseOrderAnimations
marketDepthControl.UseOrderAnimations = value

User own order state animations.

VolumeTextFormat
public string VolumeTextFormat { get; set; }
value = marketDepthControl.VolumeTextFormat
marketDepthControl.VolumeTextFormat = value

Volume format.

Methods

CancelOrders
public void CancelOrders(Func<Order, bool> predicate)
marketDepthControl.CancelOrders(predicate)

Cancel orders that were added to this instance of MarketDepthControl. This method does not cancel orders by itself. It just notifies subscribers with CancelingOrder event.

Clear
public void Clear()
marketDepthControl.Clear()

To clear the order book.

GetColumnIndex
public MarketDepthColumns GetColumnIndex(GridColumn column)
result = marketDepthControl.GetColumnIndex(column)

To get the column type by cell.

column
Column.

Returns: The column type.

GetOrders
public IEnumerable<Order> GetOrders(decimal price, Sides? side, OrderTypes? type)
result = marketDepthControl.GetOrders(price, side, type)

Get active orders by specified criteria.

price
Order price.
side
Order side (buy or sell).
type
Order type.

Returns: Found orders.

InitializeComponent
public void InitializeComponent()
marketDepthControl.InitializeComponent()

InitializeComponent

OnLostMouseCapture
protected override void OnLostMouseCapture(MouseEventArgs e)
marketDepthControl.OnLostMouseCapture(e)

Handle the event when mouse capture is lost.

e
OnPreviewKeyDown
protected override void OnPreviewKeyDown(KeyEventArgs e)
marketDepthControl.OnPreviewKeyDown(e)
ProcessOrder
public void ProcessOrder(Order order, decimal price, decimal balance, OrderStates state)
marketDepthControl.ProcessOrder(order, price, balance, state)

To handle an order.

order
Order.
price
Order price.
balance
Order contracts balance.
state
Order state.
ProcessOrderFail
public void ProcessOrderFail(OrderFail fail, OrderStates state)
marketDepthControl.ProcessOrderFail(fail, state)

To handle an order register/move/cancel fail.

ShowOrderFill
public void ShowOrderFill(Sides side, decimal price, decimal volume)
marketDepthControl.ShowOrderFill(side, price, volume)

Show order fill animation.

UpdateDepth
public void UpdateDepth(IOrderBookMessage message, Security security)
marketDepthControl.UpdateDepth(message, security)

To update the order book.

message
Market depth.
security
Security.
UpdateFormat
public void UpdateFormat(Security security)
marketDepthControl.UpdateFormat(security)

To update PriceTextFormat and VolumeTextFormat.

security
Security.

Events

CancelingOrder
public event Action<Order> CancelingOrder
marketDepthControl.CancelingOrder += handler

Canceling order.

MovingOrder
public event Action<Order, decimal> MovingOrder
marketDepthControl.MovingOrder += handler

Moving order to new price.

RegisteringOrder
public event Action<Sides, decimal> RegisteringOrder
marketDepthControl.RegisteringOrder += handler

Registering order.

SelectedQuoteChanged
public event Action<QuoteChange?> SelectedQuoteChanged
marketDepthControl.SelectedQuoteChanged += handler

SelectedQuote changed event.

Fields

AllowOwnOrderDragDropProperty
public static readonly DependencyProperty AllowOwnOrderDragDropProperty
value = MarketDepthControl.AllowOwnOrderDragDropProperty

DependencyProperty for AllowOwnOrderDragDrop.

AllowSpreadToMoveProperty
public static readonly DependencyProperty AllowSpreadToMoveProperty
value = MarketDepthControl.AllowSpreadToMoveProperty

DependencyProperty for AllowSpreadToMove.

AnimationDurationProperty
public static readonly DependencyProperty AnimationDurationProperty
value = MarketDepthControl.AnimationDurationProperty

Animation duration.

CancelAnimationColorProperty
public static readonly DependencyProperty CancelAnimationColorProperty
value = MarketDepthControl.CancelAnimationColorProperty

Cancel animation color.

DefaultDepth
public const int DefaultDepth
value = MarketDepthControl.DefaultDepth

The maximum depth by default which is equal to 20.

DepthDataProperty
public static readonly DependencyProperty DepthDataProperty
value = MarketDepthControl.DepthDataProperty

DependencyProperty for DepthData.

DepthSecurityProperty
public static readonly DependencyProperty DepthSecurityProperty
value = MarketDepthControl.DepthSecurityProperty

DependencyProperty for DepthSecurity.

ErrorAnimationColorProperty
public static readonly DependencyProperty ErrorAnimationColorProperty
value = MarketDepthControl.ErrorAnimationColorProperty

Error animation color.

FillBuyAnimationColorProperty
public static readonly DependencyProperty FillBuyAnimationColorProperty
value = MarketDepthControl.FillBuyAnimationColorProperty

Fill buy animation color.

FillSellAnimationColorProperty
public static readonly DependencyProperty FillSellAnimationColorProperty
value = MarketDepthControl.FillSellAnimationColorProperty

Fill sell animation color.

FillTextAnimationColorProperty
public static readonly DependencyProperty FillTextAnimationColorProperty
value = MarketDepthControl.FillTextAnimationColorProperty

Fill text color.

GroupCommand
public static readonly RoutedCommand GroupCommand
value = MarketDepthControl.GroupCommand

The command for group market depth.

GroupRangeProperty
public static readonly DependencyProperty GroupRangeProperty
value = MarketDepthControl.GroupRangeProperty

DependencyProperty for GroupRange.

GroupResetCommand
public static readonly RoutedCommand GroupResetCommand
value = MarketDepthControl.GroupResetCommand

The command for reset grouping market depth.

IsBidsOnTopProperty
public static readonly DependencyProperty IsBidsOnTopProperty
value = MarketDepthControl.IsBidsOnTopProperty

DependencyProperty for IsBidsOnTop.

IsOwnOrderDraggingKey
public static readonly DependencyPropertyKey IsOwnOrderDraggingKey
value = MarketDepthControl.IsOwnOrderDraggingKey

True if user is dragging an order.

MaxBuyVolumeProperty
public static readonly DependencyProperty MaxBuyVolumeProperty
value = MarketDepthControl.MaxBuyVolumeProperty

DependencyProperty for MaxBuyVolume.

MaxDepthProperty
public static readonly DependencyProperty MaxDepthProperty
value = MarketDepthControl.MaxDepthProperty

DependencyProperty for MaxDepth.

MaxSellVolumeProperty
public static readonly DependencyProperty MaxSellVolumeProperty
value = MarketDepthControl.MaxSellVolumeProperty

DependencyProperty for MaxSellVolume.

MaxVolumeProperty
public static readonly DependencyProperty MaxVolumeProperty
value = MarketDepthControl.MaxVolumeProperty

DependencyProperty for MaxVolume.

PriceTextFormatProperty
public static readonly DependencyProperty PriceTextFormatProperty
value = MarketDepthControl.PriceTextFormatProperty

DependencyProperty for PriceTextFormat.

RegisterAnimationColorProperty
public static readonly DependencyProperty RegisterAnimationColorProperty
value = MarketDepthControl.RegisterAnimationColorProperty

Register animation color.

RegisterOrderOnProperty
public static readonly DependencyProperty RegisterOrderOnProperty
value = MarketDepthControl.RegisterOrderOnProperty

Execute order register trigger.

ShowBoardColumnProperty
public static readonly DependencyProperty ShowBoardColumnProperty
value = MarketDepthControl.ShowBoardColumnProperty

DependencyProperty for ShowBoardColumn.

ShowOwnVolumeColumnsProperty
public static readonly DependencyProperty ShowOwnVolumeColumnsProperty
value = MarketDepthControl.ShowOwnVolumeColumnsProperty

DependencyProperty for ShowOwnVolumeColumns.

ShowSingleVolumeColumnProperty
public static readonly DependencyProperty ShowSingleVolumeColumnProperty
value = MarketDepthControl.ShowSingleVolumeColumnProperty

DependencyProperty for ShowSingleVolumeColumn.

SparseCommand
public static readonly RoutedCommand SparseCommand
value = MarketDepthControl.SparseCommand

The command for sparse market depth.

SparseRangeProperty
public static readonly DependencyProperty SparseRangeProperty
value = MarketDepthControl.SparseRangeProperty

DependencyProperty for SparseRange.

SparseResetCommand
public static readonly RoutedCommand SparseResetCommand
value = MarketDepthControl.SparseResetCommand

The command for reset sparsing market depth.

UseOrderAnimationsProperty
public static readonly DependencyProperty UseOrderAnimationsProperty
value = MarketDepthControl.UseOrderAnimationsProperty

DependencyProperty for UseOrderAnimations.

VolumeTextFormatProperty
public static readonly DependencyProperty VolumeTextFormatProperty
value = MarketDepthControl.VolumeTextFormatProperty

DependencyProperty for VolumeTextFormat.