Posted by Mohammad Rahhal, Last modified by Diana Alkouni on 08 September 2020 07:22 AM


Public Function AddObject (chart_id As Long, name As String, objType As ENUM_OBJECT, nwin As Long, time1 As String, price1 As Double, Optional time2 As String = "0", Optional price2 As Double = 0,Optional vColor As Long=0,Optional vWieght As Integer=1) As Boolean


This function is used to create an object by a given the object type with a specified name.


Key Description
chart_Id Chart identifier. 0 mean the current chart, value of type Long.
name Object key, the value of type String.
objType The type of object that wants to add, the value of type ENUM_OBJECT.
nwin Chart subwindow, the value of type Long.
time1 The time coordinate of the first anchor, the value of type String.
price1 The price coordinate of the first point, the value of type Double.
time2 The time coordinate of the second anchor, the optional value of type String.
price2 The price coordinate of the second point, the optional value of type Double.
vColor  The object color, the optional value of type Long.
vWieght Object weight, the optional value of type Integer.

Return value

Returns true if the object is created. Otherwise returns false. In order to get an error , call GetLastError() function.


If the object required time to create it then you can create this object with a future time.  


 Public Sub main ()
 Dim ObjID 
 ObjID = “Rec” 
 AlertMessage AddObject (0, Cstr (ObjID), OBJ_RECTANGLE, 0,”13/06/2016 12:22:00”, 1.12787,”13/06/2016 12:03:00”, 1.262)  ‘Return true if object added successfully  
 End sub

See Also

Back to VTL Client Script Index

(1 vote(s))
Not helpful

Comments (0)
Post a new comment
Full Name:
CAPTCHA Verification 
Please enter the text you see in the image into the textbox below (we use this to prevent automated submissions).

Help Desk Software by Hybrid Solutions