- ChartApplyTemplate
- ChartSaveTemplate
- ChartWindowFind
- ChartTimePriceToXY
- ChartXYToTimePrice
- ChartOpen
- ChartFirst
- ChartNext
- ChartClose
- ChartSymbol
- ChartPeriod
- ChartRedraw
- ChartSetDouble
- ChartSetInteger
- ChartSetString
- ChartGetDouble
- ChartGetInteger
- ChartGetString
- ChartNavigate
- ChartID
- ChartIndicatorAdd
- ChartIndicatorDelete
- ChartIndicatorGet
- ChartIndicatorName
- ChartIndicatorsTotal
- ChartWindowOnDropped
- ChartPriceOnDropped
- ChartTimeOnDropped
- ChartXOnDropped
- ChartYOnDropped
- ChartSetSymbolPeriod
- ChartScreenShot
ChartIndicatorGet
Returns the handle of the indicator with the specified short name in the specified chart window.
int ChartIndicatorGet(
|
Parameters
chart_id
[in] Chart ID. 0 means the current chart.
sub_window
[in] The number of the chart subwindow. 0 means the main chart window.
const indicator_shortname
[in] The short name if the indicator, which is set in the INDICATOR_SHORTNAME property using the IndicatorSetString() function. To get the short name of an indicator, use the ChartIndicatorName() function.
Return Value
Returns an indicator handle if successful, otherwise returns INVALID_HANDLE. To get information about the error, call the GetLastError() function.
Note
The indicator handle obtained using the ChartIndicatorGet() function increases the internal indicator usage counter. The terminal runtime system keeps all indicators, whose counter is greater than zero, loaded. Therefore, the indicator handle that is no longer needed should be immediately and explicitly released using IndicatorRelease() in the same program that received it, as shown in the example below. Otherwise, it will be impossible to find the “abandoned” handle and release it from another program correctly.
When creating an indicator, be careful forming its short name, which is written in the INDICATOR_SHORTNAME property using the IndicatorSetString() function. It is recommended that a short name should contain the values of input parameters of the indicator, since the indicator is identified in the ChartIndicatorGet() function based on its short name.
Another way to identify the indicator is to get a list of its parameters for a given handle using the IndicatorParameters() function and then to analyze the obtained values.
Example:
//+------------------------------------------------------------------+
|
See also
ChartIndicatorAdd(), ChartIndicatorName(), ChartIndicatorsTotal(), IndicatorParameters()