Syntax
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
Description
This function is used to create an object by a given the object type with a specified name.
Parameters
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 typeENUM_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.
Remark
If the object required time to create it then you can createthis object with afuture time.
Sample
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