Loading...
Searching...
No Matches
ATAS.Indicators.Watchlist.WatchlistColumn Class Reference

Base class of a Watchlist column written in a custom assembly. Derive from it, mark the class with WatchlistColumnAttribute and give it a public parameterless constructor. The column computes the cell of one instrument: the platform creates one instance per Watchlist row, attaches it to the row's instrument, feeds it the instrument data and shows what the column publishes in Value. More...

Protected Member Functions

virtual void OnInitialize ()
 Called once per instance when it is attached to its row, after the saved settings were restored. Instrument is available from here on. The current statistics of the instrument follow in OnSummaryChanged right after OnSettingsChanged, when the feed has reported them.
 
virtual void OnSettingsChanged ()
 Called after OnInitialize; reserved for setting changes made by the user.
 
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 OnBestBidAskChanged (MarketDataArg bestPrice)
 The best bid or the best ask changed (MarketDataArg.DataType tells which). The latest value is delivered: changes that happen faster than the platform delivers them are merged.
 
virtual void OnSummaryChanged (InstrumentDailySummary summary)
 The exchange statistics of the instrument (day open/high/low, volume, previous close, …) changed. The latest value is delivered: changes that happen faster than the platform delivers them are merged.
 
virtual void OnTimer ()
 Called about once per second for every row while the column is shown.
 
virtual void OnDispose ()
 The platform stops using this instance: the column was hidden, its row or the column was removed, the Watchlist 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 instance 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

IInstrumentInfo Instrument [get]
 The instrument of the row. Available from OnInitialize on. IInstrumentInfo.TimeZone / IInstrumentInfo.TimeZoneOffset are the time zone set for the instrument in the platform, as chart indicators of the instrument get them (read when the instance is attached to the row).
 
bool IsAttached [get]
 True once the column is attached to a row (Instrument is available).
 
WatchlistCellValue? Value [get, set]
 The cell the Watchlist shows for the row; null (the default) shows an empty cell. Assign a new value whenever the content changes: the platform redraws the Watchlist on its next update.
 

Detailed Description

Base class of a Watchlist column written in a custom assembly. Derive from it, mark the class with WatchlistColumnAttribute and give it a public parameterless constructor. The column computes the cell of one instrument: the platform creates one instance per Watchlist row, attaches it to the row's instrument, feeds it the instrument data and shows what the column publishes in Value.

The platform never calls one instance concurrently: the data callbacks and the timer are serialized (all rows of a column share one lock), so the column needs no locks for its own fields. They are delivered on a platform thread shortly after the data arrives, never on the thread of the data feed, and never while the Watchlist is drawn.

The column does not draw: it publishes a WatchlistCellValue (text, optional sort number and colors) and the platform draws, sorts and selects the cells like the built-in ones, identically in ATAS and ATAS X.

Public read/write properties are the column settings: they are saved with the workspace and the Watchlist lists and restored into every row instance before OnInitialize.

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

Member Function Documentation

◆ OnBestBidAskChanged()

virtual void ATAS.Indicators.Watchlist.WatchlistColumn.OnBestBidAskChanged ( MarketDataArg  bestPrice)
protectedvirtual

The best bid or the best ask changed (MarketDataArg.DataType tells which). The latest value is delivered: changes that happen faster than the platform delivers them are merged.

◆ OnDispose()

virtual void ATAS.Indicators.Watchlist.WatchlistColumn.OnDispose ( )
protectedvirtual

The platform stops using this instance: the column was hidden, its row or the column was removed, the Watchlist 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 instance 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.

◆ OnInitialize()

virtual void ATAS.Indicators.Watchlist.WatchlistColumn.OnInitialize ( )
protectedvirtual

Called once per instance when it is attached to its row, after the saved settings were restored. Instrument is available from here on. The current statistics of the instrument follow in OnSummaryChanged right after OnSettingsChanged, when the feed has reported them.

◆ OnNewTrades()

virtual void ATAS.Indicators.Watchlist.WatchlistColumn.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.Watchlist.WatchlistColumn.OnSettingsChanged ( )
protectedvirtual

Called after OnInitialize; reserved for setting changes made by the user.

◆ OnSummaryChanged()

virtual void ATAS.Indicators.Watchlist.WatchlistColumn.OnSummaryChanged ( InstrumentDailySummary  summary)
protectedvirtual

The exchange statistics of the instrument (day open/high/low, volume, previous close, …) changed. The latest value is delivered: changes that happen faster than the platform delivers them are merged.

◆ OnTimer()

virtual void ATAS.Indicators.Watchlist.WatchlistColumn.OnTimer ( )
protectedvirtual

Called about once per second for every row while the column is shown.

Property Documentation

◆ Instrument

IInstrumentInfo ATAS.Indicators.Watchlist.WatchlistColumn.Instrument
getprotected

The instrument of the row. Available from OnInitialize on. IInstrumentInfo.TimeZone / IInstrumentInfo.TimeZoneOffset are the time zone set for the instrument in the platform, as chart indicators of the instrument get them (read when the instance is attached to the row).

Exceptions
InvalidOperationExceptionThe column is not attached to a row yet.

◆ IsAttached

bool ATAS.Indicators.Watchlist.WatchlistColumn.IsAttached
getprotected

True once the column is attached to a row (Instrument is available).

◆ Value

WatchlistCellValue? ATAS.Indicators.Watchlist.WatchlistColumn.Value
getsetprotected

The cell the Watchlist shows for the row; null (the default) shows an empty cell. Assign a new value whenever the content changes: the platform redraws the Watchlist on its next update.


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