Drawing functions are mostly used for painting drawings and accessing drawing script instances. Using these functions during backtesting or optimization might significantly slow the platform down and is not recommended.


Read more: Drawing Scripts


Sections


Functions

Function Details


Functions


Name

Description

int DrawingAnchorPointBarShift(int)

Gets the bar of a specified anchor point. 0 being the latest bar, 1 is the bar preceding it, etc.

int DrawingAnchorPointCount()

Gets the number of anchor points that have already been set for the drawing.

bool DrawingAnchorPointExists(int)

Determines whether a specified anchor point exists, i.e. the anchor point has been set.

double DrawingAnchorPointValue(int)

Gets the y-axis value of a specified anchor point.

DrawingClear()

Clears the drawing from everything other than its anchor points.

DrawingInitialize(int, int)

Initializes the drawing with the symbol on which it is drawn and with the number of required anchor points. Note that this function must be called in the OnInitialize of the drawing.

bool DrawingIsReady()

Determines whether the drawing is ready to be drawn.

int DrawingMaxBarShift()

Gets the maximum bar shift of any of the points set thus far (excluding anchor points).

double DrawingMaxValue()

Gets the maximum y-axis value of any of the points set thus far in the specified drawing (excluding anchor points).

int DrawingMinBarShift()

Gets the minimum bar shift of any of the points set thus far (excluding anchor points).

double DrawingMinValue()

Gets the minimum y-axis value of any of the points set thus far (excluding anchor points).

int DrawingObjectAnchorPointBarShift(Drawing, int)

Gets the bar of a specified anchor point of a specified drawing. 0 being the latest bar, 1 is the bar preceding it, etc.

int DrawingObjectAnchorPointCount(Drawing)

Gets the number of anchor points that have already been set for a specified drawing.

bool DrawingObjectAnchorPointExists(Drawing, int)

Determines whether a specified anchor point exists, i.e. the anchor point has been set, for a specified drawing.

double DrawingObjectAnchorPointValue(Drawing, int)

Gets the y-axis value of a specified anchor point of a specified drawing.

DrawingObjectClear(Drawing)

Clears a specified drawing from everything other than its anchor points.

DrawingObjectCreate(Drawing)

Creates the drawing on a virtual canvas to allow access to the drawing values. Anchor points for the drawing must be preset. (To display the drawing on a chart, see the ChartDrawingPlot function)

bool DrawingObjectIsReady(Drawing)

Determines whether the drawing is ready to be drawn.

int DrawingObjectMaxBarShift(Drawing)

Gets the maximum bar shift of any of the points set thus far in a specified drawing (excluding anchor points).

double DrawingObjectMaxValue(Drawing)

Gets the maximum y-axis value of any of the points set thus far in a specified drawing (excluding anchor points).

int DrawingObjectMinBarShift(Drawing)

Gets the minimum bar shift of any of the points set thus far in a specified drawing (excluding anchor points).

double DrawingObjectMinValue(Drawing)

Gets the minimum y-axis value of any of the points set thus far in a specified drawing (excluding anchor points).

string[] DrawingObjectPointLabels(Drawing, int)

Gets the labels of the points currently set at a specified bar in a specified drawing (excluding anchor points).

double[] DrawingObjectPointValues(Drawing, int)

Gets the y-axis values of the points currently set at a specified bar in a specified drawing (excluding anchor points).

DrawingObjectRemove(Drawing)

Removes a specified drawing so that it no longer takes up memory.

int DrawingObjectRequiredAnchorPoints(Drawing)

Gets the number of anchor points required for a specified drawing.

DrawingObjectSetAnchorPoint(Drawing, int, int, double)

Sets a specified anchor point in a specified drawing.

DrawingObjectSetAnchorPointClose(Drawing, int, int)

Sets a specified anchor point in a specified drawing while snapping its value (y-axis) to the bar close.

DrawingObjectSetAnchorPointHigh(Drawing, int, int)

