mirror of
https://github.com/vdemydiuk/mtapi.git
synced 2026-08-16 20:28:09 +00:00
Issue #41: Complete object functions in client side (MT5)
This commit is contained in:
@@ -127,8 +127,8 @@
|
|||||||
ObjectSetDouble = 82,
|
ObjectSetDouble = 82,
|
||||||
ObjectSetInteger = 83,
|
ObjectSetInteger = 83,
|
||||||
ObjectSetString = 84,
|
ObjectSetString = 84,
|
||||||
TextSetFont = 85,
|
//TextSetFont = 85,
|
||||||
TextOut = 86,
|
//TextOut = 86,
|
||||||
TextGetSize = 87
|
//TextGetSize = 87
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -742,6 +742,5 @@
|
|||||||
ALIGN_CENTER = 2, // Centered (only for the Edit object)
|
ALIGN_CENTER = 2, // Centered (only for the Edit object)
|
||||||
ALIGN_RIGHT = 0, // Right alignment
|
ALIGN_RIGHT = 0, // Right alignment
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
|
|||||||
+68
-2
@@ -1540,7 +1540,7 @@ namespace MtApi5
|
|||||||
}
|
}
|
||||||
|
|
||||||
///<summary>
|
///<summary>
|
||||||
///The function returns the number of objects in the specified chart, specified subwindow, of the specified type.
|
///The function sets the value of the corresponding object property. The object property must be of the double type.
|
||||||
///</summary>
|
///</summary>
|
||||||
///<param name="chartId">Chart identifier. 0 means the current chart.</param>
|
///<param name="chartId">Chart identifier. 0 means the current chart.</param>
|
||||||
///<param name="name">Name of the object.</param>
|
///<param name="name">Name of the object.</param>
|
||||||
@@ -1550,11 +1550,77 @@ namespace MtApi5
|
|||||||
|
|
||||||
{
|
{
|
||||||
var commandParameters = new ArrayList { chartId, name, (int)propId, propValue };
|
var commandParameters = new ArrayList { chartId, name, (int)propId, propValue };
|
||||||
return SendCommand<bool>(Mt5CommandType.ObjectsTotal, commandParameters);
|
return SendCommand<bool>(Mt5CommandType.ObjectSetDouble, commandParameters);
|
||||||
|
}
|
||||||
|
|
||||||
|
///<summary>
|
||||||
|
///The function sets the value of the corresponding object property. The object property must be of the datetime, int, color, bool or char type.
|
||||||
|
///</summary>
|
||||||
|
///<param name="chartId">Chart identifier. 0 means the current chart.</param>
|
||||||
|
///<param name="name">Name of the object.</param>
|
||||||
|
///<param name="propId">ID of the object property. The value can be one of the values of the ENUM_OBJECT_PROPERTY_INTEGER enumeration.</param>
|
||||||
|
///<param name="propValue">The value of the property.</param>
|
||||||
|
public bool ObjectSetInteger(long chartId, string name, ENUM_OBJECT_PROPERTY_INTEGER propId, long propValue)
|
||||||
|
|
||||||
|
{
|
||||||
|
var commandParameters = new ArrayList { chartId, name, (int)propId, propValue };
|
||||||
|
return SendCommand<bool>(Mt5CommandType.ObjectSetInteger, commandParameters);
|
||||||
|
}
|
||||||
|
|
||||||
|
///<summary>
|
||||||
|
///The function sets the value of the corresponding object property. The object property must be of the string type.
|
||||||
|
///</summary>
|
||||||
|
///<param name="chartId">Chart identifier. 0 means the current chart.</param>
|
||||||
|
///<param name="name">Name of the object.</param>
|
||||||
|
///<param name="propId">ID of the object property. The value can be one of the values of the ENUM_OBJECT_PROPERTY_STRING enumeration.</param>
|
||||||
|
///<param name="propValue">The value of the property.</param>
|
||||||
|
public bool ObjectSetString(long chartId, string name, ENUM_OBJECT_PROPERTY_STRING propId, string propValue)
|
||||||
|
|
||||||
|
{
|
||||||
|
var commandParameters = new ArrayList { chartId, name, (int)propId, propValue };
|
||||||
|
return SendCommand<bool>(Mt5CommandType.ObjectSetString, commandParameters);
|
||||||
|
}
|
||||||
|
|
||||||
|
///<summary>
|
||||||
|
///The function returns the value of the corresponding object property. The object property must be of the double type.
|
||||||
|
///</summary>
|
||||||
|
///<param name="chartId">Chart identifier. 0 means the current chart.</param>
|
||||||
|
///<param name="name">Name of the object.</param>
|
||||||
|
///<param name="propId">ID of the object property. The value can be one of the values of the ENUM_OBJECT_PROPERTY_DOUBLE enumeration.</param>
|
||||||
|
public double ObjectGetDouble(long chartId, string name, ENUM_OBJECT_PROPERTY_DOUBLE propId)
|
||||||
|
{
|
||||||
|
var commandParameters = new ArrayList { chartId, name, (int)propId };
|
||||||
|
return SendCommand<double>(Mt5CommandType.ObjectGetDouble, commandParameters);
|
||||||
|
}
|
||||||
|
|
||||||
|
///<summary>
|
||||||
|
///he function returns the value of the corresponding object property. The object property must be of the datetime, int, color, bool or char type.
|
||||||
|
///</summary>
|
||||||
|
///<param name="chartId">Chart identifier. 0 means the current chart.</param>
|
||||||
|
///<param name="name">Name of the object.</param>
|
||||||
|
///<param name="propId">ID of the object property. The value can be one of the values of the ENUM_OBJECT_PROPERTY_INTEGER enumeration.</param>
|
||||||
|
public long ObjectGetInteger(long chartId, string name, ENUM_OBJECT_PROPERTY_INTEGER propId)
|
||||||
|
{
|
||||||
|
var commandParameters = new ArrayList { chartId, name, (int)propId };
|
||||||
|
return SendCommand<long>(Mt5CommandType.ObjectGetInteger, commandParameters);
|
||||||
|
}
|
||||||
|
|
||||||
|
///<summary>
|
||||||
|
///The function returns the value of the corresponding object property. The object property must be of the string type.
|
||||||
|
///</summary>
|
||||||
|
///<param name="chartId">Chart identifier. 0 means the current chart.</param>
|
||||||
|
///<param name="name">Name of the object.</param>
|
||||||
|
///<param name="propId">ID of the object property. The value can be one of the values of the ENUM_OBJECT_PROPERTY_STRING enumeration.</param>
|
||||||
|
public string ObjectGetString(long chartId, string name, ENUM_OBJECT_PROPERTY_STRING propId)
|
||||||
|
{
|
||||||
|
var commandParameters = new ArrayList { chartId, name, (int)propId };
|
||||||
|
return SendCommand<string>(Mt5CommandType.ObjectGetString, commandParameters);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion //Object Functions
|
#endregion //Object Functions
|
||||||
|
|
||||||
|
#endregion // Public Methods
|
||||||
|
|
||||||
#region Properties
|
#region Properties
|
||||||
///<summary>
|
///<summary>
|
||||||
///Connection status of MetaTrader API.
|
///Connection status of MetaTrader API.
|
||||||
|
|||||||
Reference in New Issue
Block a user