Positioning Constants

Overview

ENUM_CHART_POSITION is an enumeration defining possible positions for chart navigation.

Constants

  • **CHART_BEGIN**: Represents the beginning of the chart (oldest prices).
  • **CHART_CURRENT_POS**: Represents the current position on the chart.
  • **CHART_END**: Represents the end of the chart (latest prices).
  • Usage

    These constants are used as the position parameter in the ChartNavigate() function.

    Example

    long handle = ChartOpen("EURUSD", PERIOD_H12);
    if (handle != 0) {
        ChartSetInteger(handle, CHART_AUTOSCROLL, false);
        ChartSetInteger(handle, CHART_SHIFT, true);
        ChartSetInteger(handle, CHART_MODE, CHART_LINE);
        ResetLastError();
        bool res = ChartNavigate(handle, CHART_END, 150);
        if (!res) Print("Navigate failed. Error = ", GetLastError());
        ChartRedraw();
    }
    

    Related Sections

  • [Chart Properties](/constants/chartconstants/enum_chart_property)
  • [Chart Representation](/constants/chartconstants/chart_view)