Sets a specified anchor point in a specified drawing while snapping its value (y-axis) to the bar high.

DrawingObjectSetAnchorPointLow(Drawing, int, int)

Sets a specified anchor point in a specified drawing while snapping its value (y-axis) to the bar low.

DrawingObjectSetAnchorPointOpen(Drawing, int, int)

Sets a specified anchor point in a specified drawing while snapping its value (y-axis) to the bar open.

int DrawingObjectSymbolIndex(Drawing)

Gets the underlying symbol index of a specified drawing.

bool DrawingPointExists(int)

Determines whether the drawing has points at a specified bar.

string[] DrawingPointLabels(int)

Gets the labels of the points currently set at a specified bar (excluding anchor points).

double[] DrawingPointValues(int)

Gets the y-axis values of the points currently set at a specified bar (excluding anchor points).

DrawingRegisterPen(string, C_Color, C_DashStyle, int)

Registers a pen in the OnChartSetup function in order to allow the use of the pen by the drawing.

DrawingRegisterPen(string, int[], C_DashStyle, int)

Registers a pen in the OnChartSetup function in order to allow the use of the pen by the drawing.

int DrawingRequiredAnchorPoints()

Gets the number of required anchor points.

DrawingSetAnchorPoint(int, int, double)

Sets a specified anchor point in the drawing.

DrawingSetAnchorPointClose(int, int)

Sets a specified anchor point in the drawing while snapping its value (y-axis) to the bar close.

DrawingSetAnchorPointHigh(int, int)

Sets a specified anchor point in the drawing while snapping its value (y-axis) to the bar high.

DrawingSetAnchorPointLow(int, int)

Sets a specified anchor point in the drawing while snapping its value (y-axis) to the bar low.

DrawingSetAnchorPointOpen(int, int)

Sets a specified anchor point in the drawing while snapping its value (y-axis) to the bar open.

DrawingSetEllipse(string, string, int, double, int, double, string)

Draws an ellipse drawing.

DrawingSetExtendedLine(string, int, double, int, double)

Draws an extended line between two specified points.

DrawingSetImage(string, int, double)

Displays a specified image at a specified point.

DrawingSetLine(string, int, double, string, int, double, string)

Draws a line between two specified points.

DrawingSetPolygon(string, string, int[], double[], string[])

Draws a polygon on the chart.

DrawingSetRay(string, int, double, int, double)

Draws a ray between two specified points.

Drawing DrawingSetSymbol(Drawing, int)

Copies a specified drawing from the OnInitialize parameters and assign it a symbol, as the parameters do not have an underlying symbol assigned to them.

DrawingSetText(string, int, double, string, string)

Draws an editable rectangular text label.


Function Details


int DrawingAnchorPointBarShift(int anchorPointIndex)

Gets the bar of a specified anchor point. 0 being the latest bar, 1 is the bar preceding it, etc.


Returns


The bar of the specified anchor point. 0 being the latest bar, 1 is the bar preceding it, etc.


Parameters


Type

Identifier

Description

int

anchorPointIndex

The anchor point index


Scripts


Drawing


int DrawingAnchorPointCount()

Gets the number of anchor points that have already been set for the drawing.


Returns


The number of anchor points that have already been set for the drawing.


Scripts


Drawing


bool DrawingAnchorPointExists(int anchorPointIndex)

Determines whether a specified anchor point exists, i.e. the anchor point has been set.


Returns


True if the specified anchor point exists, false otherwise.


Parameters


Type

Identifier

Description

int

anchorPointIndex

The anchor point index


Scripts


Drawing


double DrawingAnchorPointValue(int anchorPointIndex)

Gets the y-axis value of a specified anchor point.


Returns


The y-axis value of the specified anchor point.


Parameters


Type

Identifier

Description

int

anchorPointIndex

The anchor point index


Scripts


Drawing


DrawingClear()

Clears the drawing from everything other than its anchor points.


Scripts


Drawing


DrawingInitialize(int symbolIndex, int requiredAnchorPoints)

