onRButtonDown()

ICE Data Services -

onRButtonDown() Mouse Functions

A user-defined function that executes when the right mouse button is pressed down.

Syntax
function onRButtonDown( [ nBarIndex][, nYValue][, nXPixel ][, nYPixel ] ) {

} 

 


Parameters
Parameter: Description:Default:
nBarIndex [Optional]  Bar Index on mouse event.

 

n/anYValue[Optional]  Price value (or Y-axis) on mouse event.

 

n/anXPixel [Optional]  X-axis pixel coordinate from top left corner of study window on mouse event (7.9.1 and later).

 

n/anYPixel [Optional]  Y-axis pixel coordinate from top left corner of study window on mouse event (7.9.1 and later).

 

n/a
Return Value(s)
N/A

Notes
The optional parameters listed above are used to pass the corresponding data to the onRButtonDown() user-defined function.  This function must be added to the formula outside of main() as in the following code example.

The nXPixel and nYPixel parameters on only available in version 7.9.1 and later.

Be aware that onRButtonDown() and onRButtonUp() also get called on the right double-click event.

Starting with version 11.1 all mouse functions require the use of the Shift key when called from the chart. This change was done to avoid conflicts between EFS and chart mouse events (such as right clicking or double clicking) without compromising any backwards compatibility.


Code Examples
7.9.1 or later
function main() {

}

function onRButtonDownbarIndex, yValue, x, y) {
   debugPrintln("RButton Down: " + barIndex + ", " + yValue + "  x: " 
        + x + "  y: " + y);
   var text = "Right Button Down " + barIndex + " at " + yValue.toFixed(2) 
        + "  x: " + x + "  y: " + y;
   drawTextAbsolute(5, 35, text, Color.white, Color.navy, 
        Text.RELATIVETOLEFT|Text.RELATIVETOBOTTOM|Text.BOLD,
        null, 14, "ClickInfo");
}

7.9 or earlier
function main() {

}

function onRButtonDownbarIndex, yValue) {
   debugPrintln("RButton Down: " + barIndex + ", " + yValue );
   var text = "Right Button Down " + barIndex + " at " + yValue.toFixed(2);
   drawTextAbsolute(5, 35, text, Color.white, Color.navy, 
        Text.RELATIVETOLEFT|Text.RELATIVETOBOTTOM|Text.BOLD,
        null, 14, "ClickInfo");
}



See Also
Mouse Functions
eSignal Bulletin Board Search Engine
Help Guides and Tutorials