Posted by Mohammad Rahhal, Last modified by Salameh Abu Hashish on 14 January 2019 12:26 PM


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 specified name.


Key Description
chart_Id Chart identifier. 0 mean the current chart, value of type Long.
name Object key,value of type String.
objType The type of object that want to add ,value of type ENUM_OBJECT.
nwin Chart sub window ,value of type Long.
time1 The time coordinate of the first anchor, value of type String.
price1 The price coordinate of the first point, value of type Double.
time2 The time coordinate of the second anchor,optional value of type String.
price2 The price coordinate of the second point,optional value of type Double.
vColor  The object color ,optional value of type Long.
vWieght Object weight,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 a 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