Initializes the drawing with the symbol on which it is drawn and with the number of required anchor points. Note that this function must be called in the OnInitialize of the drawing.


Parameters


Type

Identifier

Description

int

symbolIndex

The symbol index of the drawing

int

requiredAnchorPoints

The number of anchor points required by the drawing


Scripts


Drawing


bool DrawingIsReady()

Determines whether the drawing is ready to be drawn.


Returns


True if the drawing has all the anchor points set, false otherwise.


Scripts


Drawing


int DrawingMaxBarShift()

Gets the maximum bar shift of any of the points set thus far (excluding anchor points).


Returns


The maximum bar shift of any of the points set thus far.


Scripts


Drawing


double DrawingMaxValue()

Gets the maximum y-axis value of any of the points set thus far in the specified drawing (excluding anchor points).


Returns


The maximum y-axis value of any of the points set thus far.


Scripts


Drawing


int DrawingMinBarShift()

Gets the minimum bar shift of any of the points set thus far (excluding anchor points).


Returns


The minimum bar shift of any of the points set thus far.


Scripts


Drawing


double DrawingMinValue()

Gets the minimum y-axis value of any of the points set thus far (excluding anchor points).


Returns


The minimum y-axis value of any of the points set thus far.


Scripts


Drawing


int DrawingObjectAnchorPointBarShift(Drawing drawing, int anchorPointIndex)

Gets the bar of a specified anchor point of a specified drawing. 0 being the latest bar, 1 is the bar preceding it, etc.


Returns


The bar of the specified anchor point. 0 being the latest bar, 1 is the bar preceding it, etc.


Parameters


Type

Identifier

Description

Drawing

drawing

The drawing

int

anchorPointIndex

The anchor point index


Scripts


TradeManagementStrategy, Drawing, Indicator, MultiSymbolTradingStrategy, Pattern, PositionSizing, Signal, TradingStrategy


int DrawingObjectAnchorPointCount(Drawing drawing)

Gets the number of anchor points that have already been set for a specified drawing.


Returns


The number of anchor points that have already been set for the specified drawing.


Parameters


Type

Identifier

Description

Drawing

drawing

The drawing


Scripts


TradeManagementStrategy, Drawing, Indicator, MultiSymbolTradingStrategy, Pattern, PositionSizing, Signal, TradingStrategy


bool DrawingObjectAnchorPointExists(Drawing drawing, int anchorPointIndex)

Determines whether a specified anchor point exists, i.e. the anchor point has been set, for a specified drawing.


Returns


True if the specified anchor point exists, false otherwise.


Parameters


Type

Identifier

Description

Drawing

drawing

The drawing

int

anchorPointIndex

The anchor point index


Scripts


TradeManagementStrategy, Drawing, Indicator, MultiSymbolTradingStrategy, Pattern, PositionSizing, Signal, TradingStrategy


double DrawingObjectAnchorPointValue(Drawing drawing, int anchorPointIndex)

Gets the y-axis value of a specified anchor point of a specified drawing.


Returns


The y-axis value of the specified anchor point.


Parameters


Type

Identifier

Description

Drawing

drawing

The drawing

int

anchorPointIndex

The anchor point index


Scripts


TradeManagementStrategy, Drawing, Indicator, MultiSymbolTradingStrategy, Pattern, PositionSizing, Signal, TradingStrategy


DrawingObjectClear(Drawing drawing)

Clears a specified drawing from everything other than its anchor points.


Parameters


Type

Identifier

Description

Drawing

drawing

The drawing


Scripts


TradeManagementStrategy, Drawing, Indicator, MultiSymbolTradingStrategy, Pattern, PositionSizing, Signal, TradingStrategy


DrawingObjectCreate(Drawing drawing)

Creates the drawing on a virtual canvas to allow access to the drawing values. Anchor points for the drawing must be preset. (To display the drawing on a chart, see the ChartDrawingPlot function)


Parameters


Type

Identifier

Description

Drawing

