Review of fields and data.

Review of fields and data.

Before working with the BotTabIndex tab, it is necessary to familiarize yourself with its structure and the interface it offers. Let's consider the public members of the class.

BotTabIndex - public constructor. Initializes the initial state of the object.

Tabs - a list of all connectors used by the tab to receive quotes.

ShowDialog - method that opens the settings window for the tab.

ShowIndexConnectorIndexDialog - method that opens the connection settings window for the selected connector.

ShowNewSecurityDialog - method that opens the window to connect new instruments to the tab.

CreateNewSecurityConnector - method that creates and adds a new ConnectorCandles object when adding a new instrument to the tab.

DeleteSecurityTab - method that deletes the connector when a tool is removed from the tab.

StartPaint - starts the process of drawing the index on the chart.

StopPaint - stops the process of drawing.

TabName - the unique name of the tab.

TabNum - the identifier of the tab assigned by the program.

NameStrategy - the unique name of the robot in which this object was created.

Clear - method that removes the data of the current tab from the chart.

Save - method that saves the tab settings to a text file.

EventsIsOn - property that enables/disables event processing for the tab.

Load - method that loads settings from a file and initializes the object's state.

Delete - method that prepares the tab for deletion, unsubscribes from all events coming from internal modules.

IsConnected - property that checks if all internal connectors are active, returning false if at least one is not connected.

LastTimeCandleUpdate - property that returns the time of the last candle update in the series.

Candles - field containing a list of candles representing the index chart.

SpreadChangeEvent - the main event of the tab, signaling a change in the index price.

UserFormula - user formula used to calculate the index.

ConvertedFormula - processed formula used to calculate the index.

ConvertFormula - method that checks the validity of the user-entered formula for index construction.

Calculate - method that performs the necessary index calculations based on the formula.

CreateCandleIndicator - method that accepts an indicator and the name of the area on the chart where it should be displayed, and then delegates the command to create the indicator to the corresponding method of the ChartCandleMaster object.

DeleteCandleIndicator - method that accepts an indicator to be removed from the chart.

Indicators - a public read-only property that returns a list of indicators on the chart.

LogMessageEvent - event that sends an informational message to the log. The method delegated with the event delegate should take two parameters: the message itself and the LogMessageType enumeration value.

GetChartLabel - method that returns a string from the chart containing the server type, instrument name, and selected timeframe.

The event that we are most interested in is:

public event Action<List<Candle>> SpreadChangeEvent;

It signals the formation of the next candle in the index data series. In BotTabIndex, there is no equivalent event to that of a simple tab, which triggers after each anonymous transaction or when the price of the last candle is updated. However, this is not a problem, as the index tab supports all available candle types in the terminal. Accordingly, a tick chart can be used to calculate the index in real-time.

If you have any difficulties or questions, please write to the support chat. Link