Table of Contents

Class MarketDepthControl

Namespace
StockSharp.Xaml
Assembly
StockSharp.Xaml.dll

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

public class MarketDepthControl : BaseGridControl, IPersistable, IComponentConnector
Inheritance
MarketDepthControl
Implements
IPersistable
Inherited Members
Extension Methods

Constructors

MarketDepthControl()

Initializes a new instance of the MarketDepthControl.

public MarketDepthControl()

Fields

AllowOwnOrderDragDropProperty

public static readonly DependencyProperty AllowOwnOrderDragDropProperty

Field Value

DependencyProperty

AllowSpreadToMoveProperty

public static readonly DependencyProperty AllowSpreadToMoveProperty

Field Value

DependencyProperty

AnimationDurationProperty

Animation duration.

public static readonly DependencyProperty AnimationDurationProperty

Field Value

DependencyProperty

CancelAnimationColorProperty

Cancel animation color.

public static readonly DependencyProperty CancelAnimationColorProperty

Field Value

DependencyProperty

DefaultDepth

The maximum depth by default which is equal to 20.

public const int DefaultDepth = 20

Field Value

int

ErrorAnimationColorProperty

Error animation color.

public static readonly DependencyProperty ErrorAnimationColorProperty

Field Value

DependencyProperty

FillAnimationColorProperty

Fill animation color.

public static readonly DependencyProperty FillAnimationColorProperty

Field Value

DependencyProperty

FillBuyAnimationColorProperty

Fill buy animation color.

public static readonly DependencyProperty FillBuyAnimationColorProperty

Field Value

DependencyProperty

FillSellAnimationColorProperty

Fill sell animation color.

public static readonly DependencyProperty FillSellAnimationColorProperty

Field Value

DependencyProperty

FillTextAnimationColorProperty

Fill text color.

public static readonly DependencyProperty FillTextAnimationColorProperty

Field Value

DependencyProperty

GroupCommand

The command for group market depth.

public static readonly RoutedCommand GroupCommand

Field Value

RoutedCommand

GroupResetCommand

The command for reset grouping market depth.

public static readonly RoutedCommand GroupResetCommand

Field Value

RoutedCommand

IsBidsOnTopProperty

public static readonly DependencyProperty IsBidsOnTopProperty

Field Value

DependencyProperty

IsOwnOrderDraggingKey

True if user is dragging an order.

public static readonly DependencyPropertyKey IsOwnOrderDraggingKey

Field Value

DependencyPropertyKey

MaxBuyVolumeProperty

public static readonly DependencyProperty MaxBuyVolumeProperty

Field Value

DependencyProperty

MaxDepthProperty

public static readonly DependencyProperty MaxDepthProperty

Field Value

DependencyProperty

MaxSellVolumeProperty

public static readonly DependencyProperty MaxSellVolumeProperty

Field Value

DependencyProperty

MaxVolumeProperty

public static readonly DependencyProperty MaxVolumeProperty

Field Value

DependencyProperty

PriceTextFormatProperty

public static readonly DependencyProperty PriceTextFormatProperty

Field Value

DependencyProperty

RegisterAnimationColorProperty

Register animation color.

public static readonly DependencyProperty RegisterAnimationColorProperty

Field Value

DependencyProperty

RegisterOrderOnProperty

Execute order register trigger.

public static readonly DependencyProperty RegisterOrderOnProperty

Field Value

DependencyProperty

ShowBoardColumnProperty

public static readonly DependencyProperty ShowBoardColumnProperty

Field Value

DependencyProperty

ShowOwnVolumeColumnsProperty

public static readonly DependencyProperty ShowOwnVolumeColumnsProperty

Field Value

DependencyProperty

ShowSingleVolumeColumnProperty

public static readonly DependencyProperty ShowSingleVolumeColumnProperty

Field Value

DependencyProperty

SparseCommand

The command for sparse market depth.

public static readonly RoutedCommand SparseCommand

Field Value

RoutedCommand

SparseResetCommand

The command for reset sparsing market depth.

public static readonly RoutedCommand SparseResetCommand

Field Value

RoutedCommand

UseOrderAnimationsProperty

public static readonly DependencyProperty UseOrderAnimationsProperty

Field Value

DependencyProperty

VolumeTextFormatProperty

public static readonly DependencyProperty VolumeTextFormatProperty

Field Value

DependencyProperty

Properties

AllowOwnOrderDragDrop

Allow own orders drag and drop.

public bool AllowOwnOrderDragDrop { get; set; }

Property Value

bool

AllowSpreadToMove

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

public bool AllowSpreadToMove { get; set; }

Property Value

bool

AnimationDuration

Animation duration.

public TimeSpan AnimationDuration { get; set; }

Property Value

TimeSpan

AutoUpdateFormat

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

public bool AutoUpdateFormat { get; set; }

Property Value

bool

CancelAnimationColor

Cancel animation color.

public Color CancelAnimationColor { get; set; }

Property Value

Color

ErrorAnimationColor

Error animation color.

public Color ErrorAnimationColor { get; set; }

Property Value

Color

FillAnimationColor

Fill animation color.

public Color FillAnimationColor { get; set; }

Property Value

Color