drawing

The drawing


Scripts


TradeManagementStrategy, Drawing, Indicator, MultiSymbolTradingStrategy, Pattern, PositionSizing, Signal, TradingStrategy


bool DrawingObjectIsReady(Drawing drawing)

Determines whether the drawing is ready to be drawn.


Returns


True if the drawing has all the anchor points set, false otherwise.


Parameters


Type

Identifier

Description

Drawing

drawing

The drawing


Scripts


TradeManagementStrategy, Drawing, Indicator, MultiSymbolTradingStrategy, Pattern, PositionSizing, Signal, TradingStrategy


int DrawingObjectMaxBarShift(Drawing drawing)

Gets the maximum bar shift of any of the points set thus far in a specified drawing (excluding anchor points).


Returns


The maximum bar shift of any of the points set thus far in the specified drawing.


Parameters


Type

Identifier

Description

Drawing

drawing

The drawing


Scripts


TradeManagementStrategy, Drawing, Indicator, MultiSymbolTradingStrategy, Pattern, PositionSizing, Signal, TradingStrategy


double DrawingObjectMaxValue(Drawing drawing)

Gets the maximum y-axis value of any of the points set thus far in a specified drawing (excluding anchor points).


Returns


The maximum y-axis value of any of the points set thus far in the specified drawing.


Parameters


Type

Identifier

Description

Drawing

drawing

The drawing


Scripts


TradeManagementStrategy, Drawing, Indicator, MultiSymbolTradingStrategy, Pattern, PositionSizing, Signal, TradingStrategy


int DrawingObjectMinBarShift(Drawing drawing)

Gets the minimum bar shift of any of the points set thus far in a specified drawing (excluding anchor points).


Returns


The minimum bar shift of any of the points set thus far in the specified drawing.


Parameters


Type

Identifier

Description

Drawing

drawing

The drawing


Scripts


TradeManagementStrategy, Drawing, Indicator, MultiSymbolTradingStrategy, Pattern, PositionSizing, Signal, TradingStrategy


double DrawingObjectMinValue(Drawing drawing)

Gets the minimum y-axis value of any of the points set thus far in a specified drawing (excluding anchor points).


Returns


The minimum y-axis value of any of the points set thus far in the specified drawing.


Parameters


Type

Identifier

Description

Drawing

drawing

The drawing


Scripts


TradeManagementStrategy, Drawing, Indicator, MultiSymbolTradingStrategy, Pattern, PositionSizing, Signal, TradingStrategy


string[] DrawingObjectPointLabels(Drawing drawing, int barShift)

Gets the labels of the points currently set at a specified bar in a specified drawing (excluding anchor points).


Returns


The point labels currently set at the specified bar in the specified drawing.


Parameters


Type

Identifier

Description

Drawing

drawing

The drawing

int

barShift

The shift relative to the last bar, such that 0 is the latest bar, 1 is the bar preceding it, etc.


Scripts


TradeManagementStrategy, Drawing, Indicator, MultiSymbolTradingStrategy, Pattern, PositionSizing, Signal, TradingStrategy


double[] DrawingObjectPointValues(Drawing drawing, int barShift)

Gets the y-axis values of the points currently set at a specified bar in a specified drawing (excluding anchor points).


Returns


The y-axis values of the points currently set at a specified bar in the specified drawing.


Parameters


Type

Identifier

Description

Drawing

drawing

The drawing

int

barShift

The shift relative to the last bar, such that 0 is the latest bar, 1 is the bar preceding it, etc.


Scripts


TradeManagementStrategy, Drawing, Indicator, MultiSymbolTradingStrategy, Pattern, PositionSizing, Signal, TradingStrategy


DrawingObjectRemove(Drawing drawing)

Removes a specified drawing so that it no longer takes up memory.


Parameters


Type

Identifier

Description

Drawing

drawing

The drawing to remove


Scripts


TradeManagementStrategy, Drawing, Indicator, MultiSymbolTradingStrategy, Pattern, PositionSizing, Signal, TradingStrategy


