MarketDepthControl
The visual control displaying the order book with quotes (IOrderBookMessage).
Inherits: BaseGridControl
Implements: IComponentConnector
Constructors
public MarketDepthControl()
marketDepthControl = MarketDepthControl()
Initializes a new instance of the MarketDepthControl.
Properties
public bool AllowOwnOrderDragDrop { get; set; }
value = marketDepthControl.AllowOwnOrderDragDrop
marketDepthControl.AllowOwnOrderDragDrop = value
Allow own orders drag and drop.
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.
public TimeSpan AnimationDuration { get; set; }
value = marketDepthControl.AnimationDuration
marketDepthControl.AnimationDuration = value
Animation duration.
public bool AutoUpdateFormat { get; set; }
value = marketDepthControl.AutoUpdateFormat
marketDepthControl.AutoUpdateFormat = value
Automatically update format by Security). By default is on.
public Color CancelAnimationColor { get; set; }
value = marketDepthControl.CancelAnimationColor
marketDepthControl.CancelAnimationColor = value
Cancel animation color.
public IOrderBookMessage DepthData { get; set; }
value = marketDepthControl.DepthData
marketDepthControl.DepthData = value
Depth data for binding. Setting this property updates the order book display.
public Security DepthSecurity { get; set; }
value = marketDepthControl.DepthSecurity
marketDepthControl.DepthSecurity = value
Security for depth data binding.
public Color ErrorAnimationColor { get; set; }
value = marketDepthControl.ErrorAnimationColor
marketDepthControl.ErrorAnimationColor = value
Error animation color.
public Color FillBuyAnimationColor { get; set; }
value = marketDepthControl.FillBuyAnimationColor
marketDepthControl.FillBuyAnimationColor = value
Fill buy animation color.
public Color FillSellAnimationColor { get; set; }
value = marketDepthControl.FillSellAnimationColor
marketDepthControl.FillSellAnimationColor = value
Fill sell animation color.
public Color FillTextAnimationColor { get; set; }
value = marketDepthControl.FillTextAnimationColor
marketDepthControl.FillTextAnimationColor = value
Fill text color.
public decimal? GroupRange { get; set; }
value = marketDepthControl.GroupRange
marketDepthControl.GroupRange = value
Range for Decimal).
public bool IsBidsOnTop { get; set; }
value = marketDepthControl.IsBidsOnTop
marketDepthControl.IsBidsOnTop = value
Whether to show the bids above. The default is off.
public bool IsOwnOrderDragging { get; private set; }
value = marketDepthControl.IsOwnOrderDragging
marketDepthControl.IsOwnOrderDragging = value
True if user is dragging an order.
public decimal MaxBuyVolume { get; set; }
value = marketDepthControl.MaxBuyVolume
marketDepthControl.MaxBuyVolume = value
The maximum volume of all bids.
public int MaxDepth { get; set; }
value = marketDepthControl.MaxDepth
marketDepthControl.MaxDepth = value
The maximum depth of order book display. The default value is DefaultDepth.
public decimal MaxSellVolume { get; set; }
value = marketDepthControl.MaxSellVolume
marketDepthControl.MaxSellVolume = value
The maximum volume of all asks.
public decimal MaxVolume { get; set; }
value = marketDepthControl.MaxVolume
marketDepthControl.MaxVolume = value
The maximum volume of all quotes.
public string PriceTextFormat { get; set; }
value = marketDepthControl.PriceTextFormat
marketDepthControl.PriceTextFormat = value
Price format.
public Color RegisterAnimationColor { get; set; }
value = marketDepthControl.RegisterAnimationColor
marketDepthControl.RegisterAnimationColor = value
Register animation color.
public MarketDepthExecuteOn RegisterOrderOn { get; set; }
value = marketDepthControl.RegisterOrderOn
marketDepthControl.RegisterOrderOn = value
Execute order register trigger.
public QuoteChange? SelectedQuote { get; }
value = marketDepthControl.SelectedQuote
The selected quote.
public bool ShowBoardColumn { get; set; }
value = marketDepthControl.ShowBoardColumn
marketDepthControl.ShowBoardColumn = value
Show Board column.
public bool ShowOwnVolumeColumns { get; set; }
value = marketDepthControl.ShowOwnVolumeColumns
marketDepthControl.ShowOwnVolumeColumns = value
Show own volume columns.
public bool ShowSingleVolumeColumn { get; set; }
value = marketDepthControl.ShowSingleVolumeColumn
marketDepthControl.ShowSingleVolumeColumn = value
Show single Volume column. The default value is .
public decimal? SparseRange { get; set; }
value = marketDepthControl.SparseRange
marketDepthControl.SparseRange = value
Range for Int32).
public bool UseOrderAnimations { get; set; }
value = marketDepthControl.UseOrderAnimations
marketDepthControl.UseOrderAnimations = value
User own order state animations.
public string VolumeTextFormat { get; set; }
value = marketDepthControl.VolumeTextFormat
marketDepthControl.VolumeTextFormat = value
Volume format.
Methods
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.
public MarketDepthColumns GetColumnIndex(GridColumn column)
result = marketDepthControl.GetColumnIndex(column)
To get the column type by cell.
- column
- Column.
Returns: The column type.
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.
public void InitializeComponent()
marketDepthControl.InitializeComponent()
InitializeComponent
protected override void OnLostMouseCapture(MouseEventArgs e)
marketDepthControl.OnLostMouseCapture(e)
Handle the event when mouse capture is lost.
- e
protected override void OnPreviewKeyDown(KeyEventArgs e)
marketDepthControl.OnPreviewKeyDown(e)
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.
public void ProcessOrderFail(OrderFail fail, OrderStates state)
marketDepthControl.ProcessOrderFail(fail, state)
To handle an order register/move/cancel fail.
public void ShowOrderFill(Sides side, decimal price, decimal volume)
marketDepthControl.ShowOrderFill(side, price, volume)
Show order fill animation.
public void UpdateDepth(IOrderBookMessage message, Security security)
marketDepthControl.UpdateDepth(message, security)
To update the order book.
- message
- Market depth.
- security
- Security.
public void UpdateFormat(Security security)
marketDepthControl.UpdateFormat(security)
To update PriceTextFormat and VolumeTextFormat.
- security
- Security.
Events
public event Action<Order> CancelingOrder
marketDepthControl.CancelingOrder += handler
Canceling order.
public event Action<Order, decimal> MovingOrder
marketDepthControl.MovingOrder += handler
Moving order to new price.
public event Action<Sides, decimal> RegisteringOrder
marketDepthControl.RegisteringOrder += handler
Registering order.
public event Action<QuoteChange?> SelectedQuoteChanged
marketDepthControl.SelectedQuoteChanged += handler
SelectedQuote changed event.
Fields
public static readonly DependencyProperty AllowOwnOrderDragDropProperty
value = MarketDepthControl.AllowOwnOrderDragDropProperty
DependencyProperty for AllowOwnOrderDragDrop.
public static readonly DependencyProperty AllowSpreadToMoveProperty
value = MarketDepthControl.AllowSpreadToMoveProperty
DependencyProperty for AllowSpreadToMove.
public static readonly DependencyProperty AnimationDurationProperty
value = MarketDepthControl.AnimationDurationProperty
Animation duration.
public static readonly DependencyProperty CancelAnimationColorProperty
value = MarketDepthControl.CancelAnimationColorProperty
Cancel animation color.
public const int DefaultDepth
value = MarketDepthControl.DefaultDepth
The maximum depth by default which is equal to 20.
public static readonly DependencyProperty DepthDataProperty
value = MarketDepthControl.DepthDataProperty
DependencyProperty for DepthData.
public static readonly DependencyProperty DepthSecurityProperty
value = MarketDepthControl.DepthSecurityProperty
DependencyProperty for DepthSecurity.
public static readonly DependencyProperty ErrorAnimationColorProperty
value = MarketDepthControl.ErrorAnimationColorProperty
Error animation color.
public static readonly DependencyProperty FillBuyAnimationColorProperty
value = MarketDepthControl.FillBuyAnimationColorProperty
Fill buy animation color.
public static readonly DependencyProperty FillSellAnimationColorProperty
value = MarketDepthControl.FillSellAnimationColorProperty
Fill sell animation color.
public static readonly DependencyProperty FillTextAnimationColorProperty
value = MarketDepthControl.FillTextAnimationColorProperty
Fill text color.
public static readonly RoutedCommand GroupCommand
value = MarketDepthControl.GroupCommand
The command for group market depth.
public static readonly DependencyProperty GroupRangeProperty
value = MarketDepthControl.GroupRangeProperty
DependencyProperty for GroupRange.
public static readonly RoutedCommand GroupResetCommand
value = MarketDepthControl.GroupResetCommand
The command for reset grouping market depth.
public static readonly DependencyProperty IsBidsOnTopProperty
value = MarketDepthControl.IsBidsOnTopProperty
DependencyProperty for IsBidsOnTop.
public static readonly DependencyPropertyKey IsOwnOrderDraggingKey
value = MarketDepthControl.IsOwnOrderDraggingKey
True if user is dragging an order.
public static readonly DependencyProperty MaxBuyVolumeProperty
value = MarketDepthControl.MaxBuyVolumeProperty
DependencyProperty for MaxBuyVolume.
public static readonly DependencyProperty MaxDepthProperty
value = MarketDepthControl.MaxDepthProperty
DependencyProperty for MaxDepth.
public static readonly DependencyProperty MaxSellVolumeProperty
value = MarketDepthControl.MaxSellVolumeProperty
DependencyProperty for MaxSellVolume.
public static readonly DependencyProperty MaxVolumeProperty
value = MarketDepthControl.MaxVolumeProperty
DependencyProperty for MaxVolume.
public static readonly DependencyProperty PriceTextFormatProperty
value = MarketDepthControl.PriceTextFormatProperty
DependencyProperty for PriceTextFormat.
public static readonly DependencyProperty RegisterAnimationColorProperty
value = MarketDepthControl.RegisterAnimationColorProperty
Register animation color.
public static readonly DependencyProperty RegisterOrderOnProperty
value = MarketDepthControl.RegisterOrderOnProperty
Execute order register trigger.
public static readonly DependencyProperty ShowBoardColumnProperty
value = MarketDepthControl.ShowBoardColumnProperty
DependencyProperty for ShowBoardColumn.
public static readonly DependencyProperty ShowOwnVolumeColumnsProperty
value = MarketDepthControl.ShowOwnVolumeColumnsProperty
DependencyProperty for ShowOwnVolumeColumns.
public static readonly DependencyProperty ShowSingleVolumeColumnProperty
value = MarketDepthControl.ShowSingleVolumeColumnProperty
DependencyProperty for ShowSingleVolumeColumn.
public static readonly RoutedCommand SparseCommand
value = MarketDepthControl.SparseCommand
The command for sparse market depth.
public static readonly DependencyProperty SparseRangeProperty
value = MarketDepthControl.SparseRangeProperty
DependencyProperty for SparseRange.
public static readonly RoutedCommand SparseResetCommand
value = MarketDepthControl.SparseResetCommand
The command for reset sparsing market depth.
public static readonly DependencyProperty UseOrderAnimationsProperty
value = MarketDepthControl.UseOrderAnimationsProperty
DependencyProperty for UseOrderAnimations.
public static readonly DependencyProperty VolumeTextFormatProperty
value = MarketDepthControl.VolumeTextFormatProperty
DependencyProperty for VolumeTextFormat.