Text_SetStyle (Reserved Word)

image\trumpet2.gif Disclaimer

A text object is always anchored at a specific bar and price value. There are three horizontal placement settings for the text object: to the left of the text object's bar, to the right, or centered. Also, there are three vertical placement settings: above the specified price, below the specified price, or centered on the specified price.

This reserved word sets the horizontal and vertical placement of the specified text object.

Value1 = Text_SetStyle(Text_ID, Horiz, Vert);

Text_ID is a numeric expression representing the ID number of the text object whose placement you want to change, and Horiz and Vert are numeric expressions representing the horizontal and vertical placement of the text object, respectively.

Value1 is any numeric variable or array. You may assign the text object reserved word to a numeric variable or array so that you can determine whether or not the reserved word performed its operation successfully.

You can use one of three horizontal placement values (Horiz):
 

Value

Placement

0

To the right of the bar specified for the text object

1

To the left of the bar specified for the text object

2

Centered on the bar specified for the text object

 

You can use one of three vertical placement values (Vert):
 

Value

Placement

0

Beneath the price specified for the text object

1

Above the price specified for the text object

2

Centered on the specified price location of the text object

If there are no text objects with the ID number you specify, or if the operation fails in any way, this reserved word will return a numeric expression corresponding to one of the EasyLanguage drawing objects error codes, and no additional operations will be performed on any text objects by the trading strategy, analysis technique, or function that generated the error. For a list of error codes, see EasyLanguage Drawing Object Error Codes.

Example

The following statement changes the placement of text object #3 so it is drawn to the left of the specified bar (based on date/time)  and sits above the specified price:

Text_SetStyle(3, 1, 1) ;