int DrawingObjectRequiredAnchorPoints(Drawing drawing)

Gets the number of anchor points required for a specified drawing.


Returns


The number of anchor points required for the specified drawing.


Parameters


Type

Identifier

Description

Drawing

drawing

The drawing


Scripts


TradeManagementStrategy, Drawing, Indicator, MultiSymbolTradingStrategy, Pattern, PositionSizing, Signal, TradingStrategy


DrawingObjectSetAnchorPoint(Drawing drawing, int anchorPointIndex, int barShift, double value)

Sets a specified anchor point in a specified drawing.


Parameters


Type

Identifier

Description

Drawing

drawing

The drawing

int

anchorPointIndex

The anchor point index

int

barShift

The shift relative to the last bar, such that 0 is the latest bar, 1 is the bar preceding it, etc.

double

value

The point value (y-axis)


Scripts


TradeManagementStrategy, Drawing, Indicator, MultiSymbolTradingStrategy, Pattern, PositionSizing, Signal, TradingStrategy


DrawingObjectSetAnchorPointClose(Drawing drawing, int anchorPointIndex, int barShift)

Sets a specified anchor point in a specified drawing while snapping its value (y-axis) to the bar close.


Parameters


Type

Identifier

Description

Drawing

drawing

The drawing

int

anchorPointIndex

The anchor point index

int

barShift

The shift relative to the last bar, such that 0 is the latest bar, 1 is the bar preceding it, etc.


Scripts


TradeManagementStrategy, Drawing, Indicator, MultiSymbolTradingStrategy, Pattern, PositionSizing, Signal, TradingStrategy


DrawingObjectSetAnchorPointHigh(Drawing drawing, int anchorPointIndex, int barShift)

Sets a specified anchor point in a specified drawing while snapping its value (y-axis) to the bar high.


Parameters


Type

Identifier

Description

Drawing

drawing

The drawing

int

anchorPointIndex

The anchor point index

int

barShift

The shift relative to the last bar, such that 0 is the latest bar, 1 is the bar preceding it, etc.


Scripts


TradeManagementStrategy, Drawing, Indicator, MultiSymbolTradingStrategy, Pattern, PositionSizing, Signal, TradingStrategy


DrawingObjectSetAnchorPointLow(Drawing drawing, int anchorPointIndex, int barShift)

Sets a specified anchor point in a specified drawing while snapping its value (y-axis) to the bar low.


Parameters


Type

Identifier

Description

Drawing

drawing

The drawing

int

anchorPointIndex

The anchor point index

int

barShift

The shift relative to the last bar, such that 0 is the latest bar, 1 is the bar preceding it, etc.


Scripts


TradeManagementStrategy, Drawing, Indicator, MultiSymbolTradingStrategy, Pattern, PositionSizing, Signal, TradingStrategy


DrawingObjectSetAnchorPointOpen(Drawing drawing, int anchorPointIndex, int barShift)

Sets a specified anchor point in a specified drawing while snapping its value (y-axis) to the bar open.


Parameters


Type

Identifier

Description

Drawing

drawing

The drawing

int

anchorPointIndex

The anchor point index

int

barShift

The shift relative to the last bar, such that 0 is the latest bar, 1 is the bar preceding it, etc.


Scripts


TradeManagementStrategy, Drawing, Indicator, MultiSymbolTradingStrategy, Pattern, PositionSizing, Signal, TradingStrategy


int DrawingObjectSymbolIndex(Drawing drawing)

Gets the underlying symbol index of a specified drawing.


Returns


The underlying symbol index of the specified drawing.


Parameters


Type

Identifier

Description

Drawing

drawing

The drawing


Scripts


TradeManagementStrategy, Drawing, Indicator, MultiSymbolTradingStrategy, Pattern, PositionSizing, Signal, TradingStrategy


bool DrawingPointExists(int barShift)

Determines whether the drawing has points at a specified bar.


Returns


