Arrow Codes

Overview

MQL4 provides predefined enumerations for arrow codes used in trading platform objects and custom indicators. These codes represent various symbols and directional indicators.

Predefined Arrow Codes

These constants represent common symbols:

  • **SYMBOL_THUMBSUP**: 67 (Thumb up symbol)
  • **SYMBOL_THUMBSDOWN**: 68 (Thumb down symbol)
  • **SYMBOL_ARROWUP**: 241 (Arrow up symbol)
  • **SYMBOL_ARROWDOWN**: 242 (Arrow down symbol)
  • **SYMBOL_STOPSIGN**: 251 (Stop sign symbol)
  • **SYMBOL_CHECKSIGN**: 252 (Check sign symbol)
  • Special Arrow Codes

    These codes are specifically designed to point to price and time:

  • Value 1: Upwards arrow with tip rightwards
  • Value 2: Downwards arrow with tip rightwards
  • Value 3: Left pointing triangle
  • Value 4: Dash symbol
  • **SYMBOL_LEFTPRICE**: 5 (Left sided price label)
  • **SYMBOL_RIGHTPRICE**: 6 (Right sided price label)
  • Constraints

  • Special Arrow codes (values 1-6) cannot be used in custom indicators with the DRAW_ARROW drawing style.
  • Example Usage (Custom Indicator)

    The following MQL4 code demonstrates how to use arrow codes within a custom indicator:

    #property indicator_chart_window
    #property indicator_buffers 1
    #property indicator_color1 Lime

    extern double Step=0.02; extern double Maximum=0.2;

    double SarBuffer[];

    int init() { SetIndexStyle(0, DRAW_ARROW); SetIndexArrow(0, 159); // Example arrow code, not from the list above SetIndexBuffer(0, SarBuffer); return(INIT_SUCCEEDED); }

    // ... (rest of the indicator logic for start() function)

    // Inside the start() function, when creating/modifying objects: // ObjectSet(object_name, OBJPROP_ARROWCODE, SYMBOL_LEFTPRICE); // ObjectSet(object_name, OBJPROP_COLOR, DodgerBlue);

    Related Constants

  • [Wingdings](/constants/objectconstants/wingdings)
  • [Indicator Constants](/constants/indicatorconstants)