Files
mql5-skills/skills/mql5/references/docs/18-chart-operations/0796-chart-operations-chartyondropped.md
T
2026-06-23 21:47:51 +08:00

1.1 KiB

ChartYOnDropped

Returns the Y coordinateof the chart point the Expert Advisor or script has been dropped to.

int  ChartYOnDropped();

Return Value

The Y coordinate value.

Note

Y axis direction from top to bottom.

Example:

//+------------------------------------------------------------------+
//| Script program start function                                    |
//+------------------------------------------------------------------+
void OnStart()
  {
//--- get and print the X and Y coordinates of the chart point the script was dropped into using the mouse
   int x=ChartXOnDropped();
   int y=ChartYOnDropped();
   PrintFormat("Script dropped to coordinates X = %d, Y = %d", x, y);
   /*
   result:
   Script dropped to coordinates X = 429, Y = 114
   */
  }

See also

ChartWindowOnDropped, ChartPriceOnDropped, ChartTimeOnDropped