True if the drawing has points at the specified bar, false otherwise.


Parameters


Type

Identifier

Description

int

barShift

The shift relative to the last bar, such that 0 is the latest bar, 1 is the bar preceding it, etc.


Scripts


Drawing


string[] DrawingPointLabels(int barShift)

Gets the labels of the points currently set at a specified bar (excluding anchor points).


Returns


The point labels currently set at the specified bar.


Parameters


Type

Identifier

Description

int

barShift

The shift relative to the last bar, such that 0 is the latest bar, 1 is the bar preceding it, etc.


Scripts


Drawing


double[] DrawingPointValues(int barShift)

Gets the y-axis values of the points currently set at a specified bar (excluding anchor points).


Returns


The point y-axis values currently set at the specified bar.


Parameters


Type

Identifier

Description

int

barShift

The shift relative to the last bar, such that 0 is the latest bar, 1 is the bar preceding it, etc.


Scripts


Drawing


DrawingRegisterPen(string penName, C_Color color, C_DashStyle dashStyle, int thickness)

Registers a pen in the OnChartSetup function in order to allow the use of the pen by the drawing.


Parameters


Type

Identifier

Description

string

penName

The pen name

C_Color

color

The pen color (View Options)

C_DashStyle

dashStyle

The pen dash style (View Options)

int

thickness

The pen thickness


Scripts


Drawing


DrawingRegisterPen(string penName, int[] color, C_DashStyle dashStyle, int thickness)

Registers a pen in the OnChartSetup function in order to allow the use of the pen by the drawing.


Parameters


Type

Identifier

Description

string

penName

The pen name

int[]

color

The RGB+Alpha color of the pen (R, G, B, Alpha)

C_DashStyle

dashStyle

The pen dash style (View Options)

int

thickness

The pen thickness


Scripts


Drawing


int DrawingRequiredAnchorPoints()

Gets the number of required anchor points.


Returns


The number of required anchor points.


Scripts


Drawing


DrawingSetAnchorPoint(int anchorPointIndex, int barShift, double value)

Sets a specified anchor point in the drawing.


Parameters


Type

Identifier

Description

int

anchorPointIndex

The anchor point index

int

barShift

The shift relative to the last bar, such that 0 is the latest bar, 1 is the bar preceding it, etc.

double

value

The point value (y-axis)


Scripts


Drawing


DrawingSetAnchorPointClose(int anchorPointIndex, int barShift)

Sets a specified anchor point in the drawing while snapping its value (y-axis) to the bar close.


Parameters


Type

Identifier

Description

int

anchorPointIndex

The anchor point index

int

barShift

The shift relative to the last bar, such that 0 is the latest bar, 1 is the bar preceding it, etc.


Scripts


Drawing


DrawingSetAnchorPointHigh(int anchorPointIndex, int barShift)

Sets a specified anchor point in the drawing while snapping its value (y-axis) to the bar high.


Parameters


Type

Identifier

Description

int

anchorPointIndex

The anchor point index

int

barShift

The shift relative to the last bar, such that 0 is the latest bar, 1 is the bar preceding it, etc.


Scripts


Drawing


DrawingSetAnchorPointLow(int anchorPointIndex, int barShift)

Sets a specified anchor point in the drawing while snapping its value (y-axis) to the bar low.


Parameters


Type

Identifier

Description

int

anchorPointIndex

The anchor point index

int

barShift

The shift relative to the last bar, such that 0 is the latest bar, 1 is the bar preceding it, etc.


Scripts


Drawing


DrawingSetAnchorPointOpen(int anchorPointIndex, int barShift)

Sets a specified anchor point in the drawing while snapping its value (y-axis) to the bar open.


Parameters


Type

Identifier

Description

int

anchorPointIndex

The anchor point index

int

barShift

The shift relative to the last bar, such that 0 is the latest bar, 1 is the bar preceding it, etc.


Scripts


Drawing


DrawingSetEllipse(string strokePenName, string fillPenName, int x, double y, int radiusX, double radiusY, string label)

