+1 888 340 6572

Text SetLocation: Difference between revisions

From MultiCharts
(Created page with "Modifies the location of a text object with the specified ID number; returns a value of 0 if the location of the object was successfully modified, and a value of -2 if the spe...")
 
m (Reverted edits by 176.8.90.7 (talk) to last revision by JoshM)
 
(3 intermediate revisions by 2 users not shown)
Line 1: Line 1:
Modifies the location of a text object with the specified ID number; returns a value of 0 if the location of the object was successfully modified, and a value of -2 if the specified object ID number is invalid.  
Modifies the location of a text object with the specified ID number.
 
Text_SetLocation returns a value of 0 if the location of the object was successfully modified, and a value of -2 if the specified object ID number is invalid.  
   
   
==== Usage ====
== Usage ==
<syntaxhighlight>Text_SetLocation (ObjectID, BarDate, BarTime, PriceValue)</syntaxhighlight>  
<syntaxhighlight>Text_SetLocation (ObjectID, BarDate, BarTime, PriceValue)</syntaxhighlight>  


==== Parameters ====  
== Parameters ==  
[[ObjectID]] - a numerical expression specifying the object ID number  
:'''ObjectID''' - a numerical expression specifying the object ID number.


[[BarDate]] - a numerical expression specifying the date of the bar at which the object is to be placed; the date is indicated in the YYYMMdd format, where YYY is the number of years since 1900, MM is the month, and dd is the day of the month  
:'''BarDate''' - a numerical expression specifying the date of the bar at which the object is to be placed; the date is indicated in the ''YYYMMdd'' format, where YYY is the number of years since 1900, MM is the month, and dd is the day of the month.


[[BarTime]] - a numerical expression specifying the time of the bar at which the object is to be placed; the time is indicated in the 24-hour HHmm format, where 1300 = 1:00 PM  
:'''BarTime''' - a numerical expression specifying the time of the bar at which the object is to be placed; the time is indicated in the 24-hour ''HHmm'' format, where 1300 = 1:00 PM.


[[PriceValue]] - a numerical expression specifying the price value (vertical position, corresponding to a value on the price scale of a chart), where the object is to be placed  
:'''PriceValue''' - a numerical expression specifying the price value (vertical position, corresponding to a value on the price scale of a chart), where the object is to be placed.
   
   
==== Notes ====  
== Notes ==
An object-specific ID number is returned by [[Text_New]] when the text object is created.  
* An object-specific ID number is returned by [[Text_New]] when the text object is created.  
* Use [[Text_SetLocation_s]] to modify the location of a text object with seconds precision.
==== Example ====
* Use [[Text_GetTime]], [[Text_GetTime_s]] and [[Text_GetDate]] to get the location of a specific text object.
 
== Example ==
Move the text object with an ID number of 3 to the top of the current bar:  
Move the text object with an ID number of 3 to the top of the current bar:  


<syntaxhighlight>Value1=Text_SetLocation(3,Date,Time,High);</syntaxhighlight>
<syntaxhighlight>Value1 = Text_SetLocation(3, Date, Time, High);</syntaxhighlight>


[[Category:Text Drawing]]
[[Category:Text Drawing]]

Latest revision as of 12:42, 13 February 2012

Modifies the location of a text object with the specified ID number.

Text_SetLocation returns a value of 0 if the location of the object was successfully modified, and a value of -2 if the specified object ID number is invalid.

Usage

Text_SetLocation (ObjectID, BarDate, BarTime, PriceValue)

Parameters

ObjectID - a numerical expression specifying the object ID number.
BarDate - a numerical expression specifying the date of the bar at which the object is to be placed; the date is indicated in the YYYMMdd format, where YYY is the number of years since 1900, MM is the month, and dd is the day of the month.
BarTime - a numerical expression specifying the time of the bar at which the object is to be placed; the time is indicated in the 24-hour HHmm format, where 1300 = 1:00 PM.
PriceValue - a numerical expression specifying the price value (vertical position, corresponding to a value on the price scale of a chart), where the object is to be placed.

Notes

Example

Move the text object with an ID number of 3 to the top of the current bar:

Value1 = Text_SetLocation(3, Date, Time, High);