Text_Float (Function)
The Text_Float series function is used to place text on a chart. The function maintains the position of a text object based on the "TextBarsBack" and "TextPricePercent" inputs. Inside the function, the TextBarsBack and TextPricePercent inputs are used in a call to Text_SetLocation.
The Text_FloatEx function provides similar functionality with extended capabilities, such as the ability to modify the color of the text.
Syntax
Text_Float(TextID, TextBarsBack, TextPricePercent)
Returns (Integer)
The function always returns a value of 1 (as an integer).
Parameters
|
Name |
Type |
Description |
|
TextID |
Numeric |
The ID number of an existing text object on a chart. The text must already exist. See Text_New. |
|
TextBarsBack |
Numeric |
Numeric value representing the number of bars back from right of chart at which to maintain location of the text. |
|
TextPricePercent |
Numeric |
Numeric value of a percentage used to determine the vertical location of the text object between the highest and lowest visible prices. |
Remarks
The Text_Float function is used to maintain the position of a specified text object when new bars form, bar spacing is changed, or the range of prices displayed on the chart is changed.
The value of TextPricePercent should an integer from 0 to 100. The value of TextBarsBack should be an integer ranging from 0 (for the current bar) to the maximum number of bars back on the chart.
Example
This example creates a new text object containing the text "Target" and positions it to a floating location at the 5th bar from the right and 75% of the visible price range.
once
begin
Value1 = Text_New( 0, 0, 0, "Target" );
end;
Value2 = Text_Float( Value1, 5, 75 );