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...
|
| 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.
|
| |
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.