Loading...
Searching...
No Matches
ATAS.Indicators.SmartDom.SmartDomColumn Class Referenceabstract

Base class of a SmartDOM column written in a custom assembly. Derive from it, mark the class with SmartDomColumnAttribute, give it a public parameterless constructor and override OnDrawCell; the other hooks are optional. More...

Protected Member Functions

virtual void OnInitialize ()
 Called when the column is attached to a SmartDOM (normally once per instance), after its saved settings were restored. Context is available from here on.
 
virtual void OnInstrumentChanged ()
 Called after the SmartDOM switched to another instrument: reset the accumulated data here.
 
virtual void OnSettingsChanged ()
 Called after the column settings changed (and once after OnInitialize).
 
virtual void OnNewTrades (IReadOnlyList< MarketDataArg > trades)
 New trades of the instrument, oldest first. Do not keep the list: it belongs to this call.
 
virtual void OnMarketDepthChanged (IReadOnlyList< MarketDataArg > levels)
 Changed order book levels (MarketDataArg.DataType is MarketDataType.Bid or MarketDataType.Ask; a zero volume removes the level). The current book is available through ISmartDomColumnContext.GetBidVolume, ISmartDomColumnContext.GetAskVolume and ISmartDomColumnContext.GetDepth.
 
virtual void OnBestBidAskChanged (MarketDataArg bestPrice)
 The best bid or the best ask changed (MarketDataArg.DataType tells which).
 
virtual void OnTimer ()
 Called about ten times per second while the SmartDOM is visible.
 
virtual void OnDrawHeader (RenderContext context, Rectangle bounds, string text)
 Draws the column header. The default implementation fills the header with the standard header background and draws text (the header set by the user) in its center.
 
virtual void OnDrawColumn (RenderContext context, Rectangle bounds)
 Called once per frame before the cells are drawn, with the rectangle of the whole column (header included). Use it for drawings that span several rows.
 
abstract void OnDrawCell (RenderContext context, SmartDomCell cell)
 Draws one cell. The platform has already filled the cell with the column background; draw the content within SmartDomCell.Bounds. Called for every visible row of every frame — keep it cheap.
 
virtual bool OnCellClick (SmartDomCell cell, RenderControlMouseEventArgs e)
 The user clicked a cell of the column. Return true if the column handled the click (the SmartDOM then shows no context menu for a right click).
 
virtual void OnDispose ()
 The platform stops using this instance: the column was removed from the SmartDOM or its layout was replaced, the SmartDOM was closed (also when the workspace is switched or the platform exits), the column was stopped by an error, the tariff no longer allows custom columns, its settings were replaced as a whole, or the assembly was reloaded. Called exactly once for every instance whose constructor completed, even if OnInitialize was not reached or threw. Release what the column created (timers, files, subscriptions to your own services, native resources) here; no other method is called afterwards. An exception thrown here is logged and ignored.
 

Properties

ISmartDomColumnContext Context [get]
 The SmartDOM the column is shown in. Available from OnInitialize on.
 
bool IsAttached [get]
 True once the column is attached to a SmartDOM (Context is available).
 

Detailed Description

Base class of a SmartDOM column written in a custom assembly. Derive from it, mark the class with SmartDomColumnAttribute, give it a public parameterless constructor and override OnDrawCell; the other hooks are optional.

The platform never calls one column instance concurrently: data callbacks, the timer and the drawing are serialized, so the column needs no locks for its own fields. Data callbacks are delivered on a platform thread shortly after the data arrives (in arrival order), never on the thread of the data feed.

Public read/write properties are the column settings: they are shown in the column settings (use [Display] for names, groups and order, [Browsable(false)] to hide one) and saved with the workspace. OnSettingsChanged is called after the user changed them.

If an override throws, the platform logs the exception, releases the instance (OnDispose) and shows the error in the column header; changing one of the column settings or loading the layout again starts a new instance with the saved settings.

Member Function Documentation

◆ OnBestBidAskChanged()

virtual void ATAS.Indicators.SmartDom.SmartDomColumn.OnBestBidAskChanged ( MarketDataArg  bestPrice)
protectedvirtual

The best bid or the best ask changed (MarketDataArg.DataType tells which).

