The trend line function fnDrawTrendLine is used to programatically draw a trend line on a price chart.


After the fnDrawTrendLine function has been added to a Drawing, it is configured by clicking the (+) button along the bottom of the Element.


The Function Configuration window allows you to select values for each parameter.



Parameter Name

Data type

Description

Name

string

The name of the trend line.  All trend lines are identified by name.  The name should be unique. The pull-down menu provides sample names, but the text can be overwritten to any allowable name.  The name must be surrounded by double quotes, for example "myName". Avoid using blank spaces in the name: It may cause unpredictable behaviour.

ReDrawInterval

DRAW type (integer)

The interval at which the trend line is redrawn. The pull-down menu offers these choices:

RD_ONCE : draw the line one time only

RD_DAILY : redraw the line on each new day

RD_HOURLY : redraw the line on each new hour

RD_NEWBAR : redraw the line on each new bar

RD_NEWTICK : redraw the line on each new tick

StartBar

integer

The horizontal location (bar) on the price chart where the trend line begins. Lines are drawn left to right, so the StartBar is to the left of the EndBar on a price chart. The StartBar is a larger number than the EndBar.

StartPrice

double

The vertical location (price) where the trend line begins.  The StartPrice is the price value of the StartBar. The pull-down menu offers these choices:

PRICE_CLOSE

PRICE_OPEN

PRICE_HIGH

PRICE_LOW

PRICE_MEDIAN

PRICE_TYPICAL

PRICE_WEIGHTED

StartOffest

integer

A positive or negative offset of the StartPrice, where 1 increment equals 1 point.  This value moves the start point of the line up or down vertically on the price chart.

EndBar

integer

The horizontal location (bar) on the price chart where the trend line ends. Lines are drawn left to right, so the EndBar is to the right of the StartBar on a price chart. The EndBar is a smaller number than the StartBar.

EndPrice

double

The vertical location (price) where the trend line ends.  The EndPrice is the price value of the EndBar. The pull-down menu offers these choices:

PRICE_CLOSE

PRICE_OPEN

PRICE_HIGH

PRICE_LOW

PRICE_MEDIAN

PRICE_TYPICAL

PRICE_WEIGHTED

EndOffset

integer

A positive or negative offset of the EndPrice, where 1 increment equals 1 point.  This value moves the end point of the line up or down vertically on the price chart.

LineColor*

Color

The color of the trend line.

DrawLabel*

boolean

Draws a label on the chart that contains the trend line's name.

DrawMarks*

boolean

Draws vertical lines on the chart on the Start and End bar locations.



* These parameters are found on the Advanced tab.