FillBuyAnimationColor

Fill buy animation color.

public Color FillBuyAnimationColor { get; set; }

Property Value

Color

FillSellAnimationColor

Fill sell animation color.

public Color FillSellAnimationColor { get; set; }

Property Value

Color

FillTextAnimationColor

Fill text color.

public Color FillTextAnimationColor { get; set; }

Property Value

Color

GroupRange

public decimal? GroupRange { get; set; }

Property Value

decimal?

IsBidsOnTop

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

public bool IsBidsOnTop { get; set; }

Property Value

bool

IsOwnOrderDragging

True if user is dragging an order.

public bool IsOwnOrderDragging { get; }

Property Value

bool

MaxBuyVolume

The maximum volume of all bids.

public decimal MaxBuyVolume { get; set; }

Property Value

decimal

MaxDepth

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

public int MaxDepth { get; set; }

Property Value

int

MaxSellVolume

The maximum volume of all asks.

public decimal MaxSellVolume { get; set; }

Property Value

decimal

MaxVolume

The maximum volume of all quotes.

public decimal MaxVolume { get; set; }

Property Value

decimal

PriceTextFormat

Price format.

public string PriceTextFormat { get; set; }

Property Value

string

RegisterAnimationColor

Register animation color.

public Color RegisterAnimationColor { get; set; }

Property Value

Color

RegisterOrderOn

Execute order register trigger.

public MarketDepthExecuteOn RegisterOrderOn { get; set; }

Property Value

MarketDepthExecuteOn

SelectedQuote

The selected quote.

public QuoteChange? SelectedQuote { get; }

Property Value

QuoteChange?

ShowBoardColumn

Show Board column.

public bool ShowBoardColumn { get; set; }

Property Value

bool

ShowOwnVolumeColumns

Show own volume columns.

public bool ShowOwnVolumeColumns { get; set; }

Property Value

bool

ShowSingleVolumeColumn

Show single Volume column. The default value is false.

public bool ShowSingleVolumeColumn { get; set; }

Property Value

bool

SparseRange

public decimal? SparseRange { get; set; }

Property Value

decimal?

UseOrderAnimations

User own order state animations.

public bool UseOrderAnimations { get; set; }

Property Value

bool

VolumeTextFormat

Volume format.

public string VolumeTextFormat { get; set; }

Property Value

string

Methods

CancelOrders(Func<Order, bool>)

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.

public void CancelOrders(Func<Order, bool> predicate = null)

Parameters

predicate Func<Order, bool>

Clear()

To clear the order book.

public void Clear()

GetColumnIndex(GridColumn)

To get the column type by cell.

public MarketDepthColumns GetColumnIndex(GridColumn column)

Parameters

column GridColumn

Column.

Returns

MarketDepthColumns

The column type.

GetOrders(decimal, Sides?, OrderTypes?)

Get active orders by specified criteria.

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

Parameters

price decimal

Order price.

side Sides?

Order side (buy or sell).

type OrderTypes?

Order type.

Returns

IEnumerable<Order>

Found orders.

InitializeComponent()

InitializeComponent

public void InitializeComponent()

Load(SettingsStorage)

Load settings.

public override void Load(SettingsStorage storage)

Parameters

storage SettingsStorage

Settings storage.

OnLostMouseCapture(MouseEventArgs)

protected override void OnLostMouseCapture(MouseEventArgs e)

Parameters

e MouseEventArgs

OnPreviewKeyDown(KeyEventArgs)

protected override void OnPreviewKeyDown(KeyEventArgs e)

Parameters

e KeyEventArgs

ProcessOrder(Order, decimal, decimal, OrderStates)

To handle an order.

public void ProcessOrder(Order order, decimal price, decimal balance, OrderStates state)

Parameters

order Order

Order.

price decimal

Order price.

balance decimal

Order contracts balance.

state OrderStates

Order state.

ProcessOrderFail(OrderFail, OrderStates)

To handle an order register/move/cancel fail.

public void ProcessOrderFail(OrderFail fail, OrderStates state)

Parameters

fail OrderFail
state OrderStates

Save(SettingsStorage)

Save settings.

public override void Save(SettingsStorage storage)

Parameters

storage SettingsStorage

Settings storage.

ShowOrderFill(Sides, decimal, decimal)

Show order fill animation.

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

Parameters

side Sides
price decimal
volume decimal

UpdateDepth(IOrderBookMessage, Security)

To update the order book.

public void UpdateDepth(IOrderBookMessage message, Security security = null)

Parameters

message IOrderBookMessage

Market depth.

security Security

Security.

UpdateFormat(Security)

public void UpdateFormat(Security security)

Parameters

security Security

Security.

Events

CancelingOrder

Canceling order.

public event Action<Order> CancelingOrder

Event Type

Action<Order>

MovingOrder

Moving order to new price.

public event Action<Order, decimal> MovingOrder

Event Type

Action<Order, decimal>

RegisteringOrder

Registering order.

public event Action<Sides, decimal> RegisteringOrder

Event Type

Action<Sides, decimal>

SelectedQuoteChanged

SelectedQuote changed event.

public event Action<QuoteChange?> SelectedQuoteChanged

Event Type

Action<QuoteChange?>