Draws an ellipse drawing.


Parameters


Type

Identifier

Description

string

strokePenName

The registered pen name to use for drawing the ellipse stroke

string

fillPenName

The registered pen name to use for filling the ellipse

int

x

The bar shift of the ellipse center, such that 0 is the latest closed bar or the current bar being updated (depending on bar close / bar update settings), 1 is the bar preceding it, etc.

double

y

The price of the ellipse center

int

radiusX

The radius on the X axis, which is a number of bars radius

double

radiusY

The radius on the Y axis, which is a price radius

string

label

The ellipse label


Scripts


Drawing


DrawingSetExtendedLine(string penName, int x1, double y1, int x2, double y2)

Draws an extended line between two specified points.


Parameters


Type

Identifier

Description

string

penName

The registered pen name to use for drawing the extended line

int

x1

The first point bar shift, where 0 is the latest bar, 1 is the bar preceding it, etc.

double

y1

The first point y-axis value

int

x2

The second point bar shift, where 0 is the latest bar, 1 is the bar preceding it, etc.

double

y2

The second point y-axis value


Scripts


Drawing


DrawingSetImage(string imagePath, int x, double y)

Displays a specified image at a specified point.


Parameters


Type

Identifier

Description

string

imagePath

The image path

int


The point bar shift, where 0 is the latest bar, 1 is the bar preceding it, etc.

double


The point y-axis value


Scripts


Drawing


DrawingSetLine(string penName, int x1, double y1, string label1, int x2, double y2, string label2)

Draws a line between two specified points.


Parameters


Type

Identifier

Description

string

penName

The registered pen name to use for drawing the line

int

x1

The first point bar shift, where 0 is the latest bar, 1 is the bar preceding it, etc.

double

y1

The first point y-axis value

string

label1

The label of the first point

int

x2

The second point bar shift, where 0 is the latest bar, 1 is the bar preceding it, etc.

double

y2

The second point y-axis value

string

label2

The label of the second point


Scripts


Drawing


DrawingSetPolygon(string strokePenName, string fillPenName, int[] x, double[] y, string[] label)

Draws a polygon on the chart.


Parameters


Type

Identifier

Description

string

strokePenName

The registered pen name to use for drawing the polygon stroke

string

fillPenName

The registered pen name to use for filling the polygon

int[]

x

The bar-shifts for the points (Must have same number of items as Y)

double[]

y

The prices for the points (Must have same number of items as X)

string[]

label

The labels for the points (Must have same number of items as X)


Scripts


Drawing


DrawingSetRay(string penName, int x1, double y1, int x2, double y2)

Draws a ray between two specified points.


Parameters


Type

Identifier

Description

string

penName

The registered pen name to use for drawing the ray

int

x1

The first point bar shift, where 0 is the latest bar, 1 is the bar preceding it, etc.

double

y1

The first point y-axis value

int

x2

The second point bar shift, where 0 is the latest bar, 1 is the bar preceding it, etc.

double

y2

The second point y-axis value


Scripts


Drawing


Drawing DrawingSetSymbol(Drawing drawing, int symbolIndex)

Copies a specified drawing from the OnInitialize parameters and assign it a symbol, as the parameters do not have an underlying symbol assigned to them.


Returns


A copy of the specified drawing over the specified symbol.


Parameters


Type

Identifier

Description

Drawing

drawing

The drawing to copy

int

symbolIndex

The symbol index to assign the new drawing


Scripts


MultiSymbolTradingStrategy


DrawingSetText(string text, int x, double y, string strokePenName, string fillPenName)

Draws an editable rectangular text label.


Parameters


Type

Identifier

Description

string

text

The text to display

int

x

The point bar shift, where 0 is the latest bar, 1 is the bar preceding it, etc.

double

y

The point price value (y-axis)

string

strokePenName

The rectangle stroke pen name

string

fillPenName

The rectangle fill pen name


Scripts


Drawing