Read-only view of the panel (ATAS) or widget (ATAS X) a PlatformModule is shown in: the selected instrument and its latest market data, the size of the client area and the drawing resources of the platform theme. Available through PlatformModule.Context from PlatformModule.OnInitialize on.
More...
|
| IReadOnlyList< MarketDataArg > | GetDepth (bool isAsk) |
| | The bid (isAsk = false) or ask levels of the order book of Instrument, best first: the book taken when the instrument was delivered to the module plus the changes delivered since (copies). Empty while no instrument is selected or the feed provides no order book.
|
| |
| string | FormatPrice (decimal price) |
| | Formats a price with the number of decimals of the instrument tick size.
|
| |
| void | Redraw () |
| | Asks the platform to draw a new frame (calls are merged; the frame is drawn shortly afterwards).
|
| |
| IPlatformModuleInstrument? | AddInstrument (string codeOrId, string? exchange=null, bool withDepth=false) |
| | Asks for the market data of an instrument other than the selected one: its trades, best bid/ask and exchange statistics (and its order book when withDepth is set) are then delivered to the overloads of the data callbacks of PlatformModule that take the instrument. The subscription follows the rules of the platform (data permissions, market replay, the tariff): see IPlatformModuleInstrument.State.
|
| |
| bool | RemoveInstrument (IPlatformModuleInstrument instrument) |
| | Stops the data of an instrument added with AddInstrument. False if it was not added.
|
| |
| IReadOnlyList< PlatformModuleInstrumentInfo > | FindInstruments (string text, int maxCount=20) |
| | Searches the instruments the platform knows (those of the connected data sources) by a part of the code or the name, best matches first (at most 100). Pass PlatformModuleInstrumentInfo.Id of a result to AddInstrument.
|
| |
|
| IInstrumentInfo? | Instrument [get] |
| | The instrument selected in the panel, or null while none is selected. 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 instrument is selected).
|
| |
| MarketDataArg? | BestBid [get] |
| | Best bid (price and volume) of Instrument, or null while unknown.
|
| |
| MarketDataArg? | BestAsk [get] |
| | Best ask (price and volume) of Instrument, or null while unknown.
|
| |
| MarketDataArg? | LastTrade [get] |
| | The last trade of Instrument delivered to the module, or null while there was none.
|
| |
| InstrumentDailySummary? | Summary [get] |
| | The exchange statistics of Instrument (day open/high/low, volume, previous close, …), or null while the data feed has not reported them.
|
| |
| Size | Size [get] |
| | Size of the client area of the module in pixels (the bounds passed to PlatformModule.OnRender).
|
| |
| Color | BackgroundColor [get] |
| | Background color of the platform theme.
|
| |
| Color | TextColor [get] |
| | Text color of the platform theme.
|
| |
| RenderFont | Font [get] |
| | Regular font of the platform for texts drawn by the module.
|
| |
| IList< PlatformModuleButton > | Buttons [get] |
| | The buttons the module shows in the header of its panel, in order (at most MaxButtons). Add, remove or change them from the callbacks of the module at any time: the header follows. The list is empty for a new module instance; the buttons disappear when the instance is released (an error, the tariff, a reload).
|
| |
| int | MaxButtons [get] |
| | The largest number of Buttons; adding more throws System.InvalidOperationException.
|
| |
| PlatformModuleStandardButtons | HiddenStandardButtons [get, set] |
| | The standard buttons of the panel header the module hides. Nothing is hidden for a new module instance. See PlatformModuleStandardButtons for what each platform honours.
|
| |
| IReadOnlyList< IPlatformModuleInstrument > | AdditionalInstruments [get] |
| | The instruments the module added with AddInstrument, in the order they were added. Empty for a new module instance: a module that keeps its instruments in its settings adds them again in PlatformModule.OnInitialize.
|
| |
| int | MaxAdditionalInstruments [get] |
| | The largest number of AdditionalInstruments of one module.
|
| |
Read-only view of the panel (ATAS) or widget (ATAS X) a PlatformModule is shown in: the selected instrument and its latest market data, the size of the client area and the drawing resources of the platform theme. Available through PlatformModule.Context from PlatformModule.OnInitialize on.
The market data members return the state as of the last data delivered to the module: they agree with the callbacks the module has already received, and they do not change while one of its methods runs.
◆ AddInstrument()
| IPlatformModuleInstrument? ATAS.Indicators.Modules.IPlatformModuleContext.AddInstrument |
( |
string |
codeOrId, |
|
|
string? |
exchange = null, |
|
|
bool |
withDepth = false |
|
) |
| |
Asks for the market data of an instrument other than the selected one: its trades, best bid/ask and exchange statistics (and its order book when withDepth is set) are then delivered to the overloads of the data callbacks of PlatformModule that take the instrument. The subscription follows the rules of the platform (data permissions, market replay, the tariff): see IPlatformModuleInstrument.State.
- Parameters
-
| codeOrId | Either the identifier of the instrument (PlatformModuleInstrumentInfo.Id of a search result or IPlatformModuleInstrument.Id saved earlier) - it names exactly one instrument; or the code of the instrument as IInstrumentInfo.Instrument shows it (for example "ESZ6", "BTCUSDT"), or code@exchange. When several instruments have the code (the same contract of a real-time and of a delayed data source), the one of the same kind as the selected instrument is taken, otherwise the real-time one. |
| exchange | The exchange (its code, or its name as IInstrumentInfo.Exchange shows it) when the code is used by several exchanges. Ignored with an identifier. |
| withDepth | True to receive the order book of the instrument as well. |
- Returns
- The instrument (the same object when it is added again), or
null when the platform knows no such instrument right now (its data source may not be connected yet: ask again later, for example from PlatformModule.OnTimer) or the module already has MaxAdditionalInstruments of them.
◆ FindInstruments()
| IReadOnlyList< PlatformModuleInstrumentInfo > ATAS.Indicators.Modules.IPlatformModuleContext.FindInstruments |
( |
string |
text, |
|
|
int |
maxCount = 20 |
|
) |
| |
Searches the instruments the platform knows (those of the connected data sources) by a part of the code or the name, best matches first (at most 100). Pass PlatformModuleInstrumentInfo.Id of a result to AddInstrument.
◆ FormatPrice()
| string ATAS.Indicators.Modules.IPlatformModuleContext.FormatPrice |
( |
decimal |
price | ) |
|
Formats a price with the number of decimals of the instrument tick size.
◆ GetDepth()
| IReadOnlyList< MarketDataArg > ATAS.Indicators.Modules.IPlatformModuleContext.GetDepth |
( |
bool |
isAsk | ) |
|
The bid (isAsk = false) or ask levels of the order book of Instrument, best first: the book taken when the instrument was delivered to the module plus the changes delivered since (copies). Empty while no instrument is selected or the feed provides no order book.
◆ Redraw()
| void ATAS.Indicators.Modules.IPlatformModuleContext.Redraw |
( |
| ) |
|
Asks the platform to draw a new frame (calls are merged; the frame is drawn shortly afterwards).
◆ RemoveInstrument()
Stops the data of an instrument added with AddInstrument. False if it was not added.
◆ AdditionalInstruments
The instruments the module added with AddInstrument, in the order they were added. Empty for a new module instance: a module that keeps its instruments in its settings adds them again in PlatformModule.OnInitialize.
◆ BackgroundColor
| Color ATAS.Indicators.Modules.IPlatformModuleContext.BackgroundColor |
|
get |
Background color of the platform theme.
◆ BestAsk
| MarketDataArg? ATAS.Indicators.Modules.IPlatformModuleContext.BestAsk |
|
get |
Best ask (price and volume) of Instrument, or null while unknown.
◆ BestBid
| MarketDataArg? ATAS.Indicators.Modules.IPlatformModuleContext.BestBid |
|
get |
Best bid (price and volume) of Instrument, or null while unknown.
◆ Buttons
The buttons the module shows in the header of its panel, in order (at most MaxButtons). Add, remove or change them from the callbacks of the module at any time: the header follows. The list is empty for a new module instance; the buttons disappear when the instance is released (an error, the tariff, a reload).
◆ Font
| RenderFont ATAS.Indicators.Modules.IPlatformModuleContext.Font |
|
get |
Regular font of the platform for texts drawn by the module.
◆ HiddenStandardButtons
The standard buttons of the panel header the module hides. Nothing is hidden for a new module instance. See PlatformModuleStandardButtons for what each platform honours.
◆ Instrument
The instrument selected in the panel, or null while none is selected. 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 instrument is selected).
◆ LastTrade
| MarketDataArg? ATAS.Indicators.Modules.IPlatformModuleContext.LastTrade |
|
get |
The last trade of Instrument delivered to the module, or null while there was none.
◆ MaxAdditionalInstruments
| int ATAS.Indicators.Modules.IPlatformModuleContext.MaxAdditionalInstruments |
|
get |
The largest number of AdditionalInstruments of one module.
◆ MaxButtons
| int ATAS.Indicators.Modules.IPlatformModuleContext.MaxButtons |
|
get |
The largest number of Buttons; adding more throws System.InvalidOperationException.
◆ Size
| Size ATAS.Indicators.Modules.IPlatformModuleContext.Size |
|
get |
Size of the client area of the module in pixels (the bounds passed to PlatformModule.OnRender).
◆ Summary
The exchange statistics of Instrument (day open/high/low, volume, previous close, …), or null while the data feed has not reported them.
◆ TextColor
| Color ATAS.Indicators.Modules.IPlatformModuleContext.TextColor |
|
get |
Text color of the platform theme.
The documentation for this interface was generated from the following file:
- IPlatformModuleContext.cs