diff --git a/MtApi5/Mt5CommandType.cs b/MtApi5/Mt5CommandType.cs
index ac62228d..3f189d12 100755
--- a/MtApi5/Mt5CommandType.cs
+++ b/MtApi5/Mt5CommandType.cs
@@ -130,6 +130,46 @@
ObjectSetString = 84,
//TextSetFont = 85,
//TextOut = 86,
- //TextGetSize = 87
+ //TextGetSize = 87,
+
+ iAC = 88,
+ iAD = 89,
+ iADX = 90,
+ iADXWilder = 91,
+ iAlligator = 92,
+ iAMA = 93,
+ iAO = 94,
+ iATR = 95,
+ iBearsPower = 96,
+ iBands = 97,
+ iBullsPower = 98,
+ iCCI = 99,
+ iChaikin = 100,
+ iCustom = 101,
+ iDEMA = 102,
+ iDeMarker = 103,
+ iEnvelopes = 104,
+ iForce = 105,
+ iFractals = 106,
+ iFrAMA = 107,
+ iGator = 108,
+ iIchimoku = 109,
+ iBWMFI = 110,
+ iMomentum = 111,
+ iMFI = 112,
+ iMA = 113,
+ iOsMA = 114,
+ iMACD = 115,
+ iOBV = 116,
+ iSAR = 117,
+ iRSI = 118,
+ iRVI = 119,
+ iStdDev = 120,
+ iStochastic = 121,
+ iTEMA = 122,
+ iTriX = 123,
+ iWPR = 124,
+ iVIDyA = 125,
+ iVolumes = 126
}
}
diff --git a/MtApi5/Mt5Enums.cs b/MtApi5/Mt5Enums.cs
index 781f60a6..2c5fd935 100755
--- a/MtApi5/Mt5Enums.cs
+++ b/MtApi5/Mt5Enums.cs
@@ -742,5 +742,44 @@
ALIGN_CENTER = 2, // Centered (only for the Edit object)
ALIGN_RIGHT = 0, // Right alignment
}
- #endregion
-}
+ #endregion //Object Properties
+
+ #region Price Constants
+
+ public enum ENUM_APPLIED_PRICE
+ {
+ PRICE_CLOSE = 1, //Close price
+ PRICE_OPEN = 2, //Open price
+ PRICE_HIGH = 3, //The maximum price for the period
+ PRICE_LOW = 4, //The minimum price for the period
+ PRICE_MEDIAN = 5, //Median price, (high + low)/2
+ PRICE_TYPICAL = 6, //Typical price, (high + low + close)/3
+ PRICE_WEIGHTED = 7 //Average price, (high + low + close + close)/4
+ }
+
+ public enum ENUM_APPLIED_VOLUME
+ {
+ VOLUME_TICK = 0, //Tick volume
+ VOLUME_REAL = 1 //Trade volume
+ }
+
+ public enum ENUM_STO_PRICE
+ {
+ STO_LOWHIGH = 0, //Calculation is based on Low/High prices
+ STO_CLOSECLOSE = 1 //Calculation is based on Close/Close prices
+ }
+
+ #endregion //Price Constants
+
+ #region Smoothing Methods
+
+ public enum ENUM_MA_METHOD
+ {
+ MODE_SMA = 0, //Simple averaging
+ MODE_EMA = 1, //Exponential averaging
+ MODE_SMMA = 2, //Smoothed averaging
+ MODE_LWMA = 3 //Linear-weighted averaging
+ }
+
+ #endregion //Smoothing Methods
+ }
diff --git a/MtApi5/MtApi5.csproj b/MtApi5/MtApi5.csproj
index 363db31f..2a79057d 100755
--- a/MtApi5/MtApi5.csproj
+++ b/MtApi5/MtApi5.csproj
@@ -67,9 +67,11 @@
+
+
diff --git a/MtApi5/MtApi5Client.cs b/MtApi5/MtApi5Client.cs
index bafe7d85..386feea0 100755
--- a/MtApi5/MtApi5Client.cs
+++ b/MtApi5/MtApi5Client.cs
@@ -1638,6 +1638,556 @@ namespace MtApi5
#endregion //Object Functions
+ #region Technical Indicators
+
+ #endregion //Technical Indicators
+
+ ///
+ ///The function creates Accelerator Oscillator in a global cache of the client terminal and returns its handle.
+ ///
+ ///The symbol name of the security, the data of which should be used to calculate the indicator.
+ ///The value of the period can be one of the ENUM_TIMEFRAMES enumeration values, 0 means the current timeframe.
+ public int iAC(string symbol, ENUM_TIMEFRAMES period)
+ {
+ var commandParameters = new ArrayList { symbol, (int)period };
+ return SendCommand(Mt5CommandType.iAC, commandParameters);
+ }
+
+ ///
+ ///The function returns the handle of the Average Directional Movement Index indicator.
+ ///
+ ///The symbol name of the security, the data of which should be used to calculate the indicator.
+ ///The value of the period can be one of the ENUM_TIMEFRAMES enumeration values, 0 means the current timeframe.
+ ///Period to calculate the index.
+ public int iADX(string symbol, ENUM_TIMEFRAMES period, int adxPeriod)
+ {
+ var commandParameters = new ArrayList { symbol, (int)period, adxPeriod };
+ return SendCommand(Mt5CommandType.iADX, commandParameters);
+ }
+
+ ///
+ ///The function returns the handle of Average Directional Movement Index by Welles Wilder.
+ ///
+ ///The symbol name of the security, the data of which should be used to calculate the indicator.
+ ///The value of the period can be one of the ENUM_TIMEFRAMES enumeration values, 0 means the current timeframe.
+ ///Period to calculate the index.
+ public int iADXWilder(string symbol, ENUM_TIMEFRAMES period, int adxPeriod)
+ {
+ var commandParameters = new ArrayList { symbol, (int)period, adxPeriod };
+ return SendCommand(Mt5CommandType.iADXWilder, commandParameters);
+ }
+
+ ///
+ ///The function returns the handle of the Alligator indicator.
+ ///
+ ///The symbol name of the security, the data of which should be used to calculate the indicator.
+ ///The value of the period can be one of the ENUM_TIMEFRAMES enumeration values, 0 means the current timeframe.
+ ///Averaging period for the blue line (Alligator's Jaw).
+ ///The shift of the blue line relative to the price chart.
+ ///Averaging period for the red line (Alligator's Teeth).
+ ///The shift of the red line relative to the price chart.
+ ///Averaging period for the green line (Alligator's lips).
+ ///The shift of the green line relative to the price chart.
+ ///The method of averaging. Can be any of the ENUM_MA_METHOD values.
+ ///The price used. Can be any of the price constants ENUM_APPLIED_PRICE or a handle of another indicator.
+ 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(Mt5CommandType.iAlligator, commandParameters);
+ }
+
+ ///
+ ///The function returns the handle of the Adaptive Moving Average indicator.
+ ///
+ ///The symbol name of the security, the data of which should be used to calculate the indicator.
+ ///The value of the period can be one of the ENUM_TIMEFRAMES enumeration values, 0 means the current timeframe.
+ ///The calculation period, on which the efficiency coefficient is calculated.
+ ///Fast period for the smoothing coefficient calculation for a rapid market.
+ ///Slow period for the smoothing coefficient calculation in the absence of trend.
+ ///Shift of the indicator relative to the price chart.
+ ///The price used. Can be any of the price constants ENUM_APPLIED_PRICE or a handle of another indicator.
+ 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(Mt5CommandType.iAMA, commandParameters);
+ }
+
+ ///
+ ///The function returns the handle of the Awesome Oscillator indicator.
+ ///
+ ///The symbol name of the security, the data of which should be used to calculate the indicator.
+ ///The value of the period can be one of the ENUM_TIMEFRAMES enumeration values, 0 means the current timeframe.
+ public int iAO(string symbol, ENUM_TIMEFRAMES period)
+ {
+ var commandParameters = new ArrayList { symbol, (int)period };
+ return SendCommand(Mt5CommandType.iAO, commandParameters);
+ }
+
+ ///
+ ///The function returns the handle of the Average True Range indicator.
+ ///
+ ///The symbol name of the security, the data of which should be used to calculate the indicator.
+ ///The value of the period can be one of the ENUM_TIMEFRAMES enumeration values, 0 means the current timeframe.
+ ///The value of the averaging period for the indicator calculation.
+ public int iATR(string symbol, ENUM_TIMEFRAMES period, int maPeriod)
+ {
+ var commandParameters = new ArrayList { symbol, (int)period, maPeriod };
+ return SendCommand(Mt5CommandType.iATR, commandParameters);
+ }
+
+ ///
+ ///The function returns the handle of the Bears Power indicator.
+ ///
+ ///The symbol name of the security, the data of which should be used to calculate the indicator.
+ ///The value of the period can be one of the ENUM_TIMEFRAMES enumeration values, 0 means the current timeframe.
+ ///The value of the averaging period for the indicator calculation.
+ public int iBearsPower(string symbol, ENUM_TIMEFRAMES period, int maPeriod)
+ {
+ var commandParameters = new ArrayList { symbol, (int)period, maPeriod };
+ return SendCommand(Mt5CommandType.iBearsPower, commandParameters);
+ }
+
+ ///
+ ///The function returns the handle of the Bollinger Bands® indicator.
+ ///
+ ///The symbol name of the security, the data of which should be used to calculate the indicator.
+ ///The value of the period can be one of the ENUM_TIMEFRAMES enumeration values, 0 means the current timeframe.
+ ///The averaging period of the main line of the indicator.
+ ///The shift the indicator relative to the price chart.
+ ///Deviation from the main line.
+ ///The price used. Can be any of the price constants ENUM_APPLIED_PRICE or a handle of another indicator.
+ 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(Mt5CommandType.iBands, commandParameters);
+ }
+
+ ///
+ ///The function returns the handle of the Bulls Power indicator.
+ ///
+ ///The symbol name of the security, the data of which should be used to calculate the indicator.
+ ///The value of the period can be one of the ENUM_TIMEFRAMES enumeration values, 0 means the current timeframe.
+ ///The averaging period for the indicator calculation.
+ public int iBullsPower(string symbol, ENUM_TIMEFRAMES period, int maPeriod)
+ {
+ var commandParameters = new ArrayList { symbol, (int)period, maPeriod };
+ return SendCommand(Mt5CommandType.iBullsPower, commandParameters);
+ }
+
+ ///
+ ///The function returns the handle of the Commodity Channel Index indicator.
+ ///
+ ///The symbol name of the security, the data of which should be used to calculate the indicator.
+ ///The value of the period can be one of the ENUM_TIMEFRAMES enumeration values, 0 means the current timeframe.
+ ///The averaging period for the indicator calculation.
+ ///The price used. Can be any of the price constants ENUM_APPLIED_PRICE or a handle of another indicator.
+ 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(Mt5CommandType.iCCI, commandParameters);
+ }
+
+ ///
+ ///The function returns the handle of the Bulls Power indicator.
+ ///
+ ///The symbol name of the security, the data of which should be used to calculate the indicator.
+ ///The value of the period can be one of the ENUM_TIMEFRAMES enumeration values, 0 means the current timeframe.
+ ///Fast averaging period for calculations.
+ ///Slow averaging period for calculations.
+ ///Smoothing type. Can be one of the averaging constants of ENUM_MA_METHOD.
+ ///The volume used. Can be one of the constants of ENUM_APPLIED_VOLUME.
+ 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(Mt5CommandType.iChaikin, commandParameters);
+ }
+
+ ///
+ ///The function returns the handle of the Bulls Power indicator.
+ ///
+ ///The symbol name of the security, the data of which should be used to calculate the indicator.
+ ///The value of the period can be one of the ENUM_TIMEFRAMES enumeration values, 0 means the current timeframe.
+ ///Averaging period (bars count) for calculations.
+ ///Shift of the indicator relative to the price chart.
+ ///The price used. Can be any of the price constants ENUM_APPLIED_PRICE or a handle of another indicator.
+ 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(Mt5CommandType.iDEMA, commandParameters);
+ }
+
+ ///
+ ///The function returns the handle of the DeMarker indicator.
+ ///
+ ///The symbol name of the security, the data of which should be used to calculate the indicator.
+ ///The value of the period can be one of the ENUM_TIMEFRAMES enumeration values, 0 means the current timeframe.
+ ///Averaging period (bars count) for calculations.
+ public int iDeMarker(string symbol, ENUM_TIMEFRAMES period, int maPeriod)
+ {
+ var commandParameters = new ArrayList { symbol, (int)period, maPeriod };
+ return SendCommand(Mt5CommandType.iDeMarker, commandParameters);
+ }
+
+ ///
+ ///The function returns the handle of the Envelopes indicator.
+ ///
+ ///The symbol name of the security, the data of which should be used to calculate the indicator.
+ ///The value of the period can be one of the ENUM_TIMEFRAMES enumeration values, 0 means the current timeframe.
+ ///Averaging period for the main line.
+ ///The shift of the indicator relative to the price chart.
+ ///Smoothing type. Can be one of the values of ENUM_MA_METHOD.
+ ///The price used. Can be any of the price constants ENUM_APPLIED_PRICE or a handle of another indicator.
+ ///The deviation from the main line (in percents).
+ 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(Mt5CommandType.iEnvelopes, commandParameters);
+ }
+
+ ///
+ ///The function returns the handle of the Force Index indicator.
+ ///
+ ///The symbol name of the security, the data of which should be used to calculate the indicator.
+ ///The value of the period can be one of the ENUM_TIMEFRAMES enumeration values, 0 means the current timeframe.
+ ///Averaging period for the indicator calculations.
+ ///Smoothing type. Can be one of the values of ENUM_MA_METHOD.
+ ///The volume used. Can be one of the values of ENUM_APPLIED_VOLUME.
+ 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(Mt5CommandType.iForce, commandParameters);
+ }
+
+ ///
+ ///The function returns the handle of the Force Index indicator.
+ ///
+ ///The symbol name of the security, the data of which should be used to calculate the indicator.
+ ///The value of the period can be one of the ENUM_TIMEFRAMES enumeration values, 0 means the current timeframe.
+ public int iForce(string symbol, ENUM_TIMEFRAMES period)
+ {
+ var commandParameters = new ArrayList { symbol, (int)period };
+ return SendCommand(Mt5CommandType.iForce, commandParameters);
+ }
+
+ ///
+ ///The function returns the handle of the Fractal Adaptive Moving Average indicator.
+ ///
+ ///The symbol name of the security, the data of which should be used to calculate the indicator.
+ ///The value of the period can be one of the ENUM_TIMEFRAMES enumeration values, 0 means the current timeframe.
+ ///Period (bars count) for the indicator calculations.
+ ///Shift of the indicator in the price chart.
+ ///The price used. Can be any of the price constants ENUM_APPLIED_PRICE or a handle of another indicator.
+ 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(Mt5CommandType.iFrAMA, commandParameters);
+ }
+
+ ///
+ ///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).
+ ///
+ ///The symbol name of the security, the data of which should be used to calculate the indicator.
+ ///The value of the period can be one of the ENUM_TIMEFRAMES enumeration values, 0 means the current timeframe.
+ ///Averaging period for the blue line (Alligator's Jaw).
+ ///The shift of the blue line relative to the price chart. It isn't directly connected with the visual shift of the indicator histogram.
+ ///Averaging period for the red line (Alligator's Teeth).
+ ///The shift of the red line relative to the price chart. It isn't directly connected with the visual shift of the indicator histogram.
+ ///Averaging period for the green line (Alligator's lips).
+ ///The shift of the green line relative to the price charts. It isn't directly connected with the visual shift of the indicator histogram.
+ ///Smoothing type. Can be one of the values of ENUM_MA_METHOD.
+ ///The price used. Can be any of the price constants ENUM_APPLIED_PRICE or a handle of another indicator.
+ 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(Mt5CommandType.iGator, commandParameters);
+ }
+
+ ///
+ ///The function returns the handle of the Ichimoku Kinko Hyo indicator.
+ ///
+ ///The symbol name of the security, the data of which should be used to calculate the indicator.
+ ///The value of the period can be one of the ENUM_TIMEFRAMES enumeration values, 0 means the current timeframe.
+ ///Averaging period for Tenkan Sen.
+ ///Averaging period for Kijun Sen.
+ ///Averaging period for Senkou Span B.
+ 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(Mt5CommandType.iIchimoku, commandParameters);
+ }
+
+ ///
+ ///The function returns the handle of the Market Facilitation Index indicator.
+ ///
+ ///The symbol name of the security, the data of which should be used to calculate the indicator.
+ ///The value of the period can be one of the ENUM_TIMEFRAMES enumeration values, 0 means the current timeframe.
+ ///The volume used. Can be one of the constants of ENUM_APPLIED_VOLUME.
+ public int iBWMFI(string symbol, ENUM_TIMEFRAMES period, ENUM_APPLIED_VOLUME appliedVolume)
+ {
+ var commandParameters = new ArrayList { symbol, (int)period, (int)appliedVolume };
+ return SendCommand(Mt5CommandType.iBWMFI, commandParameters);
+ }
+
+ ///
+ ///The function returns the handle of the Momentum indicator.
+ ///
+ ///The symbol name of the security, the data of which should be used to calculate the indicator.
+ ///The value of the period can be one of the ENUM_TIMEFRAMES enumeration values, 0 means the current timeframe.
+ ///Averaging period (bars count) for the calculation of the price change.
+ ///The price used. Can be any of the price constants ENUM_APPLIED_PRICE or a handle of another indicator.
+ 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(Mt5CommandType.iMomentum, commandParameters);
+ }
+
+ ///
+ ///The function returns the handle of the Money Flow Index indicator.
+ ///
+ ///The symbol name of the security, the data of which should be used to calculate the indicator.
+ ///The value of the period can be one of the ENUM_TIMEFRAMES enumeration values, 0 means the current timeframe.
+ ///Averaging period (bars count) for the calculation.
+ ///The volume used. Can be any of the ENUM_APPLIED_VOLUME values.
+ 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(Mt5CommandType.iMFI, commandParameters);
+ }
+
+ ///
+ ///The function returns the handle of the Moving Average indicator.
+ ///
+ ///The symbol name of the security, the data of which should be used to calculate the indicator.
+ ///The value of the period can be one of the ENUM_TIMEFRAMES enumeration values, 0 means the current timeframe.
+ ///Averaging period for the calculation of the moving average.
+ ///Shift of the indicator relative to the price chart.
+ ///Smoothing type. Can be one of the ENUM_MA_METHOD values.
+ ///The price used. Can be any of the price constants ENUM_APPLIED_PRICE or a handle of another indicator.
+ 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(Mt5CommandType.iMA, commandParameters);
+ }
+
+ ///
+ ///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.
+ ///
+ ///The symbol name of the security, the data of which should be used to calculate the indicator.
+ ///The value of the period can be one of the ENUM_TIMEFRAMES enumeration values, 0 means the current timeframe.
+ ///Period for Fast Moving Average calculation.
+ ///Period for Slow Moving Average calculation.
+ ///Averaging period for signal line calculation.
+ ///The price used. Can be any of the price constants ENUM_APPLIED_PRICE or a handle of another indicator.
+ 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(Mt5CommandType.iOsMA, commandParameters);
+ }
+
+ ///
+ ///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.
+ ///
+ ///The symbol name of the security, the data of which should be used to calculate the indicator.
+ ///The value of the period can be one of the ENUM_TIMEFRAMES enumeration values, 0 means the current timeframe.
+ ///Period for Fast Moving Average calculation.
+ ///Period for Slow Moving Average calculation.
+ ///Averaging period for signal line calculation.
+ ///The price used. Can be any of the price constants ENUM_APPLIED_PRICE or a handle of another indicator.
+ 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(Mt5CommandType.iMACD, commandParameters);
+ }
+
+ ///
+ ///The function returns the handle of the On Balance Volume indicator.
+ ///
+ ///The symbol name of the security, the data of which should be used to calculate the indicator.
+ ///The value of the period can be one of the ENUM_TIMEFRAMES enumeration values, 0 means the current timeframe.
+ ///The volume used. Can be any of the ENUM_APPLIED_VOLUME values.
+ public int iOBV(string symbol, ENUM_TIMEFRAMES period, ENUM_APPLIED_VOLUME appliedVolume)
+ {
+ var commandParameters = new ArrayList { symbol, (int)period, (int)appliedVolume };
+ return SendCommand(Mt5CommandType.iOBV, commandParameters);
+ }
+
+ ///
+ ///The function returns the handle of the Parabolic Stop and Reverse system indicator.
+ ///
+ ///The symbol name of the security, the data of which should be used to calculate the indicator.
+ ///The value of the period can be one of the ENUM_TIMEFRAMES enumeration values, 0 means the current timeframe.
+ ///The step of price increment, usually 0.02.
+ ///The maximum step, usually 0.2.
+ public int iSAR(string symbol, ENUM_TIMEFRAMES period, double step, double maximum)
+ {
+ var commandParameters = new ArrayList { symbol, (int)period, step, maximum };
+ return SendCommand(Mt5CommandType.iSAR, commandParameters);
+ }
+
+ ///
+ ///The function returns the handle of the Relative Strength Index indicator.
+ ///
+ ///The symbol name of the security, the data of which should be used to calculate the indicator.
+ ///The value of the period can be one of the ENUM_TIMEFRAMES enumeration values, 0 means the current timeframe.
+ ///Averaging period for the RSI calculation.
+ ///The price used. Can be any of the price constants ENUM_APPLIED_PRICE or a handle of another indicator.
+ 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(Mt5CommandType.iRSI, commandParameters);
+ }
+
+ ///
+ ///The function returns the handle of the Relative Vigor Index indicator.
+ ///
+ ///The symbol name of the security, the data of which should be used to calculate the indicator.
+ ///The value of the period can be one of the ENUM_TIMEFRAMES enumeration values, 0 means the current timeframe.
+ ///Averaging period for the RVI calculation.
+ public int iRVI(string symbol, ENUM_TIMEFRAMES period, int maPeriod)
+ {
+ var commandParameters = new ArrayList { symbol, (int)period, maPeriod };
+ return SendCommand(Mt5CommandType.iRVI, commandParameters);
+ }
+
+ ///
+ ///The function returns the handle of the Standard Deviation indicator.
+ ///
+ ///The symbol name of the security, the data of which should be used to calculate the indicator.
+ ///The value of the period can be one of the ENUM_TIMEFRAMES enumeration values, 0 means the current timeframe.
+ ///Averaging period for the RVI calculation.
+ ///Shift of the indicator relative to the price chart.
+ ///Type of averaging. Can be any of the ENUM_MA_METHOD values.
+ ///The price used. Can be any of the price constants ENUM_APPLIED_PRICE or a handle of another indicator.
+ 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(Mt5CommandType.iStdDev, commandParameters);
+ }
+
+ ///
+ ///The function returns the handle of the Stochastic Oscillator indicator.
+ ///
+ ///The symbol name of the security, the data of which should be used to calculate the indicator.
+ ///The value of the period can be one of the ENUM_TIMEFRAMES enumeration values, 0 means the current timeframe.
+ ///Averaging period (bars count) for the %K line calculation.
+ ///Averaging period (bars count) for the %D line calculation.
+ ///Slowing value.
+ ///Type of averaging. Can be any of the ENUM_MA_METHOD values.
+ ///Parameter of price selection for calculations. Can be one of the ENUM_STO_PRICE values.
+ 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(Mt5CommandType.iStochastic, commandParameters);
+ }
+
+ ///
+ ///The function returns the handle of the Triple Exponential Moving Average indicator.
+ ///
+ ///The symbol name of the security, the data of which should be used to calculate the indicator.
+ ///The value of the period can be one of the ENUM_TIMEFRAMES enumeration values, 0 means the current timeframe.
+ ///Averaging period (bars count) for calculation.
+ ///Shift of indicator relative to the price chart.
+ ///The price used. Can be any of the price constants ENUM_APPLIED_PRICE or a handle of another indicator.
+ 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(Mt5CommandType.iTEMA, commandParameters);
+ }
+
+ ///
+ ///The function returns the handle of the Triple Exponential Moving Averages Oscillator indicator.
+ ///
+ ///The symbol name of the security, the data of which should be used to calculate the indicator.
+ ///The value of the period can be one of the ENUM_TIMEFRAMES enumeration values, 0 means the current timeframe.
+ ///Averaging period (bars count) for calculation.
+ ///The price used. Can be any of the price constants ENUM_APPLIED_PRICE or a handle of another indicator.
+ 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(Mt5CommandType.iTriX, commandParameters);
+ }
+
+ ///
+ ///The function returns the handle of the Larry Williams' Percent Range indicator.
+ ///
+ ///The symbol name of the security, the data of which should be used to calculate the indicator.
+ ///The value of the period can be one of the ENUM_TIMEFRAMES enumeration values, 0 means the current timeframe.
+ ///Period (bars count) for the indicator calculation.
+ public int iWPR(string symbol, ENUM_TIMEFRAMES period, int calcPeriod)
+ {
+ var commandParameters = new ArrayList { symbol, (int)period, calcPeriod };
+ return SendCommand(Mt5CommandType.iWPR, commandParameters);
+ }
+
+ ///
+ ///The function returns the handle of the Variable Index Dynamic Average indicator.
+ ///
+ ///The symbol name of the security, the data of which should be used to calculate the indicator.
+ ///The value of the period can be one of the ENUM_TIMEFRAMES enumeration values, 0 means the current timeframe.
+ ///Period (bars count) for the Chande Momentum Oscillator calculation.
+ ///EMA period (bars count) for smoothing factor calculation.
+ ///Shift of the indicator relative to the price chart.
+ ///The price used. Can be any of the price constants ENUM_APPLIED_PRICE or a handle of another indicator.
+ 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(Mt5CommandType.iVIDyA, commandParameters);
+ }
+
+ ///
+ ///The function returns the handle of the Volumes indicator.
+ ///
+ ///The symbol name of the security, the data of which should be used to calculate the indicator.
+ ///The value of the period can be one of the ENUM_TIMEFRAMES enumeration values, 0 means the current timeframe.
+ ///The volume used. Can be any of the ENUM_APPLIED_VOLUME values.
+ public int iVolumes(string symbol, ENUM_TIMEFRAMES period, ENUM_APPLIED_VOLUME appliedVolume)
+ {
+ var commandParameters = new ArrayList { symbol, (int)period, (int)appliedVolume };
+ return SendCommand(Mt5CommandType.iVolumes, commandParameters);
+ }
+
+ ///
+ ///The function returns the handle of the Volumes indicator.
+ ///
+ ///The symbol name of the security, the data of which should be used to calculate the indicator.
+ ///The value of the period can be one of the ENUM_TIMEFRAMES enumeration values, 0 means the current timeframe.
+ ///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).
+ ///input-parameters of a custom indicator. If there is no parameters specified, then default values will be used.
+ public int iCustom(string symbol, ENUM_TIMEFRAMES period, string name, double[] parameters)
+ {
+ var response = SendRequest(new ICustomRequest
+ {
+ Symbol = symbol,
+ Timeframe = (int)period,
+ Name = name,
+ Params = new ArrayList(parameters),
+ ParamsType = ICustomRequest.ParametersType.Double
+ });
+ return response?.Value ?? 0;
+ }
+
+ ///
+ ///The function returns the handle of the Volumes indicator.
+ ///
+ ///The symbol name of the security, the data of which should be used to calculate the indicator.
+ ///The value of the period can be one of the ENUM_TIMEFRAMES enumeration values, 0 means the current timeframe.
+ ///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).
+ ///input-parameters of a custom indicator. If there is no parameters specified, then default values will be used.
+ public int iCustom(string symbol, ENUM_TIMEFRAMES period, string name, int[] parameters)
+ {
+ var response = SendRequest(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
diff --git a/MtApi5/Requests/ICustomRequest.cs b/MtApi5/Requests/ICustomRequest.cs
new file mode 100644
index 00000000..bbf7d702
--- /dev/null
+++ b/MtApi5/Requests/ICustomRequest.cs
@@ -0,0 +1,23 @@
+using System.Collections;
+
+namespace MtApi5.Requests
+{
+ internal class ICustomRequest : RequestBase
+ {
+ public enum ParametersType
+ {
+ Int = 0,
+ Double = 1,
+ String = 2,
+ Boolean = 3
+ }
+
+ public string Symbol { get; set; }
+ public int Timeframe { get; set; }
+ public string Name { get; set; }
+ public ArrayList Params { get; set; }
+ public ParametersType ParamsType { get; set; }
+
+ public override RequestType RequestType => RequestType.iCustom;
+ }
+}
diff --git a/MtApi5/Requests/RequestType.cs b/MtApi5/Requests/RequestType.cs
index 1bad6010..887c88ae 100755
--- a/MtApi5/Requests/RequestType.cs
+++ b/MtApi5/Requests/RequestType.cs
@@ -3,6 +3,7 @@
internal enum RequestType
{
Unknown = 0,
- CopyTicks = 1
+ CopyTicks = 1,
+ iCustom = 2
}
}
\ No newline at end of file
diff --git a/MtApi5/Responses/ICustomResponse.cs b/MtApi5/Responses/ICustomResponse.cs
new file mode 100644
index 00000000..4116f209
--- /dev/null
+++ b/MtApi5/Responses/ICustomResponse.cs
@@ -0,0 +1,7 @@
+namespace MtApi5.Responses
+{
+ internal class ICustomResponse: ResponseBase
+ {
+ public int Value { get; set; }
+ }
+}