|
|
|
@@ -456,7 +456,7 @@ namespace MtApi5
|
|
|
|
|
///<param name="propertyId"> Identifier of a deal property.</param>
|
|
|
|
|
public double HistoryDealGetDouble(ulong ticketNumber, ENUM_DEAL_PROPERTY_DOUBLE propertyId)
|
|
|
|
|
{
|
|
|
|
|
var commandParameters = new ArrayList { ticketNumber, propertyId };
|
|
|
|
|
var commandParameters = new ArrayList { ticketNumber, (int)propertyId };
|
|
|
|
|
|
|
|
|
|
return SendCommand<double>(Mt5CommandType.HistoryDealGetDouble, commandParameters);
|
|
|
|
|
}
|
|
|
|
@@ -468,7 +468,7 @@ namespace MtApi5
|
|
|
|
|
///<param name="propertyId"> Identifier of a deal property.</param>
|
|
|
|
|
public long HistoryDealGetInteger(ulong ticketNumber, ENUM_DEAL_PROPERTY_INTEGER propertyId)
|
|
|
|
|
{
|
|
|
|
|
var commandParameters = new ArrayList { ticketNumber, propertyId };
|
|
|
|
|
var commandParameters = new ArrayList { ticketNumber, (int)propertyId };
|
|
|
|
|
|
|
|
|
|
return SendCommand<long>(Mt5CommandType.HistoryDealGetInteger, commandParameters);
|
|
|
|
|
}
|
|
|
|
@@ -480,7 +480,7 @@ namespace MtApi5
|
|
|
|
|
///<param name="propertyId"> Identifier of a deal property.</param>
|
|
|
|
|
public string HistoryDealGetString(ulong ticketNumber, ENUM_DEAL_PROPERTY_STRING propertyId)
|
|
|
|
|
{
|
|
|
|
|
var commandParameters = new ArrayList { ticketNumber, propertyId };
|
|
|
|
|
var commandParameters = new ArrayList { ticketNumber, (int)propertyId };
|
|
|
|
|
|
|
|
|
|
return SendCommand<string>(Mt5CommandType.HistoryDealGetString, commandParameters);
|
|
|
|
|
}
|
|
|
|
@@ -522,6 +522,25 @@ namespace MtApi5
|
|
|
|
|
|
|
|
|
|
return SendCommand<bool>(Mt5CommandType.PositionOpen, commandParameters);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Opens a position with the specified parameters.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="symbol">symbol</param>
|
|
|
|
|
/// <param name="orderType">order type to open position </param>
|
|
|
|
|
/// <param name="volume">position volume</param>
|
|
|
|
|
/// <param name="price">execution price</param>
|
|
|
|
|
/// <param name="sl">Stop Loss price</param>
|
|
|
|
|
/// <param name="tp">Take Profit price</param>
|
|
|
|
|
/// <param name="comment">comment</param>
|
|
|
|
|
/// <returns>true - successful check of the basic structures, otherwise - false.</returns>
|
|
|
|
|
public bool PositionOpen(string symbol, ENUM_ORDER_TYPE orderType, double volume, double price, double sl, double tp, string comment , out MqlTradeResult result)
|
|
|
|
|
{
|
|
|
|
|
var commandParameters = new ArrayList { symbol, (int)orderType, volume, price, sl, tp, comment };
|
|
|
|
|
|
|
|
|
|
var strResult = SendCommand<string>(Mt5CommandType.PositionOpenWithResult, commandParameters);
|
|
|
|
|
return strResult.ParseResult(ParamSeparator, out result);
|
|
|
|
|
}
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#region Account Information functions
|
|
|
|
@@ -1419,9 +1438,769 @@ namespace MtApi5
|
|
|
|
|
|
|
|
|
|
return SendCommand<bool>(Mt5CommandType.Print, commandParameters);
|
|
|
|
|
}
|
|
|
|
|
#endregion
|
|
|
|
|
#endregion // Common Functions
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
#region Object Functions
|
|
|
|
|
|
|
|
|
|
///<summary>
|
|
|
|
|
///The function creates an object with the specified name, type, and the initial coordinates in the specified chart subwindow.
|
|
|
|
|
///</summary>
|
|
|
|
|
///<param name="chartId">Chart identifier. 0 means the current chart.</param>
|
|
|
|
|
///<param name="name">Name of the object. The name must be unique within a chart, including its subwindows.</param>
|
|
|
|
|
///<param name="type">Object type. The value can be one of the values of the ENUM_OBJECT enumeration.</param>
|
|
|
|
|
///<param name="nwin">Number of the chart subwindow. 0 means the main chart window. The specified subwindow must exist, otherwise the function returns false.</param>
|
|
|
|
|
///<param name="time">The time coordinate of the first anchor.</param>
|
|
|
|
|
///<param name="price">The price coordinate of the first anchor point.</param>
|
|
|
|
|
public bool ObjectCreate(long chartId, string name, ENUM_OBJECT type, int nwin, DateTime time, double price)
|
|
|
|
|
{
|
|
|
|
|
var commandParameters = new ArrayList { chartId, name, (int)type, nwin, Mt5TimeConverter.ConvertToMtTime(time), price };
|
|
|
|
|
return SendCommand<bool>(Mt5CommandType.ObjectCreate, commandParameters);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
///<summary>
|
|
|
|
|
///The function returns the name of the corresponding object in the specified chart, in the specified subwindow, of the specified type.
|
|
|
|
|
///</summary>
|
|
|
|
|
///<param name="chartId">Chart identifier. 0 means the current chart.</param>
|
|
|
|
|
///<param name="pos">Ordinal number of the object according to the specified filter by the number and type of the subwindow.</param>
|
|
|
|
|
///<param name="subWindow">umber of the chart subwindow. 0 means the main chart window, -1 means all the subwindows of the chart, including the main window.</param>
|
|
|
|
|
///<param name="type">Type of the object. The value can be one of the values of the ENUM_OBJECT enumeration. -1 means all types.</param>
|
|
|
|
|
public string ObjectName(long chartId, int pos, int subWindow = -1, int type = -1)
|
|
|
|
|
{
|
|
|
|
|
var commandParameters = new ArrayList { chartId, pos, subWindow, type };
|
|
|
|
|
return SendCommand<string>(Mt5CommandType.ObjectName, commandParameters);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
///<summary>
|
|
|
|
|
///The function removes the object with the specified name from the specified chart.
|
|
|
|
|
///</summary>
|
|
|
|
|
///<param name="chartId">Chart identifier. 0 means the current chart.</param>
|
|
|
|
|
///<param name="name">Name of object to be deleted.</param>
|
|
|
|
|
public bool ObjectDelete(long chartId, string name)
|
|
|
|
|
{
|
|
|
|
|
var commandParameters = new ArrayList { chartId, name };
|
|
|
|
|
return SendCommand<bool>(Mt5CommandType.ObjectDelete, commandParameters);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
///<summary>
|
|
|
|
|
///The function removes the object with the specified name from the specified chart.
|
|
|
|
|
///</summary>
|
|
|
|
|
///<param name="chartId">Chart identifier. 0 means the current chart.</param>
|
|
|
|
|
///<param name="subWindow">Number of the chart subwindow. 0 means the main chart window, -1 means all the subwindows of the chart, including the main window.</param>
|
|
|
|
|
///<param name="type">Type of the object. The value can be one of the values of the ENUM_OBJECT enumeration. -1 means all types.</param>
|
|
|
|
|
public int ObjectsDeleteAll(long chartId, int subWindow = -1, int type = -1)
|
|
|
|
|
{
|
|
|
|
|
var commandParameters = new ArrayList { chartId, subWindow, type };
|
|
|
|
|
return SendCommand<int>(Mt5CommandType.ObjectsDeleteAll, commandParameters);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
///<summary>
|
|
|
|
|
///The function searches for an object with the specified name in the chart with the specified ID.
|
|
|
|
|
///</summary>
|
|
|
|
|
///<param name="chartId">Chart identifier. 0 means the current chart.</param>
|
|
|
|
|
///<param name="name">The name of the searched object.</param>
|
|
|
|
|
public int ObjectFind(long chartId, string name)
|
|
|
|
|
{
|
|
|
|
|
var commandParameters = new ArrayList { chartId, name };
|
|
|
|
|
return SendCommand<int>(Mt5CommandType.ObjectFind, commandParameters);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
///<summary>
|
|
|
|
|
///The function returns the time value for the specified price value of the specified object.
|
|
|
|
|
///</summary>
|
|
|
|
|
///<param name="chartId">Chart identifier. 0 means the current chart.</param>
|
|
|
|
|
///<param name="name">Name of the object.</param>
|
|
|
|
|
///<param name="value">Price value.</param>
|
|
|
|
|
///<param name="lineId">Line identifier.</param>
|
|
|
|
|
public DateTime ObjectGetTimeByValue(long chartId, string name, double value, int lineId)
|
|
|
|
|
{
|
|
|
|
|
var commandParameters = new ArrayList { chartId, name, value, lineId };
|
|
|
|
|
var res = SendCommand<int>(Mt5CommandType.ObjectGetTimeByValue, commandParameters);
|
|
|
|
|
return Mt5TimeConverter.ConvertFromMtTime(res);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
///<summary>
|
|
|
|
|
///The function returns the price value for the specified time value of the specified object.
|
|
|
|
|
///</summary>
|
|
|
|
|
///<param name="chartId">Chart identifier. 0 means the current chart.</param>
|
|
|
|
|
///<param name="name">Name of the object.</param>
|
|
|
|
|
///<param name="time">Time value.</param>
|
|
|
|
|
///<param name="lineId">Line identifier.</param>
|
|
|
|
|
public double ObjectGetValueByTime(long chartId, string name, DateTime time, int lineId)
|
|
|
|
|
{
|
|
|
|
|
var commandParameters = new ArrayList { chartId, name, Mt5TimeConverter.ConvertToMtTime(time), lineId };
|
|
|
|
|
return SendCommand<double>(Mt5CommandType.ObjectGetValueByTime, commandParameters);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
///<summary>
|
|
|
|
|
///The function changes coordinates of the specified anchor point of the object.
|
|
|
|
|
///</summary>
|
|
|
|
|
///<param name="chartId">Chart identifier. 0 means the current chart.</param>
|
|
|
|
|
///<param name="name">Name of the object.</param>
|
|
|
|
|
///<param name="pointIndex">Index of the anchor point. The number of anchor points depends on the type of object.</param>
|
|
|
|
|
///<param name="time">Time coordinate of the selected anchor point.</param>
|
|
|
|
|
///<param name="price">Price coordinate of the selected anchor point.</param>
|
|
|
|
|
public bool ObjectMove(long chartId, string name, int pointIndex, DateTime time, double price)
|
|
|
|
|
{
|
|
|
|
|
var commandParameters = new ArrayList { chartId, name, pointIndex, Mt5TimeConverter.ConvertToMtTime(time), price };
|
|
|
|
|
return SendCommand<bool>(Mt5CommandType.ObjectMove, commandParameters);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
///<summary>
|
|
|
|
|
///The function returns the number of objects in the specified chart, specified subwindow, of the specified type.
|
|
|
|
|
///</summary>
|
|
|
|
|
///<param name="chartId">Chart identifier. 0 means the current chart.</param>
|
|
|
|
|
///<param name="subWindow">Number of the chart subwindow. 0 means the main chart window, -1 means all the subwindows of the chart, including the main window.</param>
|
|
|
|
|
///<param name="type">Type of the object. The value can be one of the values of the ENUM_OBJECT enumeration. -1 means all types.</param>
|
|
|
|
|
public int ObjectsTotal(long chartId, int subWindow = -1, int type = -1)
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
var commandParameters = new ArrayList { chartId, subWindow, type };
|
|
|
|
|
return SendCommand<int>(Mt5CommandType.ObjectsTotal, commandParameters);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
///<summary>
|
|
|
|
|
///The function sets 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>
|
|
|
|
|
///<param name="propValue">The value of the property.</param>
|
|
|
|
|
public bool ObjectSetDouble(long chartId, string name, ENUM_OBJECT_PROPERTY_DOUBLE propId, double propValue)
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
var commandParameters = new ArrayList { chartId, name, (int)propId, propValue };
|
|
|
|
|
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
|
|
|
|
|
|
|
|
|
|
#region Technical Indicators
|
|
|
|
|
|
|
|
|
|
#endregion //Technical Indicators
|
|
|
|
|
|
|
|
|
|
///<summary>
|
|
|
|
|
///The function creates Accelerator Oscillator in a global cache of the client terminal and returns its handle.
|
|
|
|
|
///</summary>
|
|
|
|
|
///<param name="symbol">The symbol name of the security, the data of which should be used to calculate the indicator.</param>
|
|
|
|
|
///<param name="period">The value of the period can be one of the ENUM_TIMEFRAMES enumeration values, 0 means the current timeframe.</param>
|
|
|
|
|
public int iAC(string symbol, ENUM_TIMEFRAMES period)
|
|
|
|
|
{
|
|
|
|
|
var commandParameters = new ArrayList { symbol, (int)period };
|
|
|
|
|
return SendCommand<int>(Mt5CommandType.iAC, commandParameters);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
///<summary>
|
|
|
|
|
///The function returns the handle of the Accumulation/Distribution indicator.
|
|
|
|
|
///</summary>
|
|
|
|
|
///<param name="symbol">The symbol name of the security, the data of which should be used to calculate the indicator.</param>
|
|
|
|
|
///<param name="period">The value of the period can be one of the ENUM_TIMEFRAMES enumeration values, 0 means the current timeframe.</param>
|
|
|
|
|
///<param name="appliedVolume">The volume used. Can be any of ENUM_APPLIED_VOLUME values.</param>
|
|
|
|
|
public int iAD(string symbol, ENUM_TIMEFRAMES period, ENUM_APPLIED_VOLUME appliedVolume)
|
|
|
|
|
{
|
|
|
|
|
var commandParameters = new ArrayList { symbol, (int)period, (int)appliedVolume };
|
|
|
|
|
return SendCommand<int>(Mt5CommandType.iAD, commandParameters);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
///<summary>
|
|
|
|
|
///The function returns the handle of the Average Directional Movement Index indicator.
|
|
|
|
|
///</summary>
|
|
|
|
|
///<param name="symbol">The symbol name of the security, the data of which should be used to calculate the indicator.</param>
|
|
|
|
|
///<param name="period">The value of the period can be one of the ENUM_TIMEFRAMES enumeration values, 0 means the current timeframe.</param>
|
|
|
|
|
///<param name="adxPeriod">Period to calculate the index.</param>
|
|
|
|
|
public int iADX(string symbol, ENUM_TIMEFRAMES period, int adxPeriod)
|
|
|
|
|
{
|
|
|
|
|
var commandParameters = new ArrayList { symbol, (int)period, adxPeriod };
|
|
|
|
|
return SendCommand<int>(Mt5CommandType.iADX, commandParameters);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
///<summary>
|
|
|
|
|
///The function returns the handle of Average Directional Movement Index by Welles Wilder.
|
|
|
|
|
///</summary>
|
|
|
|
|
///<param name="symbol">The symbol name of the security, the data of which should be used to calculate the indicator.</param>
|
|
|
|
|
///<param name="period">The value of the period can be one of the ENUM_TIMEFRAMES enumeration values, 0 means the current timeframe.</param>
|
|
|
|
|
///<param name="adxPeriod">Period to calculate the index.</param>
|
|
|
|
|
public int iADXWilder(string symbol, ENUM_TIMEFRAMES period, int adxPeriod)
|
|
|
|
|
{
|
|
|
|
|
var commandParameters = new ArrayList { symbol, (int)period, adxPeriod };
|
|
|
|
|
return SendCommand<int>(Mt5CommandType.iADXWilder, commandParameters);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
///<summary>
|
|
|
|
|
///The function returns the handle of the Alligator indicator.
|
|
|
|
|
///</summary>
|
|
|
|
|
///<param name="symbol">The symbol name of the security, the data of which should be used to calculate the indicator.</param>
|
|
|
|
|
///<param name="period">The value of the period can be one of the ENUM_TIMEFRAMES enumeration values, 0 means the current timeframe.</param>
|
|
|
|
|
///<param name="jawPeriod">Averaging period for the blue line (Alligator's Jaw).</param>
|
|
|
|
|
///<param name="jawShift">The shift of the blue line relative to the price chart.</param>
|
|
|
|
|
///<param name="teethPeriod">Averaging period for the red line (Alligator's Teeth).</param>
|
|
|
|
|
///<param name="teethShift">The shift of the red line relative to the price chart.</param>
|
|
|
|
|
///<param name="lipsPeriod">Averaging period for the green line (Alligator's lips).</param>
|
|
|
|
|
///<param name="lipsShift">The shift of the green line relative to the price chart.</param>
|
|
|
|
|
///<param name="maMethod">The method of averaging. Can be any of the ENUM_MA_METHOD values.</param>
|
|
|
|
|
///<param name="appliedPrice">The price used. Can be any of the price constants ENUM_APPLIED_PRICE or a handle of another indicator.</param>
|
|
|
|
|
public int iAlligator(string symbol, ENUM_TIMEFRAMES period, int jawPeriod, int jawShift, int teethPeriod,
|
|
|
|
|
int teethShift, int lipsPeriod, int lipsShift, ENUM_MA_METHOD maMethod, ENUM_APPLIED_PRICE appliedPrice)
|
|
|
|
|
{
|
|
|
|
|
var commandParameters = new ArrayList { symbol, (int)period, jawPeriod, jawShift, teethPeriod, teethShift, lipsPeriod, lipsShift, (int)maMethod, (int)appliedPrice };
|
|
|
|
|
return SendCommand<int>(Mt5CommandType.iAlligator, commandParameters);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
///<summary>
|
|
|
|
|
///The function returns the handle of the Adaptive Moving Average indicator.
|
|
|
|
|
///</summary>
|
|
|
|
|
///<param name="symbol">The symbol name of the security, the data of which should be used to calculate the indicator.</param>
|
|
|
|
|
///<param name="period">The value of the period can be one of the ENUM_TIMEFRAMES enumeration values, 0 means the current timeframe.</param>
|
|
|
|
|
///<param name="amaPeriod">The calculation period, on which the efficiency coefficient is calculated.</param>
|
|
|
|
|
///<param name="fastMaPeriod">Fast period for the smoothing coefficient calculation for a rapid market.</param>
|
|
|
|
|
///<param name="slowMaPeriod">Slow period for the smoothing coefficient calculation in the absence of trend.</param>
|
|
|
|
|
///<param name="amaShift">Shift of the indicator relative to the price chart.</param>
|
|
|
|
|
///<param name="appliedPrice">The price used. Can be any of the price constants ENUM_APPLIED_PRICE or a handle of another indicator.</param>
|
|
|
|
|
public int iAMA(string symbol, ENUM_TIMEFRAMES period, int amaPeriod, int fastMaPeriod, int slowMaPeriod, int amaShift, ENUM_APPLIED_PRICE appliedPrice)
|
|
|
|
|
{
|
|
|
|
|
var commandParameters = new ArrayList { symbol, (int)period, amaPeriod, fastMaPeriod, slowMaPeriod, amaShift, (int)appliedPrice };
|
|
|
|
|
return SendCommand<int>(Mt5CommandType.iAMA, commandParameters);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
///<summary>
|
|
|
|
|
///The function returns the handle of the Awesome Oscillator indicator.
|
|
|
|
|
///</summary>
|
|
|
|
|
///<param name="symbol">The symbol name of the security, the data of which should be used to calculate the indicator.</param>
|
|
|
|
|
///<param name="period">The value of the period can be one of the ENUM_TIMEFRAMES enumeration values, 0 means the current timeframe.</param>
|
|
|
|
|
public int iAO(string symbol, ENUM_TIMEFRAMES period)
|
|
|
|
|
{
|
|
|
|
|
var commandParameters = new ArrayList { symbol, (int)period };
|
|
|
|
|
return SendCommand<int>(Mt5CommandType.iAO, commandParameters);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
///<summary>
|
|
|
|
|
///The function returns the handle of the Average True Range indicator.
|
|
|
|
|
///</summary>
|
|
|
|
|
///<param name="symbol">The symbol name of the security, the data of which should be used to calculate the indicator.</param>
|
|
|
|
|
///<param name="period">The value of the period can be one of the ENUM_TIMEFRAMES enumeration values, 0 means the current timeframe.</param>
|
|
|
|
|
///<param name="maPeriod">The value of the averaging period for the indicator calculation.</param>
|
|
|
|
|
public int iATR(string symbol, ENUM_TIMEFRAMES period, int maPeriod)
|
|
|
|
|
{
|
|
|
|
|
var commandParameters = new ArrayList { symbol, (int)period, maPeriod };
|
|
|
|
|
return SendCommand<int>(Mt5CommandType.iATR, commandParameters);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
///<summary>
|
|
|
|
|
///The function returns the handle of the Bears Power indicator.
|
|
|
|
|
///</summary>
|
|
|
|
|
///<param name="symbol">The symbol name of the security, the data of which should be used to calculate the indicator.</param>
|
|
|
|
|
///<param name="period">The value of the period can be one of the ENUM_TIMEFRAMES enumeration values, 0 means the current timeframe.</param>
|
|
|
|
|
///<param name="maPeriod">The value of the averaging period for the indicator calculation.</param>
|
|
|
|
|
public int iBearsPower(string symbol, ENUM_TIMEFRAMES period, int maPeriod)
|
|
|
|
|
{
|
|
|
|
|
var commandParameters = new ArrayList { symbol, (int)period, maPeriod };
|
|
|
|
|
return SendCommand<int>(Mt5CommandType.iBearsPower, commandParameters);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
///<summary>
|
|
|
|
|
///The function returns the handle of the Bollinger Bands® indicator.
|
|
|
|
|
///</summary>
|
|
|
|
|
///<param name="symbol">The symbol name of the security, the data of which should be used to calculate the indicator.</param>
|
|
|
|
|
///<param name="period">The value of the period can be one of the ENUM_TIMEFRAMES enumeration values, 0 means the current timeframe.</param>
|
|
|
|
|
///<param name="bandsPeriod">The averaging period of the main line of the indicator.</param>
|
|
|
|
|
///<param name="bandsShift">The shift the indicator relative to the price chart.</param>
|
|
|
|
|
///<param name="deviation">Deviation from the main line.</param>
|
|
|
|
|
///<param name="appliedPrice">The price used. Can be any of the price constants ENUM_APPLIED_PRICE or a handle of another indicator.</param>
|
|
|
|
|
public int iBands(string symbol, ENUM_TIMEFRAMES period, int bandsPeriod, int bandsShift, double deviation, ENUM_APPLIED_PRICE appliedPrice)
|
|
|
|
|
{
|
|
|
|
|
var commandParameters = new ArrayList { symbol, (int)period, bandsPeriod, bandsShift, deviation, (int)appliedPrice };
|
|
|
|
|
return SendCommand<int>(Mt5CommandType.iBands, commandParameters);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
///<summary>
|
|
|
|
|
///The function returns the handle of the Bulls Power indicator.
|
|
|
|
|
///</summary>
|
|
|
|
|
///<param name="symbol">The symbol name of the security, the data of which should be used to calculate the indicator.</param>
|
|
|
|
|
///<param name="period">The value of the period can be one of the ENUM_TIMEFRAMES enumeration values, 0 means the current timeframe.</param>
|
|
|
|
|
///<param name="maPeriod">The averaging period for the indicator calculation.</param>
|
|
|
|
|
public int iBullsPower(string symbol, ENUM_TIMEFRAMES period, int maPeriod)
|
|
|
|
|
{
|
|
|
|
|
var commandParameters = new ArrayList { symbol, (int)period, maPeriod };
|
|
|
|
|
return SendCommand<int>(Mt5CommandType.iBullsPower, commandParameters);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
///<summary>
|
|
|
|
|
///The function returns the handle of the Commodity Channel Index indicator.
|
|
|
|
|
///</summary>
|
|
|
|
|
///<param name="symbol">The symbol name of the security, the data of which should be used to calculate the indicator.</param>
|
|
|
|
|
///<param name="period">The value of the period can be one of the ENUM_TIMEFRAMES enumeration values, 0 means the current timeframe.</param>
|
|
|
|
|
///<param name="maPeriod">The averaging period for the indicator calculation.</param>
|
|
|
|
|
///<param name="appliedPrice">The price used. Can be any of the price constants ENUM_APPLIED_PRICE or a handle of another indicator.</param>
|
|
|
|
|
public int iCCI(string symbol, ENUM_TIMEFRAMES period, int maPeriod, ENUM_APPLIED_PRICE appliedPrice)
|
|
|
|
|
{
|
|
|
|
|
var commandParameters = new ArrayList { symbol, (int)period, maPeriod, (int)appliedPrice };
|
|
|
|
|
return SendCommand<int>(Mt5CommandType.iCCI, commandParameters);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
///<summary>
|
|
|
|
|
///The function returns the handle of the Bulls Power indicator.
|
|
|
|
|
///</summary>
|
|
|
|
|
///<param name="symbol">The symbol name of the security, the data of which should be used to calculate the indicator.</param>
|
|
|
|
|
///<param name="period">The value of the period can be one of the ENUM_TIMEFRAMES enumeration values, 0 means the current timeframe.</param>
|
|
|
|
|
///<param name="fastMaPeriod">Fast averaging period for calculations.</param>
|
|
|
|
|
///<param name="slowMaPeriod">Slow averaging period for calculations.</param>
|
|
|
|
|
///<param name="maMethod">Smoothing type. Can be one of the averaging constants of ENUM_MA_METHOD.</param>
|
|
|
|
|
///<param name="appliedVolume">The volume used. Can be one of the constants of ENUM_APPLIED_VOLUME.</param>
|
|
|
|
|
public int iChaikin(string symbol, ENUM_TIMEFRAMES period, int fastMaPeriod, int slowMaPeriod, ENUM_MA_METHOD maMethod, ENUM_APPLIED_VOLUME appliedVolume)
|
|
|
|
|
{
|
|
|
|
|
var commandParameters = new ArrayList { symbol, (int)period, fastMaPeriod, slowMaPeriod, (int)maMethod, (int)appliedVolume };
|
|
|
|
|
return SendCommand<int>(Mt5CommandType.iChaikin, commandParameters);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
///<summary>
|
|
|
|
|
///The function returns the handle of the Bulls Power indicator.
|
|
|
|
|
///</summary>
|
|
|
|
|
///<param name="symbol">The symbol name of the security, the data of which should be used to calculate the indicator.</param>
|
|
|
|
|
///<param name="period">The value of the period can be one of the ENUM_TIMEFRAMES enumeration values, 0 means the current timeframe.</param>
|
|
|
|
|
///<param name="maPeriod">Averaging period (bars count) for calculations.</param>
|
|
|
|
|
///<param name="maShift">Shift of the indicator relative to the price chart.</param>
|
|
|
|
|
///<param name="appliedPrice">The price used. Can be any of the price constants ENUM_APPLIED_PRICE or a handle of another indicator.</param>
|
|
|
|
|
public int iDEMA(string symbol, ENUM_TIMEFRAMES period, int maPeriod, int maShift, ENUM_APPLIED_PRICE appliedPrice)
|
|
|
|
|
{
|
|
|
|
|
var commandParameters = new ArrayList { symbol, (int)period, maPeriod, maShift, (int)appliedPrice };
|
|
|
|
|
return SendCommand<int>(Mt5CommandType.iDEMA, commandParameters);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
///<summary>
|
|
|
|
|
///The function returns the handle of the DeMarker indicator.
|
|
|
|
|
///</summary>
|
|
|
|
|
///<param name="symbol">The symbol name of the security, the data of which should be used to calculate the indicator.</param>
|
|
|
|
|
///<param name="period">The value of the period can be one of the ENUM_TIMEFRAMES enumeration values, 0 means the current timeframe.</param>
|
|
|
|
|
///<param name="maPeriod">Averaging period (bars count) for calculations.</param>
|
|
|
|
|
public int iDeMarker(string symbol, ENUM_TIMEFRAMES period, int maPeriod)
|
|
|
|
|
{
|
|
|
|
|
var commandParameters = new ArrayList { symbol, (int)period, maPeriod };
|
|
|
|
|
return SendCommand<int>(Mt5CommandType.iDeMarker, commandParameters);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
///<summary>
|
|
|
|
|
///The function returns the handle of the Envelopes indicator.
|
|
|
|
|
///</summary>
|
|
|
|
|
///<param name="symbol">The symbol name of the security, the data of which should be used to calculate the indicator.</param>
|
|
|
|
|
///<param name="period">The value of the period can be one of the ENUM_TIMEFRAMES enumeration values, 0 means the current timeframe.</param>
|
|
|
|
|
///<param name="maPeriod">Averaging period for the main line.</param>
|
|
|
|
|
///<param name="maShift">The shift of the indicator relative to the price chart.</param>
|
|
|
|
|
///<param name="maMethod">Smoothing type. Can be one of the values of ENUM_MA_METHOD.</param>
|
|
|
|
|
///<param name="appliedPrice">The price used. Can be any of the price constants ENUM_APPLIED_PRICE or a handle of another indicator.</param>
|
|
|
|
|
///<param name="deviation">The deviation from the main line (in percents).</param>
|
|
|
|
|
public int iEnvelopes(string symbol, ENUM_TIMEFRAMES period, int maPeriod, int maShift, ENUM_MA_METHOD maMethod, ENUM_APPLIED_PRICE appliedPrice, double deviation)
|
|
|
|
|
{
|
|
|
|
|
var commandParameters = new ArrayList { symbol, (int)period, maPeriod, maShift, (int)maMethod, (int)appliedPrice, deviation };
|
|
|
|
|
return SendCommand<int>(Mt5CommandType.iEnvelopes, commandParameters);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
///<summary>
|
|
|
|
|
///The function returns the handle of the Force Index indicator.
|
|
|
|
|
///</summary>
|
|
|
|
|
///<param name="symbol">The symbol name of the security, the data of which should be used to calculate the indicator.</param>
|
|
|
|
|
///<param name="period">The value of the period can be one of the ENUM_TIMEFRAMES enumeration values, 0 means the current timeframe.</param>
|
|
|
|
|
///<param name="maPeriod">Averaging period for the indicator calculations.</param>
|
|
|
|
|
///<param name="maMethod">Smoothing type. Can be one of the values of ENUM_MA_METHOD.</param>
|
|
|
|
|
///<param name="appliedVolume">The volume used. Can be one of the values of ENUM_APPLIED_VOLUME.</param>
|
|
|
|
|
public int iForce(string symbol, ENUM_TIMEFRAMES period, int maPeriod, ENUM_MA_METHOD maMethod, ENUM_APPLIED_VOLUME appliedVolume)
|
|
|
|
|
{
|
|
|
|
|
var commandParameters = new ArrayList { symbol, (int)period, maPeriod, (int)maMethod, (int)appliedVolume };
|
|
|
|
|
return SendCommand<int>(Mt5CommandType.iForce, commandParameters);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
///<summary>
|
|
|
|
|
///The function returns the handle of the Force Index indicator.
|
|
|
|
|
///</summary>
|
|
|
|
|
///<param name="symbol">The symbol name of the security, the data of which should be used to calculate the indicator.</param>
|
|
|
|
|
///<param name="period">The value of the period can be one of the ENUM_TIMEFRAMES enumeration values, 0 means the current timeframe.</param>
|
|
|
|
|
public int iForce(string symbol, ENUM_TIMEFRAMES period)
|
|
|
|
|
{
|
|
|
|
|
var commandParameters = new ArrayList { symbol, (int)period };
|
|
|
|
|
return SendCommand<int>(Mt5CommandType.iForce, commandParameters);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
///<summary>
|
|
|
|
|
///The function returns the handle of the Fractal Adaptive Moving Average indicator.
|
|
|
|
|
///</summary>
|
|
|
|
|
///<param name="symbol">The symbol name of the security, the data of which should be used to calculate the indicator.</param>
|
|
|
|
|
///<param name="period">The value of the period can be one of the ENUM_TIMEFRAMES enumeration values, 0 means the current timeframe.</param>
|
|
|
|
|
///<param name="maPeriod">Period (bars count) for the indicator calculations.</param>
|
|
|
|
|
///<param name="maShift">Shift of the indicator in the price chart.</param>
|
|
|
|
|
///<param name="appliedPrice">The price used. Can be any of the price constants ENUM_APPLIED_PRICE or a handle of another indicator.</param>
|
|
|
|
|
public int iFrAMA(string symbol, ENUM_TIMEFRAMES period, int maPeriod, int maShift, ENUM_APPLIED_PRICE appliedPrice)
|
|
|
|
|
{
|
|
|
|
|
var commandParameters = new ArrayList { symbol, (int)period, maPeriod, maShift, (int)appliedPrice };
|
|
|
|
|
return SendCommand<int>(Mt5CommandType.iFrAMA, commandParameters);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
///<summary>
|
|
|
|
|
///The function returns the handle of the Gator indicator. The Oscillator shows the difference between the blue and red lines of Alligator (upper histogram) and difference between red and green lines (lower histogram).
|
|
|
|
|
///</summary>
|
|
|
|
|
///<param name="symbol">The symbol name of the security, the data of which should be used to calculate the indicator.</param>
|
|
|
|
|
///<param name="period">The value of the period can be one of the ENUM_TIMEFRAMES enumeration values, 0 means the current timeframe.</param>
|
|
|
|
|
///<param name="jawPeriod">Averaging period for the blue line (Alligator's Jaw).</param>
|
|
|
|
|
///<param name="jawShift">The shift of the blue line relative to the price chart. It isn't directly connected with the visual shift of the indicator histogram.</param>
|
|
|
|
|
///<param name="teethPeriod">Averaging period for the red line (Alligator's Teeth).</param>
|
|
|
|
|
///<param name="teethShift">The shift of the red line relative to the price chart. It isn't directly connected with the visual shift of the indicator histogram.</param>
|
|
|
|
|
///<param name="lipsPeriod">Averaging period for the green line (Alligator's lips).</param>
|
|
|
|
|
///<param name="lipsShift">The shift of the green line relative to the price charts. It isn't directly connected with the visual shift of the indicator histogram.</param>
|
|
|
|
|
///<param name="maMethod">Smoothing type. Can be one of the values of ENUM_MA_METHOD.</param>
|
|
|
|
|
///<param name="appliedPrice">The price used. Can be any of the price constants ENUM_APPLIED_PRICE or a handle of another indicator.</param>
|
|
|
|
|
public int iGator(string symbol, ENUM_TIMEFRAMES period, int jawPeriod, int jawShift, int teethPeriod,
|
|
|
|
|
int teethShift, int lipsPeriod, int lipsShift, ENUM_MA_METHOD maMethod, ENUM_APPLIED_PRICE appliedPrice)
|
|
|
|
|
{
|
|
|
|
|
var commandParameters = new ArrayList { symbol, (int)period, jawPeriod, jawShift, teethPeriod, teethShift, lipsPeriod, lipsShift, (int)maMethod, (int)appliedPrice };
|
|
|
|
|
return SendCommand<int>(Mt5CommandType.iGator, commandParameters);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
///<summary>
|
|
|
|
|
///The function returns the handle of the Ichimoku Kinko Hyo indicator.
|
|
|
|
|
///</summary>
|
|
|
|
|
///<param name="symbol">The symbol name of the security, the data of which should be used to calculate the indicator.</param>
|
|
|
|
|
///<param name="period">The value of the period can be one of the ENUM_TIMEFRAMES enumeration values, 0 means the current timeframe.</param>
|
|
|
|
|
///<param name="tenkanSen">Averaging period for Tenkan Sen.</param>
|
|
|
|
|
///<param name="kijunSen">Averaging period for Kijun Sen.</param>
|
|
|
|
|
///<param name="senkouSpanB">Averaging period for Senkou Span B.</param>
|
|
|
|
|
public int iIchimoku(string symbol, ENUM_TIMEFRAMES period, int tenkanSen, int kijunSen, int senkouSpanB)
|
|
|
|
|
{
|
|
|
|
|
var commandParameters = new ArrayList { symbol, (int)period, tenkanSen, kijunSen, senkouSpanB };
|
|
|
|
|
return SendCommand<int>(Mt5CommandType.iIchimoku, commandParameters);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
///<summary>
|
|
|
|
|
///The function returns the handle of the Market Facilitation Index indicator.
|
|
|
|
|
///</summary>
|
|
|
|
|
///<param name="symbol">The symbol name of the security, the data of which should be used to calculate the indicator.</param>
|
|
|
|
|
///<param name="period">The value of the period can be one of the ENUM_TIMEFRAMES enumeration values, 0 means the current timeframe.</param>
|
|
|
|
|
///<param name="appliedVolume">The volume used. Can be one of the constants of ENUM_APPLIED_VOLUME.</param>
|
|
|
|
|
public int iBWMFI(string symbol, ENUM_TIMEFRAMES period, ENUM_APPLIED_VOLUME appliedVolume)
|
|
|
|
|
{
|
|
|
|
|
var commandParameters = new ArrayList { symbol, (int)period, (int)appliedVolume };
|
|
|
|
|
return SendCommand<int>(Mt5CommandType.iBWMFI, commandParameters);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
///<summary>
|
|
|
|
|
///The function returns the handle of the Momentum indicator.
|
|
|
|
|
///</summary>
|
|
|
|
|
///<param name="symbol">The symbol name of the security, the data of which should be used to calculate the indicator.</param>
|
|
|
|
|
///<param name="period">The value of the period can be one of the ENUM_TIMEFRAMES enumeration values, 0 means the current timeframe.</param>
|
|
|
|
|
///<param name="momPeriod">Averaging period (bars count) for the calculation of the price change.</param>
|
|
|
|
|
///<param name="appliedPrice">The price used. Can be any of the price constants ENUM_APPLIED_PRICE or a handle of another indicator.</param>
|
|
|
|
|
public int iMomentum(string symbol, ENUM_TIMEFRAMES period, int momPeriod, ENUM_APPLIED_PRICE appliedPrice)
|
|
|
|
|
{
|
|
|
|
|
var commandParameters = new ArrayList { symbol, (int)period, momPeriod, (int)appliedPrice };
|
|
|
|
|
return SendCommand<int>(Mt5CommandType.iMomentum, commandParameters);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
///<summary>
|
|
|
|
|
///The function returns the handle of the Money Flow Index indicator.
|
|
|
|
|
///</summary>
|
|
|
|
|
///<param name="symbol">The symbol name of the security, the data of which should be used to calculate the indicator.</param>
|
|
|
|
|
///<param name="period">The value of the period can be one of the ENUM_TIMEFRAMES enumeration values, 0 means the current timeframe.</param>
|
|
|
|
|
///<param name="maPeriod">Averaging period (bars count) for the calculation.</param>
|
|
|
|
|
///<param name="appliedVolume">The volume used. Can be any of the ENUM_APPLIED_VOLUME values.</param>
|
|
|
|
|
public int iMFI(string symbol, ENUM_TIMEFRAMES period, int maPeriod, ENUM_APPLIED_VOLUME appliedVolume)
|
|
|
|
|
{
|
|
|
|
|
var commandParameters = new ArrayList { symbol, (int)period, maPeriod, (int)appliedVolume };
|
|
|
|
|
return SendCommand<int>(Mt5CommandType.iMFI, commandParameters);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
///<summary>
|
|
|
|
|
///The function returns the handle of the Moving Average indicator.
|
|
|
|
|
///</summary>
|
|
|
|
|
///<param name="symbol">The symbol name of the security, the data of which should be used to calculate the indicator.</param>
|
|
|
|
|
///<param name="period">The value of the period can be one of the ENUM_TIMEFRAMES enumeration values, 0 means the current timeframe.</param>
|
|
|
|
|
///<param name="maPeriod">Averaging period for the calculation of the moving average.</param>
|
|
|
|
|
///<param name="maShift">Shift of the indicator relative to the price chart.</param>
|
|
|
|
|
///<param name="maMethod">Smoothing type. Can be one of the ENUM_MA_METHOD values.</param>
|
|
|
|
|
///<param name="appliedPrice">The price used. Can be any of the price constants ENUM_APPLIED_PRICE or a handle of another indicator.</param>
|
|
|
|
|
public int iMA(string symbol, ENUM_TIMEFRAMES period, int maPeriod, int maShift, ENUM_MA_METHOD maMethod, ENUM_APPLIED_PRICE appliedPrice)
|
|
|
|
|
{
|
|
|
|
|
var commandParameters = new ArrayList { symbol, (int)period, maPeriod, maShift, (int)maMethod, (int)appliedPrice };
|
|
|
|
|
return SendCommand<int>(Mt5CommandType.iMA, commandParameters);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
///<summary>
|
|
|
|
|
///The function returns the handle of the Moving Average of Oscillator indicator. The OsMA oscillator shows the difference between values of MACD and its signal line.
|
|
|
|
|
///</summary>
|
|
|
|
|
///<param name="symbol">The symbol name of the security, the data of which should be used to calculate the indicator.</param>
|
|
|
|
|
///<param name="period">The value of the period can be one of the ENUM_TIMEFRAMES enumeration values, 0 means the current timeframe.</param>
|
|
|
|
|
///<param name="fastEmaPeriod">Period for Fast Moving Average calculation.</param>
|
|
|
|
|
///<param name="slowEmaPeriod">Period for Slow Moving Average calculation.</param>
|
|
|
|
|
///<param name="signalPeriod">Averaging period for signal line calculation.</param>
|
|
|
|
|
///<param name="appliedPrice">The price used. Can be any of the price constants ENUM_APPLIED_PRICE or a handle of another indicator.</param>
|
|
|
|
|
public int iOsMA(string symbol, ENUM_TIMEFRAMES period, int fastEmaPeriod, int slowEmaPeriod, int signalPeriod, ENUM_APPLIED_PRICE appliedPrice)
|
|
|
|
|
{
|
|
|
|
|
var commandParameters = new ArrayList { symbol, (int)period, fastEmaPeriod, slowEmaPeriod, signalPeriod, (int)appliedPrice };
|
|
|
|
|
return SendCommand<int>(Mt5CommandType.iOsMA, commandParameters);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
///<summary>
|
|
|
|
|
///The function returns the handle of the Moving Averages Convergence/Divergence indicator. In systems where OsMA is called MACD Histogram, this indicator is shown as two lines. In the client terminal the Moving Averages Convergence/Divergence looks like a histogram.
|
|
|
|
|
///</summary>
|
|
|
|
|
///<param name="symbol">The symbol name of the security, the data of which should be used to calculate the indicator.</param>
|
|
|
|
|
///<param name="period">The value of the period can be one of the ENUM_TIMEFRAMES enumeration values, 0 means the current timeframe.</param>
|
|
|
|
|
///<param name="fastEmaPeriod">Period for Fast Moving Average calculation.</param>
|
|
|
|
|
///<param name="slowEmaPeriod">Period for Slow Moving Average calculation.</param>
|
|
|
|
|
///<param name="signalPeriod">Averaging period for signal line calculation.</param>
|
|
|
|
|
///<param name="appliedPrice">The price used. Can be any of the price constants ENUM_APPLIED_PRICE or a handle of another indicator.</param>
|
|
|
|
|
public int iMACD(string symbol, ENUM_TIMEFRAMES period, int fastEmaPeriod, int slowEmaPeriod, int signalPeriod, ENUM_APPLIED_PRICE appliedPrice)
|
|
|
|
|
{
|
|
|
|
|
var commandParameters = new ArrayList { symbol, (int)period, fastEmaPeriod, slowEmaPeriod, signalPeriod, (int)appliedPrice };
|
|
|
|
|
return SendCommand<int>(Mt5CommandType.iMACD, commandParameters);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
///<summary>
|
|
|
|
|
///The function returns the handle of the On Balance Volume indicator.
|
|
|
|
|
///</summary>
|
|
|
|
|
///<param name="symbol">The symbol name of the security, the data of which should be used to calculate the indicator.</param>
|
|
|
|
|
///<param name="period">The value of the period can be one of the ENUM_TIMEFRAMES enumeration values, 0 means the current timeframe.</param>
|
|
|
|
|
///<param name="appliedVolume">The volume used. Can be any of the ENUM_APPLIED_VOLUME values.</param>
|
|
|
|
|
public int iOBV(string symbol, ENUM_TIMEFRAMES period, ENUM_APPLIED_VOLUME appliedVolume)
|
|
|
|
|
{
|
|
|
|
|
var commandParameters = new ArrayList { symbol, (int)period, (int)appliedVolume };
|
|
|
|
|
return SendCommand<int>(Mt5CommandType.iOBV, commandParameters);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
///<summary>
|
|
|
|
|
///The function returns the handle of the Parabolic Stop and Reverse system indicator.
|
|
|
|
|
///</summary>
|
|
|
|
|
///<param name="symbol">The symbol name of the security, the data of which should be used to calculate the indicator.</param>
|
|
|
|
|
///<param name="period">The value of the period can be one of the ENUM_TIMEFRAMES enumeration values, 0 means the current timeframe.</param>
|
|
|
|
|
///<param name="step">The step of price increment, usually 0.02.</param>
|
|
|
|
|
///<param name="maximum">The maximum step, usually 0.2.</param>
|
|
|
|
|
public int iSAR(string symbol, ENUM_TIMEFRAMES period, double step, double maximum)
|
|
|
|
|
{
|
|
|
|
|
var commandParameters = new ArrayList { symbol, (int)period, step, maximum };
|
|
|
|
|
return SendCommand<int>(Mt5CommandType.iSAR, commandParameters);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
///<summary>
|
|
|
|
|
///The function returns the handle of the Relative Strength Index indicator.
|
|
|
|
|
///</summary>
|
|
|
|
|
///<param name="symbol">The symbol name of the security, the data of which should be used to calculate the indicator.</param>
|
|
|
|
|
///<param name="period">The value of the period can be one of the ENUM_TIMEFRAMES enumeration values, 0 means the current timeframe.</param>
|
|
|
|
|
///<param name="maPeriod">Averaging period for the RSI calculation.</param>
|
|
|
|
|
///<param name="appliedPrice">The price used. Can be any of the price constants ENUM_APPLIED_PRICE or a handle of another indicator.</param>
|
|
|
|
|
public int iRSI(string symbol, ENUM_TIMEFRAMES period, int maPeriod, ENUM_APPLIED_PRICE appliedPrice)
|
|
|
|
|
{
|
|
|
|
|
var commandParameters = new ArrayList { symbol, (int)period, maPeriod, (int)appliedPrice };
|
|
|
|
|
return SendCommand<int>(Mt5CommandType.iRSI, commandParameters);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
///<summary>
|
|
|
|
|
///The function returns the handle of the Relative Vigor Index indicator.
|
|
|
|
|
///</summary>
|
|
|
|
|
///<param name="symbol">The symbol name of the security, the data of which should be used to calculate the indicator.</param>
|
|
|
|
|
///<param name="period">The value of the period can be one of the ENUM_TIMEFRAMES enumeration values, 0 means the current timeframe.</param>
|
|
|
|
|
///<param name="maPeriod">Averaging period for the RVI calculation.</param>
|
|
|
|
|
public int iRVI(string symbol, ENUM_TIMEFRAMES period, int maPeriod)
|
|
|
|
|
{
|
|
|
|
|
var commandParameters = new ArrayList { symbol, (int)period, maPeriod };
|
|
|
|
|
return SendCommand<int>(Mt5CommandType.iRVI, commandParameters);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
///<summary>
|
|
|
|
|
///The function returns the handle of the Standard Deviation indicator.
|
|
|
|
|
///</summary>
|
|
|
|
|
///<param name="symbol">The symbol name of the security, the data of which should be used to calculate the indicator.</param>
|
|
|
|
|
///<param name="period">The value of the period can be one of the ENUM_TIMEFRAMES enumeration values, 0 means the current timeframe.</param>
|
|
|
|
|
///<param name="maPeriod">Averaging period for the RVI calculation.</param>
|
|
|
|
|
///<param name="maShift">Shift of the indicator relative to the price chart.</param>
|
|
|
|
|
///<param name="maMethod">Type of averaging. Can be any of the ENUM_MA_METHOD values.</param>
|
|
|
|
|
///<param name="appliedPrice">The price used. Can be any of the price constants ENUM_APPLIED_PRICE or a handle of another indicator.</param>
|
|
|
|
|
public int iStdDev(string symbol, ENUM_TIMEFRAMES period, int maPeriod, int maShift, ENUM_MA_METHOD maMethod, ENUM_APPLIED_PRICE appliedPrice)
|
|
|
|
|
{
|
|
|
|
|
var commandParameters = new ArrayList { symbol, (int)period, maPeriod, maShift, (int)maMethod, (int)appliedPrice };
|
|
|
|
|
return SendCommand<int>(Mt5CommandType.iStdDev, commandParameters);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
///<summary>
|
|
|
|
|
///The function returns the handle of the Stochastic Oscillator indicator.
|
|
|
|
|
///</summary>
|
|
|
|
|
///<param name="symbol">The symbol name of the security, the data of which should be used to calculate the indicator.</param>
|
|
|
|
|
///<param name="period">The value of the period can be one of the ENUM_TIMEFRAMES enumeration values, 0 means the current timeframe.</param>
|
|
|
|
|
///<param name="Kperiod">Averaging period (bars count) for the %K line calculation.</param>
|
|
|
|
|
///<param name="Dperiod">Averaging period (bars count) for the %D line calculation.</param>
|
|
|
|
|
///<param name="slowing">Slowing value.</param>
|
|
|
|
|
///<param name="maMethod">Type of averaging. Can be any of the ENUM_MA_METHOD values.</param>
|
|
|
|
|
///<param name="priceField">Parameter of price selection for calculations. Can be one of the ENUM_STO_PRICE values.</param>
|
|
|
|
|
public int iStochastic(string symbol, ENUM_TIMEFRAMES period, int Kperiod, int Dperiod, int slowing, ENUM_MA_METHOD maMethod, ENUM_STO_PRICE priceField)
|
|
|
|
|
{
|
|
|
|
|
var commandParameters = new ArrayList { symbol, (int)period, Kperiod, Dperiod, slowing, (int)maMethod, (int)priceField };
|
|
|
|
|
return SendCommand<int>(Mt5CommandType.iStochastic, commandParameters);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
///<summary>
|
|
|
|
|
///The function returns the handle of the Triple Exponential Moving Average indicator.
|
|
|
|
|
///</summary>
|
|
|
|
|
///<param name="symbol">The symbol name of the security, the data of which should be used to calculate the indicator.</param>
|
|
|
|
|
///<param name="period">The value of the period can be one of the ENUM_TIMEFRAMES enumeration values, 0 means the current timeframe.</param>
|
|
|
|
|
///<param name="maPeriod">Averaging period (bars count) for calculation.</param>
|
|
|
|
|
///<param name="maShift">Shift of indicator relative to the price chart.</param>
|
|
|
|
|
///<param name="appliedPrice">The price used. Can be any of the price constants ENUM_APPLIED_PRICE or a handle of another indicator.</param>
|
|
|
|
|
public int iTEMA(string symbol, ENUM_TIMEFRAMES period, int maPeriod, int maShift, ENUM_APPLIED_PRICE appliedPrice)
|
|
|
|
|
{
|
|
|
|
|
var commandParameters = new ArrayList { symbol, (int)period, maPeriod, maShift, (int)appliedPrice };
|
|
|
|
|
return SendCommand<int>(Mt5CommandType.iTEMA, commandParameters);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
///<summary>
|
|
|
|
|
///The function returns the handle of the Triple Exponential Moving Averages Oscillator indicator.
|
|
|
|
|
///</summary>
|
|
|
|
|
///<param name="symbol">The symbol name of the security, the data of which should be used to calculate the indicator.</param>
|
|
|
|
|
///<param name="period">The value of the period can be one of the ENUM_TIMEFRAMES enumeration values, 0 means the current timeframe.</param>
|
|
|
|
|
///<param name="maPeriod">Averaging period (bars count) for calculation.</param>
|
|
|
|
|
///<param name="appliedPrice">The price used. Can be any of the price constants ENUM_APPLIED_PRICE or a handle of another indicator.</param>
|
|
|
|
|
public int iTriX(string symbol, ENUM_TIMEFRAMES period, int maPeriod, ENUM_APPLIED_PRICE appliedPrice)
|
|
|
|
|
{
|
|
|
|
|
var commandParameters = new ArrayList { symbol, (int)period, maPeriod, (int)appliedPrice };
|
|
|
|
|
return SendCommand<int>(Mt5CommandType.iTriX, commandParameters);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
///<summary>
|
|
|
|
|
///The function returns the handle of the Larry Williams' Percent Range indicator.
|
|
|
|
|
///</summary>
|
|
|
|
|
///<param name="symbol">The symbol name of the security, the data of which should be used to calculate the indicator.</param>
|
|
|
|
|
///<param name="period">The value of the period can be one of the ENUM_TIMEFRAMES enumeration values, 0 means the current timeframe.</param>
|
|
|
|
|
///<param name="calcPeriod">Period (bars count) for the indicator calculation.</param>
|
|
|
|
|
public int iWPR(string symbol, ENUM_TIMEFRAMES period, int calcPeriod)
|
|
|
|
|
{
|
|
|
|
|
var commandParameters = new ArrayList { symbol, (int)period, calcPeriod };
|
|
|
|
|
return SendCommand<int>(Mt5CommandType.iWPR, commandParameters);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
///<summary>
|
|
|
|
|
///The function returns the handle of the Variable Index Dynamic Average indicator.
|
|
|
|
|
///</summary>
|
|
|
|
|
///<param name="symbol">The symbol name of the security, the data of which should be used to calculate the indicator.</param>
|
|
|
|
|
///<param name="period">The value of the period can be one of the ENUM_TIMEFRAMES enumeration values, 0 means the current timeframe.</param>
|
|
|
|
|
///<param name="cmoPeriod">Period (bars count) for the Chande Momentum Oscillator calculation.</param>
|
|
|
|
|
///<param name="emaPeriod">EMA period (bars count) for smoothing factor calculation.</param>
|
|
|
|
|
///<param name="maShift">Shift of the indicator relative to the price chart.</param>
|
|
|
|
|
///<param name="appliedPrice">The price used. Can be any of the price constants ENUM_APPLIED_PRICE or a handle of another indicator.</param>
|
|
|
|
|
public int iVIDyA(string symbol, ENUM_TIMEFRAMES period, int cmoPeriod, int emaPeriod, int maShift, ENUM_APPLIED_PRICE appliedPrice)
|
|
|
|
|
{
|
|
|
|
|
var commandParameters = new ArrayList { symbol, (int)period, cmoPeriod, emaPeriod, maShift, (int)appliedPrice };
|
|
|
|
|
return SendCommand<int>(Mt5CommandType.iVIDyA, commandParameters);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
///<summary>
|
|
|
|
|
///The function returns the handle of the Volumes indicator.
|
|
|
|
|
///</summary>
|
|
|
|
|
///<param name="symbol">The symbol name of the security, the data of which should be used to calculate the indicator.</param>
|
|
|
|
|
///<param name="period">The value of the period can be one of the ENUM_TIMEFRAMES enumeration values, 0 means the current timeframe.</param>
|
|
|
|
|
///<param name="appliedVolume">The volume used. Can be any of the ENUM_APPLIED_VOLUME values.</param>
|
|
|
|
|
public int iVolumes(string symbol, ENUM_TIMEFRAMES period, ENUM_APPLIED_VOLUME appliedVolume)
|
|
|
|
|
{
|
|
|
|
|
var commandParameters = new ArrayList { symbol, (int)period, (int)appliedVolume };
|
|
|
|
|
return SendCommand<int>(Mt5CommandType.iVolumes, commandParameters);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
///<summary>
|
|
|
|
|
///The function returns the handle of the Volumes indicator.
|
|
|
|
|
///</summary>
|
|
|
|
|
///<param name="symbol">The symbol name of the security, the data of which should be used to calculate the indicator.</param>
|
|
|
|
|
///<param name="period">The value of the period can be one of the ENUM_TIMEFRAMES enumeration values, 0 means the current timeframe.</param>
|
|
|
|
|
///<param name="name">The name of the custom indicator, with path relative to the root directory of indicators (MQL5/Indicators/). If an indicator is located in a subdirectory, for example, in MQL5/Indicators/Examples, its name must be specified like: "Examples\\indicator_name" (it is necessary to use a double slash instead of the single slash as a separator).</param>
|
|
|
|
|
///<param name="parameters">input-parameters of a custom indicator. If there is no parameters specified, then default values will be used.</param>
|
|
|
|
|
public int iCustom(string symbol, ENUM_TIMEFRAMES period, string name, double[] parameters)
|
|
|
|
|
{
|
|
|
|
|
var response = SendRequest<ICustomResponse>(new ICustomRequest
|
|
|
|
|
{
|
|
|
|
|
Symbol = symbol,
|
|
|
|
|
Timeframe = (int)period,
|
|
|
|
|
Name = name,
|
|
|
|
|
Params = new ArrayList(parameters),
|
|
|
|
|
ParamsType = ICustomRequest.ParametersType.Double
|
|
|
|
|
});
|
|
|
|
|
return response?.Value ?? 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
///<summary>
|
|
|
|
|
///The function returns the handle of the Volumes indicator.
|
|
|
|
|
///</summary>
|
|
|
|
|
///<param name="symbol">The symbol name of the security, the data of which should be used to calculate the indicator.</param>
|
|
|
|
|
///<param name="period">The value of the period can be one of the ENUM_TIMEFRAMES enumeration values, 0 means the current timeframe.</param>
|
|
|
|
|
///<param name="name">The name of the custom indicator, with path relative to the root directory of indicators (MQL5/Indicators/). If an indicator is located in a subdirectory, for example, in MQL5/Indicators/Examples, its name must be specified like: "Examples\\indicator_name" (it is necessary to use a double slash instead of the single slash as a separator).</param>
|
|
|
|
|
///<param name="parameters">input-parameters of a custom indicator. If there is no parameters specified, then default values will be used.</param>
|
|
|
|
|
public int iCustom(string symbol, ENUM_TIMEFRAMES period, string name, int[] parameters)
|
|
|
|
|
{
|
|
|
|
|
var response = SendRequest<ICustomResponse>(new ICustomRequest
|
|
|
|
|
{
|
|
|
|
|
Symbol = symbol,
|
|
|
|
|
Timeframe = (int)period,
|
|
|
|
|
Name = name,
|
|
|
|
|
Params = new ArrayList(parameters),
|
|
|
|
|
ParamsType = ICustomRequest.ParametersType.Int
|
|
|
|
|
});
|
|
|
|
|
return response?.Value ?? 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#endregion // Public Methods
|
|
|
|
|
|
|
|
|
|
#region Properties
|
|
|
|
|
///<summary>
|
|
|
|
@@ -1671,8 +2450,7 @@ namespace MtApi5
|
|
|
|
|
|
|
|
|
|
private void OnConnected()
|
|
|
|
|
{
|
|
|
|
|
// INFO: disabled backtesting mode while solution of window handle in testing mode is not found
|
|
|
|
|
//_isBacktestingMode = IsTestMode();
|
|
|
|
|
_isBacktestingMode = IsTesting();
|
|
|
|
|
|
|
|
|
|
if (_isBacktestingMode)
|
|
|
|
|
{
|
|
|
|
|