◆ OnCellClick()

virtual bool ATAS.Indicators.SmartDom.SmartDomColumn.OnCellClick ( SmartDomCell  cell,
RenderControlMouseEventArgs  e 
)
protectedvirtual

The user clicked a cell of the column. Return true if the column handled the click (the SmartDOM then shows no context menu for a right click).

◆ OnDispose()

virtual void ATAS.Indicators.SmartDom.SmartDomColumn.OnDispose ( )
protectedvirtual

The platform stops using this instance: the column was removed from the SmartDOM or its layout was replaced, the SmartDOM was closed (also when the workspace is switched or the platform exits), the column was stopped by an error, the tariff no longer allows custom columns, its settings were replaced as a whole, or the assembly was reloaded. Called exactly once for every instance whose constructor completed, even if OnInitialize was not reached or threw. Release what the column created (timers, files, subscriptions to your own services, native resources) here; no other method is called afterwards. An exception thrown here is logged and ignored.

◆ OnDrawCell()

abstract void ATAS.Indicators.SmartDom.SmartDomColumn.OnDrawCell ( RenderContext  context,
SmartDomCell  cell 
)
protectedpure virtual

Draws one cell. The platform has already filled the cell with the column background; draw the content within SmartDomCell.Bounds. Called for every visible row of every frame — keep it cheap.

◆ OnDrawColumn()

virtual void ATAS.Indicators.SmartDom.SmartDomColumn.OnDrawColumn ( RenderContext  context,
Rectangle  bounds 
)
protectedvirtual

Called once per frame before the cells are drawn, with the rectangle of the whole column (header included). Use it for drawings that span several rows.

◆ OnDrawHeader()

virtual void ATAS.Indicators.SmartDom.SmartDomColumn.OnDrawHeader ( RenderContext  context,
Rectangle  bounds,
string  text 
)
protectedvirtual

Draws the column header. The default implementation fills the header with the standard header background and draws text (the header set by the user) in its center.

◆ OnInitialize()

virtual void ATAS.Indicators.SmartDom.SmartDomColumn.OnInitialize ( )
protectedvirtual

Called when the column is attached to a SmartDOM (normally once per instance), after its saved settings were restored. Context is available from here on.

◆ OnInstrumentChanged()

virtual void ATAS.Indicators.SmartDom.SmartDomColumn.OnInstrumentChanged ( )
protectedvirtual

Called after the SmartDOM switched to another instrument: reset the accumulated data here.

◆ OnMarketDepthChanged()

virtual void ATAS.Indicators.SmartDom.SmartDomColumn.OnMarketDepthChanged ( IReadOnlyList< MarketDataArg >  levels)
protectedvirtual

Changed order book levels (MarketDataArg.DataType is MarketDataType.Bid or MarketDataType.Ask; a zero volume removes the level). The current book is available through ISmartDomColumnContext.GetBidVolume, ISmartDomColumnContext.GetAskVolume and ISmartDomColumnContext.GetDepth.

◆ OnNewTrades()

virtual void ATAS.Indicators.SmartDom.SmartDomColumn.OnNewTrades ( IReadOnlyList< MarketDataArg >  trades)
protectedvirtual

New trades of the instrument, oldest first. Do not keep the list: it belongs to this call.

◆ OnSettingsChanged()

virtual void ATAS.Indicators.SmartDom.SmartDomColumn.OnSettingsChanged ( )
protectedvirtual

Called after the column settings changed (and once after OnInitialize).

◆ OnTimer()

virtual void ATAS.Indicators.SmartDom.SmartDomColumn.OnTimer ( )
protectedvirtual

Called about ten times per second while the SmartDOM is visible.

Property Documentation

◆ Context

ISmartDomColumnContext ATAS.Indicators.SmartDom.SmartDomColumn.Context
getprotected

The SmartDOM the column is shown in. Available from OnInitialize on.

Exceptions
InvalidOperationExceptionThe column is not attached to a SmartDOM yet.

◆ IsAttached

bool ATAS.Indicators.SmartDom.SmartDomColumn.IsAttached
getprotected

True once the column is attached to a SmartDOM (Context is available).


The documentation for this class was generated from the following file: