Mouse Function


function Mouse(var x, y: integer): boolean;

This function will return True when either mouse button is clicked down on a chart.   The function will return False when the mouse is up or when the click down is not on a chart.  

The function returns the x and y coordinates of where the mouse is located on the chart.   One can use these coordinates with the XtoIndex and  YtoPrice  functions to obtain the index for the bar where the mouse is and the price the mouse points to.

BarRight  is a predefined global variable.  It will return the index of the right most visible bar on the chart.

GetVariable(eBarRight)  will return the index of the right most visible bar on the chart.  (Same as BarRight variable's value).

SetVariable(eBarRight, index)  can be used to position the chart by identifying the index of the right most visible bar.   This is equivalent to scrolling the chart left or right to a make a different bar the last bar on the chart.   The scale will resize for the visible bars.