Skip to content

Chart Operations

Chart Operations

These are functions for working with charts. All chart operations are allowed in Expert Advisors and scripts only.

The functions defining the chart properties are actually used for sending change commands to the chart. If these functions are executed successfully, the command is included in the common queue of the chart events. The changes are implemented to the chart when handling the queue of the chart events.

Thus, do not expect an immediate visual update of the chart after calling these functions. Generally, the chart is updated automatically by the terminal following the change events - a new quote arrival, resizing the chart window, etc. Use ChartRedraw() function to forcefully update the chart.

FunctionAction
ChartApplyTemplateApplies a specific template from a specified file to the chart
ChartSaveTemplateSaves current chart settings in a template with a specified name
ChartWindowFindReturns the number of a subwindow where an indicator is drawn
ChartTimePriceToXYConverts the coordinates of a chart from the time/price representation to the X and Y coordinates
ChartXYToTimePriceConverts the X and Y coordinates on a chart to the time and price values
ChartOpenOpens a new chart with the specified symbol and period
ChartFirstReturns the ID of the first chart of the client terminal
ChartNextReturns the chart ID of the chart next to the specified one
ChartCloseCloses the specified chart
ChartSymbolReturns the symbol name of the specified chart
ChartPeriodReturns the period value of the specified chart
ChartRedrawCalls a forced redrawing of a specified chart
ChartSetDoubleSets the double value for a corresponding property of the specified chart
ChartSetIntegerSets the integer value (datetime, int, color, bool or char) for a corresponding property of the specified chart
ChartSetStringSets the string value for a corresponding property of the specified chart
ChartGetDoubleReturns the double value property of the specified chart
ChartGetIntegerReturns the integer value property of the specified chart
ChartGetStringReturns the string value property of the specified chart
ChartNavigatePerforms shift of the specified chart by the specified number of bars relative to the specified position in the chart
ChartIDReturns the ID of the current chart
ChartIndicatorDeleteRemoves an indicator with a specified name from the specified chart window
ChartIndicatorNameReturns the short name of the indicator by the number in the indicators list on the specified chart window
ChartIndicatorsTotalReturns the number of all indicators applied to the specified chart window.
ChartWindowOnDroppedReturns the number (index) of the chart subwindow the Expert Advisor or script has been dropped to
ChartPriceOnDroppedReturns the price coordinate of the chart point the Expert Advisor or script has been dropped to
ChartTimeOnDroppedReturns the time coordinate of the chart point the Expert Advisor or script has been dropped to
ChartXOnDroppedReturns the X coordinate of the chart point the Expert Advisor or script has been dropped to
ChartYOnDroppedReturns the Y coordinate of the chart point the Expert Advisor or script has been dropped to
ChartSetSymbolPeriodChanges the symbol value and a period of the specified chart
ChartScreenShotProvides a screenshot of the chart of its current state in a gif format
PeriodReturns timeframe of the current chart
SymbolReturns a text string with the name of the current financial instrument
WindowBarsPerChartReturns the amount of bars visible on the chart
WindowExpertNameReturns the name of the executed Expert Advisor, script, custom indicator, or library
WindowFindReturns the window index containing this specified indicator
WindowFirstVisibleBarReturns index of the first visible bar in the current chart window
WindowHandleReturns the system handle of the chart window
WindowIsVisibleReturns the visibility flag of the chart subwindow
WindowOnDroppedReturns the window index where Expert Advisor, custom indicator or script was dropped
WindowPriceMaxReturns the maximal value of the vertical scale of the specified subwindow of the current chart
WindowPriceMinReturns the minimal value of the vertical scale of the specified subwindow of the current chart
WindowPriceOnDroppedReturns the price of the chart point where Expert Advisor or script was dropped
WindowRedrawRedraws the current chart forcedly
WindowScreenShotSaves current chart screen shot as a GIF, PNG or BMP file depending on specified extension
WindowTimeOnDroppedReturns the time of the chart point where Expert Advisor or script was dropped
WindowsTotalReturns total number of indicator windows on the chart
WindowXOnDroppedReturns the value at X axis in pixels for the chart window client area point at which the Expert Advisor or script was dropped
WindowYOnDroppedReturns the value at Y axis in pixels for the chart window client area point at which the Expert Advisor or script was dropped
Last updated on