NinjaScript > Language Reference > Drawing >

IRectangle

Print this Topic Previous pageReturn to chapter overviewNext page

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

 

Methods and Properties

StartBarsAgo

An int value representing the number of bars ago of the starting point

StartTime

A DateTime structure representing the time of the starting point

StartY

A double value representing the y value of the starting point

EndBarsAgo

An int value representing the number of bars ago of the ending point

EndTime

A DateTime structure representing the time of the ending point

EndY

A double value representing the y value of the ending point

AreaColor

A Color structure representing the fill color of the draw object

AreaOpacity

An int value representing the opacity of the area color

Pen

The Pen object used to draw the object

 

 

Examples

protected override void OnBarUpdate()
{

    // Draws a rectangle
    IRectangle rectangle = DrawRectangle("tag1", false, 10, Low[10] - TickSize, 5, High[5] + TickSize, Color.PaleGreen, Color.PaleGreen, 2);

 

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

    Print(rectangle.StartBarsAgo);
}