ObjectCreate ()
ObjectDelete ()
ObjectDescription ()
ObjectFind ()
ObjectGet ()
ObjectGetShiftByValue ()
ObjectGetValueByShift ()
ObjectMove ()
ObjectName ()
ObjectsDeleteAll ()
ObjectSet ()
ObjectSetText ()
ObjectsRedraw
ObjectsTotal ()
ObjectType ()
bool ObjectCreate (String name, int type "int" window, datetime time1, double price1, datetime time2 = 0, double price2 = 0, datetime time3 = 0, double price3 = 0)
Create an object with the specified name, type and initial coordinates in the specified window. Count of coordinates related object of type (1-3). If the function succeeds, the return value is true. If the function does, the return value is false. To get extended error information, call GetLastError ().
Note: Coordinates must be passed with a two part - time and price. For example: Subject OBJ_VLINE requires a coordinated part of the time. But it also wants seconds function of coordinating price.
Parameters
name - the unique object name.
Type - object type. It could be some sort of object enumeration values.
window - window index where the object will be added. Window index must be greater than or equal to 0 and less than WindowsTotal ().
time1 - time of the first point.
price1 - Price of the first point.
time2 - time of the second point.
price2 - Price of the second point.
time3 - Time of the third point.
price3 - Price of the third point.
Sample
ObjectCreate ("text_object", OBJ_TEXT, 0, T'2004 .02.20 12-30, 1,0045);
bool ObjectDelete (string name)
Deletes object with a name. If the function succeeds, the return value is true. If the function does, the return value is false. To get extended error information, call GetLastError ().
Parameters
name - Deleting an object name.
Sample
ObjectDelete ("text_object");
ObjectDescription string (string name)
Return the object description. To get error information, call GetLastError () function.
Parameters
Name - object name.
Sample
obj_name = ObjectName (idx);
Print ("Object" + obj_name> "description =" + ObjectDescription (obj_name));
int ObjectFind (string name)
Go back window owning object index. If the function fails, the return value is -1.
Parameters
name - Object name to check.
Sample
if (ObjectFind ("line_object2") = win_idx!) return (0);
double ObjectGet (String name, int index)
Returns value of the items by index. To check errors, call GetLastError () function.
Parameters
Name - object name.
Index - object property index. It could be any of the properies of the object enumeration values.
Sample
color oldColor = ObjectGet ("hline12", OBJPROP_COLOR);
int ObjectGetShiftByValue (string name, double value)
Count the bar and rebound index suggested price. Calculated with first and second coordinate. Apply the trendlines.
Parameters
Name - object name.
value - value price.
Sample
"Int" = change ObjectGetShiftByValue ("MyTrendLine # 123, 1.34);
double ObjectGetValueByShift (String name, int shift)
Calculates and returns a value for the price indicated bar. Calculated with first and second coordinate. Apply the trendlines.
Parameters
Name - object name
change - Bar index.
Sample
double price = ObjectGetValueByShift ("MyTrendLine # 123, 11);
bool ObjectMove (String name, int item, datetime time1, double price1)
Move objects point to the table. Objects can have from one to three points relating to it's type. If the function succeeds, the return value is true. If the function does, the return value is false. To get extended error information, call GetLastError ().
Parameters
Name - object name.
point - Coordinate index.
time1 - New time value.
price1 - new price value.
Sample
ObjectMove ("MyTrend", 1, T'2005 .02.25 12:30, 1,2345);
string ObjectName (int index)
Returns an object name by index.
Parameters
Index structure - the index of the table. Purpose of the index must be greater than or equal to 0 and less than ObjectsTotal ().
Sample
int obj_total = ObjectsTotal ();
string name;
for (int i = 0; i
name = ObjectName (i);
Print (i, "Object name is" + name);
}
int ObjectsDeleteAll (int window, int type = empty)
Removes all objects of specified type and specified subwindow of the scheme. Returns removed objects count.
Parameters
window - window index of the facilities will be deleted. Window index must be greater than or equal to 0 and less than WindowsTotal ().
type - Optional object type to delete. It could be some sort of object enumeration constant values or empty to delete all objects of all kinds.
Sample
ObjectsDeleteAll (2, OBJ_HLINE); / / horizontal line removes all items from window 3 (index 2).
bool ObjectSet (String name, int index, double value)
Changes Name objects with a new property value. If the function succeeds, the return value is true. If the function does, the return value is false. To get extended error information, call GetLastError ().
Parameters
Name - object name.
Index - object index value. It could be any of the properies of the object enumeration values.
value - new value for the property.
Sample
/ / Move to last coord first time bar
ObjectSet ("MyTrend", OBJPROP_TIME1, Time [0]);
/ / Set the second Fibo level
ObjectSet ("MyFibo", OBJPROP_FIBOLEVELS +1, 1,234);
/ / Set the object visibility. object will be displayed just 15 minutes and 1 hour charts
ObjectSet ("MyObject", OBJPROP_TIMEFRAMES, OBJ_PERIOD_M15 | Obj_PERIOD_H1);
bool ObjectSetText (String name, String text, int font_size, string font = NULL, color text_color = CLR_NONE)
Sets the description of the object. If the function succeeds, the return value is true. If the function does, the return value is false. To get extended error information, call GetLastError () function.
Parameters
Name - object name.
Text - Some text.
font_size - font size in points.
font - the font name.
text_color - The color of the text.
Sample
ObjectSetText ("text_object", "Hi!", "Times New Roman", 10, green);
void ObjectsRedraw ()
Redraws all objects on the sign.
Sample
ObjectsRedraw ();
int ObjectsTotal ()
Returns the total number of objects in the table.
Sample
int obj_total = ObjectsTotal ();
string name;
for (int i = 0; i
name = ObjectName (i);
Print (i, "Object name / subject" I "is" + name);
}
int ObjectType (String name)
Return the Object type enumeration value.
Parameters
Name - object name.
Sample
if (ObjectType ("line_object2") = OBJ_HLINE!) return (0);



0 comments:
Post a Comment