NinjaScript > Language Reference > Drawing >

IRuler

Print this Topic Previous pageReturn to chapter overviewNext page

Definition
Represents an interface that exposes information regarding a Ruler IDrawObject.

 

Methods and Properties

Anchor1BarsAgo

An int value representing the number of bars ago of the 1st anchor point

Anchor1Time

A DateTime structure representing the time of the 1st anchor point

Anchor1Y

A double value representing the y value of the 1st anchor point

Anchor2BarsAgo

An int value representing the number of bars ago of the 2nd anchor point

Anchor2Time

A DateTime structure representing the time of the 2nd anchor point

Anchor2Y

A double value representing the y value of the 2nd anchor point

Anchor3BarsAgo

An int value representing the number of bars ago of the 3rd anchor point

Anchor3Time

A DateTime structure representing the time of the 3rd anchor point

Anchor3Y

A double value representing the y value of the 3rd anchor point

 

 

Examples

protected override void OnBarUpdate()
{

    // Draws a ruler measuring the primary bar series
    IRuler ruler = DrawRuler("tag1", true, BarsArray[0], 4, Low[4], 3, High[3], 1, Low[1]);

 

    // Print the number of bars ago the starting point is located at

    Print(ruler.StartBarsAgo);
}