GetCursorXPosition
|
Indicators |
SYNTAX | GetCursorXPosition( mode = 0 ) |
RETURNS | NUMBER (datetime) |
FUNCTION | Retrieves current mouse pointer X co-ordinate (i.e. datetime of bar under the mouse pointer).
The functions now (v5.10 and up) by default return NULL (empty value) if mouse is OUTSIDE the current window
Parameters:
Values returned are equal to those visible in the status bar, and these functions require status bar to be visible. Returned values represent cursor position at the formula execution time (or few milliseconds before it) and accurracy is subject to pixel resolution of the screen (first cursor position is read in screen pixels (integer) and then converted to actual value therefore for example when screen resolution is 1024x768 maximum obtainable resolution in X direction is 0.1% and in Y direction 0.13%), also X values are snap to datetime of nearest data bar. It only makes sense to use these functions in indicator/interpretation code. Using them in AA window may yield random values.GetCursorXPosition() function returns X position in DateTime format (the same as used by DateTime() function). You can convert it to string using DateTimeToStr() function.GetCursorYPosition() returns Y position (as displayed in Y axis of the chart). |
EXAMPLE | ToolTip = "X=" + DateTimeToStr( GetCursorXPosition()
) + |
SEE ALSO | GetCursorYPosition() function , GetCursorMouseButtons() function |
The GetCursorXPosition function is used in the following formulas in AFL on-line library:
See updated/extended version on-line.