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:
Special Arrow Codes
These codes are specifically designed to point to price and time:
Constraints
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 Limeextern 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);