diff --git a/Indicator.mqh b/Indicator.mqh index d93954818..461bcc8f2 100644 --- a/Indicator.mqh +++ b/Indicator.mqh @@ -130,7 +130,7 @@ class Indicator : public IndicatorData { * Class constructor. */ Indicator(const TS& _iparams, const IndicatorDataParams& _idparams, IndicatorData* _indi_src = NULL, int _indi_mode = 0) - : IndicatorData(_idparams) { + : IndicatorData(_idparams, _indi_src, _indi_mode) { iparams = _iparams; Init(); } diff --git a/IndicatorData.mqh b/IndicatorData.mqh index 1806f44f6..21e374cee 100644 --- a/IndicatorData.mqh +++ b/IndicatorData.mqh @@ -747,15 +747,15 @@ class IndicatorData : public IndicatorBase { " must select source indicator's mode via SetDataSourceMode(int). Defaulting to mode 0."); _target.idparams.Set(STRUCT_ENUM(IndicatorDataParams, IDATA_PARAM_DATA_SRC_MODE), 0); DebugBreak(); - } else if (_source.GetModeCount() == 1 && + } else if (_source.Get(STRUCT_ENUM(IndicatorDataParams, IDATA_PARAM_DATA_SRC_MODE)) == 1 && _target.idparams.Get(STRUCT_ENUM(IndicatorDataParams, IDATA_PARAM_DATA_SRC_MODE)) == -1) { _target.idparams.Set(STRUCT_ENUM(IndicatorDataParams, IDATA_PARAM_DATA_SRC_MODE), 0); } else if (_target.idparams.Get(STRUCT_ENUM(IndicatorDataParams, IDATA_PARAM_DATA_SRC_MODE)) < 0 || _target.idparams.Get(STRUCT_ENUM(IndicatorDataParams, IDATA_PARAM_DATA_SRC_MODE)) > - _source.GetModeCount()) { + _source.Get(STRUCT_ENUM(IndicatorDataParams, IDATA_PARAM_MAX_MODES))) { Alert("Error! ", _target.GetName(), " must select valid source indicator's mode via SetDataSourceMode(int) between 0 and ", - _source.GetModeCount(), "."); + _source.Get(STRUCT_ENUM(IndicatorDataParams, IDATA_PARAM_MAX_MODES)), "."); DebugBreak(); } } diff --git a/Indicators/Bitwise/Indi_Candle.mqh b/Indicators/Bitwise/Indi_Candle.mqh index 053710dff..7e4a4f5d3 100644 --- a/Indicators/Bitwise/Indi_Candle.mqh +++ b/Indicators/Bitwise/Indi_Candle.mqh @@ -50,9 +50,10 @@ class Indi_Candle : public IndicatorTickOrCandleSource { /** * Class constructor. */ - Indi_Candle(CandleParams &_p, IndicatorData *_indi_src = NULL) + Indi_Candle(CandleParams &_p, ENUM_IDATA_SOURCE_TYPE _idstype = IDATA_BUILTIN, IndicatorData *_indi_src = NULL, + int _indi_src_mode = 0) : IndicatorTickOrCandleSource( - _p, IndicatorDataParams::GetInstance(1, TYPE_INT, IDATA_BUILTIN, IDATA_RANGE_RANGE), + _p, IndicatorDataParams::GetInstance(1, TYPE_INT, _idstype, IDATA_RANGE_RANGE, _indi_src_mode), _indi_src){}; Indi_Candle(ENUM_TIMEFRAMES _tf = PERIOD_CURRENT, int _shift = 0) : IndicatorTickOrCandleSource(INDI_CANDLE, _tf, _shift){}; diff --git a/Indicators/Bitwise/Indi_Pattern.mqh b/Indicators/Bitwise/Indi_Pattern.mqh index 38641ff40..cc223770c 100644 --- a/Indicators/Bitwise/Indi_Pattern.mqh +++ b/Indicators/Bitwise/Indi_Pattern.mqh @@ -47,9 +47,11 @@ class Indi_Pattern : public IndicatorTickOrCandleSource { /** * Class constructor. */ - Indi_Pattern(IndiPatternParams& _p, IndicatorData* _indi_src = NULL) + Indi_Pattern(IndiPatternParams& _p, ENUM_IDATA_SOURCE_TYPE _idstype = IDATA_BUILTIN, IndicatorData* _indi_src = NULL, + int _indi_src_mode = 0) : IndicatorTickOrCandleSource( - _p, IndicatorDataParams::GetInstance(5, TYPE_UINT, IDATA_BUILTIN, IDATA_RANGE_BITWISE), _indi_src){}; + _p, IndicatorDataParams::GetInstance(5, TYPE_UINT, _idstype, IDATA_RANGE_BITWISE, _indi_src_mode), + _indi_src){}; Indi_Pattern(ENUM_TIMEFRAMES _tf = PERIOD_CURRENT, int _shift = 0) : IndicatorTickOrCandleSource(INDI_PATTERN, _tf, _shift){}; diff --git a/Indicators/Indi_AC.mqh b/Indicators/Indi_AC.mqh index 78564827f..2d9e905f8 100644 --- a/Indicators/Indi_AC.mqh +++ b/Indicators/Indi_AC.mqh @@ -67,9 +67,11 @@ class Indi_AC : public IndicatorTickOrCandleSource { /** * Class constructor. */ - Indi_AC(IndiACParams &_p, IndicatorData *_indi_src = NULL) + Indi_AC(IndiACParams &_p, ENUM_IDATA_SOURCE_TYPE _idstype = IDATA_BUILTIN, IndicatorData *_indi_src = NULL, + int _indi_src_mode = 0) : IndicatorTickOrCandleSource( - _p, IndicatorDataParams::GetInstance(1, TYPE_DOUBLE, IDATA_BUILTIN, IDATA_RANGE_MIXED), _indi_src) { + _p, IndicatorDataParams::GetInstance(1, TYPE_DOUBLE, _idstype, IDATA_RANGE_MIXED, _indi_src_mode), + _indi_src) { Init(); }; Indi_AC(ENUM_TIMEFRAMES _tf = PERIOD_CURRENT, int _shift = 0) : IndicatorTickOrCandleSource(INDI_AC, _tf, _shift) { diff --git a/Indicators/Indi_AD.mqh b/Indicators/Indi_AD.mqh index e7e8b1a49..279f380c4 100644 --- a/Indicators/Indi_AD.mqh +++ b/Indicators/Indi_AD.mqh @@ -52,9 +52,12 @@ class Indi_AD : public IndicatorTickOrCandleSource { /** * Class constructor. */ - Indi_AD(IndiADParams &_p, IndicatorData *_indi_src = NULL) - : IndicatorTickOrCandleSource( - _p, IndicatorDataParams::GetInstance(1, TYPE_DOUBLE, IDATA_BUILTIN, IDATA_RANGE_MIXED), _indi_src){}; + Indi_AD(IndiADParams &_p, ENUM_IDATA_SOURCE_TYPE _idstype = IDATA_BUILTIN, IndicatorData *_indi_src = NULL, + int _indi_src_mode = 0) + : IndicatorTickOrCandleSource(_p, + IndicatorDataParams::GetInstance(FINAL_INDI_ADX_LINE_ENTRY, TYPE_DOUBLE, _idstype, + IDATA_RANGE_MIXED, _indi_src_mode), + _indi_src){}; Indi_AD(ENUM_TIMEFRAMES _tf = PERIOD_CURRENT, int _shift = 0) : IndicatorTickOrCandleSource(INDI_AD, _tf, _shift) { iparams.SetTf(_tf); }; diff --git a/Indicators/Indi_ADX.mqh b/Indicators/Indi_ADX.mqh index 799763c03..527749bc7 100644 --- a/Indicators/Indi_ADX.mqh +++ b/Indicators/Indi_ADX.mqh @@ -65,11 +65,12 @@ class Indi_ADX : public IndicatorTickOrCandleSource { /** * Class constructor. */ - Indi_ADX(IndiADXParams &_p, IndicatorData *_indi_src = NULL) - : IndicatorTickOrCandleSource( - _p, - IndicatorDataParams::GetInstance(FINAL_INDI_ADX_LINE_ENTRY, TYPE_DOUBLE, IDATA_BUILTIN, IDATA_RANGE_RANGE), - _indi_src) { + Indi_ADX(IndiADXParams &_p, ENUM_IDATA_SOURCE_TYPE _idstype = IDATA_BUILTIN, IndicatorData *_indi_src = NULL, + int _indi_src_mode = 0) + : IndicatorTickOrCandleSource(_p, + IndicatorDataParams::GetInstance(FINAL_INDI_ADX_LINE_ENTRY, TYPE_DOUBLE, _idstype, + IDATA_RANGE_RANGE, _indi_src_mode), + _indi_src) { Init(); } Indi_ADX(ENUM_TIMEFRAMES _tf = PERIOD_CURRENT, int _shift = 0) : IndicatorTickOrCandleSource(INDI_ADX, _tf, _shift) { diff --git a/Indicators/Indi_ADXW.mqh b/Indicators/Indi_ADXW.mqh index 1f6b41ff8..74f1c1f89 100644 --- a/Indicators/Indi_ADXW.mqh +++ b/Indicators/Indi_ADXW.mqh @@ -58,8 +58,12 @@ class Indi_ADXW : public IndicatorTickOrCandleSource { /** * Class constructor. */ - Indi_ADXW(IndiADXWParams &_p, IndicatorData *_indi_src = NULL) - : IndicatorTickOrCandleSource(_p, IndicatorDataParams::GetInstance(1, TYPE_DOUBLE, IDATA_BUILTIN), _indi_src){}; + Indi_ADXW(IndiADXWParams &_p, ENUM_IDATA_SOURCE_TYPE _idstype = IDATA_BUILTIN, IndicatorData *_indi_src = NULL, + int _indi_src_mode = 0) + : IndicatorTickOrCandleSource(_p, + IndicatorDataParams::GetInstance(FINAL_INDI_ADX_LINE_ENTRY, TYPE_DOUBLE, _idstype, + IDATA_RANGE_RANGE, _indi_src_mode), + _indi_src){}; Indi_ADXW(ENUM_TIMEFRAMES _tf = PERIOD_CURRENT, int _shift = 0) : IndicatorTickOrCandleSource(INDI_ADXW, _tf, _shift){}; diff --git a/Indicators/Indi_AMA.mqh b/Indicators/Indi_AMA.mqh index 51f97d750..da11e4e6b 100644 --- a/Indicators/Indi_AMA.mqh +++ b/Indicators/Indi_AMA.mqh @@ -63,9 +63,9 @@ class Indi_AMA : public IndicatorTickOrCandleSource { /** * Class constructor. */ - Indi_AMA(IndiAMAParams &_p, IndicatorData *_indi_src = NULL, int _indi_mode = 0) - : IndicatorTickOrCandleSource(_p, - IndicatorDataParams::GetInstance(1, TYPE_DOUBLE, IDATA_BUILTIN, IDATA_RANGE_PRICE), + Indi_AMA(IndiAMAParams &_p, IndicatorData *_indi_src = NULL, int _indi_mode = 0, + ENUM_IDATA_SOURCE_TYPE _idstype = IDATA_BUILTIN) + : IndicatorTickOrCandleSource(_p, IndicatorDataParams::GetInstance(1, TYPE_DOUBLE, _idstype, IDATA_RANGE_PRICE), _indi_src, _indi_mode) { iparams.SetIndicatorType(INDI_AMA); }; diff --git a/Indicators/Indi_AO.mqh b/Indicators/Indi_AO.mqh index 0cc6b9df5..783e48562 100644 --- a/Indicators/Indi_AO.mqh +++ b/Indicators/Indi_AO.mqh @@ -66,9 +66,11 @@ class Indi_AO : public IndicatorTickOrCandleSource { /** * Class constructor. */ - Indi_AO(IndiAOParams &_p, IndicatorData *_indi_src = NULL) + Indi_AO(IndiAOParams &_p, ENUM_IDATA_SOURCE_TYPE _idstype = IDATA_BUILTIN, IndicatorData *_indi_src = NULL, + int _indi_src_mode = 0) : IndicatorTickOrCandleSource( - _p, IndicatorDataParams::GetInstance(2, TYPE_DOUBLE, IDATA_BUILTIN, IDATA_RANGE_MIXED), _indi_src) { + _p, IndicatorDataParams::GetInstance(2, TYPE_DOUBLE, _idstype, IDATA_RANGE_MIXED, _indi_src_mode), + _indi_src) { Init(); }; Indi_AO(ENUM_TIMEFRAMES _tf = PERIOD_CURRENT, int _shift = 0) : IndicatorTickOrCandleSource(INDI_AO, _tf, _shift) { diff --git a/Indicators/Indi_ASI.mqh b/Indicators/Indi_ASI.mqh index 0e0f8ee31..d520cfb5d 100644 --- a/Indicators/Indi_ASI.mqh +++ b/Indicators/Indi_ASI.mqh @@ -61,9 +61,11 @@ class Indi_ASI : public IndicatorTickOrCandleSource { /** * Class constructor. */ - Indi_ASI(IndiASIParams &_p, IndicatorData *_indi_src = NULL) + Indi_ASI(IndiASIParams &_p, ENUM_IDATA_SOURCE_TYPE _idstype = IDATA_ONCALCULATE, IndicatorData *_indi_src = NULL, + int _indi_src_mode = 0) : IndicatorTickOrCandleSource( - _p, IndicatorDataParams::GetInstance(1, TYPE_DOUBLE, IDATA_ONCALCULATE, IDATA_RANGE_MIXED), _indi_src) { + _p, IndicatorDataParams::GetInstance(1, TYPE_DOUBLE, _idstype, IDATA_RANGE_MIXED, _indi_src_mode), + _indi_src) { Init(); }; Indi_ASI(ENUM_TIMEFRAMES _tf = PERIOD_CURRENT, int _shift = 0) : IndicatorTickOrCandleSource(INDI_ASI, _tf, _shift) { diff --git a/Indicators/Indi_ATR.mqh b/Indicators/Indi_ATR.mqh index 76fb9014e..37641e945 100644 --- a/Indicators/Indi_ATR.mqh +++ b/Indicators/Indi_ATR.mqh @@ -55,9 +55,11 @@ class Indi_ATR : public IndicatorTickOrCandleSource { /** * Class constructor. */ - Indi_ATR(IndiATRParams &_p, IndicatorData *_indi_src = NULL) + Indi_ATR(IndiATRParams &_p, ENUM_IDATA_SOURCE_TYPE _idstype = IDATA_BUILTIN, IndicatorData *_indi_src = NULL, + int _indi_src_mode = 0) : IndicatorTickOrCandleSource( - _p, IndicatorDataParams::GetInstance(1, TYPE_DOUBLE, IDATA_BUILTIN, IDATA_RANGE_MIXED), _indi_src) {} + _p, IndicatorDataParams::GetInstance(1, TYPE_DOUBLE, _idstype, IDATA_RANGE_MIXED, _indi_src_mode), + _indi_src) {} Indi_ATR(ENUM_TIMEFRAMES _tf = PERIOD_CURRENT, int _shift = 0) : IndicatorTickOrCandleSource(INDI_ATR, _tf, _shift){}; /** diff --git a/Indicators/Indi_Alligator.mqh b/Indicators/Indi_Alligator.mqh index 74693c57b..7df3fb2cf 100644 --- a/Indicators/Indi_Alligator.mqh +++ b/Indicators/Indi_Alligator.mqh @@ -99,10 +99,10 @@ class Indi_Alligator : public IndicatorTickOrCandleSource { /** * Class constructor. */ - Indi_Alligator(IndiAlligatorParams &_p, IndicatorData *_indi_src = NULL) + Indi_Alligator(IndiAlligatorParams &_p, IndicatorData *_indi_src = NULL, + ENUM_IDATA_SOURCE_TYPE _idstype = IDATA_BUILTIN) : IndicatorTickOrCandleSource( - _p, - IndicatorDataParams::GetInstance(FINAL_ALLIGATOR_LINE_ENTRY, TYPE_DOUBLE, IDATA_BUILTIN, IDATA_RANGE_PRICE), + _p, IndicatorDataParams::GetInstance(FINAL_ALLIGATOR_LINE_ENTRY, TYPE_DOUBLE, _idstype, IDATA_RANGE_PRICE), _indi_src) {} Indi_Alligator(ENUM_TIMEFRAMES _tf = PERIOD_CURRENT, int _shift = 0) : IndicatorTickOrCandleSource(INDI_ADX, _tf, _shift){}; diff --git a/Indicators/Indi_AppliedPrice.mqh b/Indicators/Indi_AppliedPrice.mqh index 638d4500c..82a8399a9 100644 --- a/Indicators/Indi_AppliedPrice.mqh +++ b/Indicators/Indi_AppliedPrice.mqh @@ -55,9 +55,11 @@ class Indi_AppliedPrice : public IndicatorTickOrCandleSource { /** * Class constructor. */ - Indi_BWMFI(IndiBWIndiMFIParams &_p, IndicatorData *_indi_src = NULL) - : IndicatorTickOrCandleSource( - _p, - IndicatorDataParams::GetInstance(FINAL_BWMFI_BUFFER_ENTRY, TYPE_DOUBLE, IDATA_BUILTIN, IDATA_RANGE_MIXED), - _indi_src) { + Indi_BWMFI(IndiBWIndiMFIParams &_p, ENUM_IDATA_SOURCE_TYPE _idstype = IDATA_BUILTIN, IndicatorData *_indi_src = NULL, + int _indi_src_mode = 0) + : IndicatorTickOrCandleSource(_p, + IndicatorDataParams::GetInstance(FINAL_BWMFI_BUFFER_ENTRY, TYPE_DOUBLE, _idstype, + IDATA_RANGE_MIXED, _indi_src_mode), + _indi_src) { Init(); } Indi_BWMFI(ENUM_TIMEFRAMES _tf = PERIOD_CURRENT, int _shift = 0) diff --git a/Indicators/Indi_BWZT.mqh b/Indicators/Indi_BWZT.mqh index 53b5b9729..34a3f0df9 100644 --- a/Indicators/Indi_BWZT.mqh +++ b/Indicators/Indi_BWZT.mqh @@ -74,11 +74,12 @@ class Indi_BWZT : public IndicatorTickOrCandleSource { /** * Class constructor. */ - Indi_BWZT(IndiBWZTParams &_p, IndicatorData *_indi_src = NULL) - : IndicatorTickOrCandleSource( - _p, - IndicatorDataParams::GetInstance(FINAL_INDI_BWZT_MODE_ENTRY, TYPE_DOUBLE, IDATA_BUILTIN, IDATA_RANGE_MIXED), - _indi_src) { + Indi_BWZT(IndiBWZTParams &_p, ENUM_IDATA_SOURCE_TYPE _idstype = IDATA_BUILTIN, IndicatorData *_indi_src = NULL, + int _indi_src_mode = 0) + : IndicatorTickOrCandleSource(_p, + IndicatorDataParams::GetInstance(FINAL_INDI_BWZT_MODE_ENTRY, TYPE_DOUBLE, _idstype, + IDATA_RANGE_MIXED, _indi_src_mode), + _indi_src) { Init(); }; Indi_BWZT(ENUM_TIMEFRAMES _tf = PERIOD_CURRENT, int _shift = 0) diff --git a/Indicators/Indi_Bands.mqh b/Indicators/Indi_Bands.mqh index 6f6526f96..440158315 100644 --- a/Indicators/Indi_Bands.mqh +++ b/Indicators/Indi_Bands.mqh @@ -94,9 +94,12 @@ class Indi_Bands : public IndicatorTickSource { /** * Class constructor. */ - Indi_Bands(IndiBandsParams &_p, IndicatorData *_indi_src = NULL, int _mode = 0) - : IndicatorTickSource(_p, IndicatorDataParams::GetInstance(FINAL_BANDS_LINE_ENTRY, TYPE_DOUBLE, IDATA_BUILTIN, IDATA_RANGE_PRICE), _indi_src, - _mode) { + Indi_Bands(IndiBandsParams &_p, ENUM_IDATA_SOURCE_TYPE _idstype = IDATA_BUILTIN, IndicatorData *_indi_src = NULL, + int _indi_src_mode = 0) + : IndicatorTickSource(_p, + IndicatorDataParams::GetInstance(FINAL_BANDS_LINE_ENTRY, TYPE_DOUBLE, _idstype, + IDATA_RANGE_PRICE, _indi_src_mode), + _indi_src) { Init(); } Indi_Bands(ENUM_TIMEFRAMES _tf = PERIOD_CURRENT, int _shift = 0) : IndicatorTickSource(INDI_BANDS, _tf, _shift) { diff --git a/Indicators/Indi_BearsPower.mqh b/Indicators/Indi_BearsPower.mqh index de0318428..8afef713b 100644 --- a/Indicators/Indi_BearsPower.mqh +++ b/Indicators/Indi_BearsPower.mqh @@ -55,9 +55,10 @@ class Indi_BearsPower : public IndicatorTickOrCandleSource /** * Class constructor. */ - Indi_BearsPower(IndiBearsPowerParams &_p, IndicatorData *_indi_src = NULL) - : IndicatorTickOrCandleSource( - _p, IndicatorDataParams::GetInstance(1, TYPE_DOUBLE, IDATA_BUILTIN, IDATA_RANGE_MIXED), _indi_src) {} + Indi_BearsPower(IndiBearsPowerParams &_p, IndicatorData *_indi_src = NULL, + ENUM_IDATA_SOURCE_TYPE _idstype = IDATA_BUILTIN) + : IndicatorTickOrCandleSource(_p, IndicatorDataParams::GetInstance(1, TYPE_DOUBLE, _idstype, IDATA_RANGE_MIXED), + _indi_src) {} Indi_BearsPower(ENUM_TIMEFRAMES _tf = PERIOD_CURRENT, int _shift = 0) : IndicatorTickOrCandleSource(INDI_BEARS, _tf, _shift) {} diff --git a/Indicators/Indi_BullsPower.mqh b/Indicators/Indi_BullsPower.mqh index 14a8884ed..1a466214c 100644 --- a/Indicators/Indi_BullsPower.mqh +++ b/Indicators/Indi_BullsPower.mqh @@ -55,9 +55,10 @@ class Indi_BullsPower : public IndicatorTickOrCandleSource /** * Class constructor. */ - Indi_BullsPower(IndiBullsPowerParams &_p, IndicatorData *_indi_src = NULL) - : IndicatorTickOrCandleSource( - _p, IndicatorDataParams::GetInstance(1, TYPE_DOUBLE, IDATA_BUILTIN, IDATA_RANGE_MIXED), _indi_src) {} + Indi_BullsPower(IndiBullsPowerParams &_p, IndicatorData *_indi_src = NULL, + ENUM_IDATA_SOURCE_TYPE _idstype = IDATA_BUILTIN) + : IndicatorTickOrCandleSource(_p, IndicatorDataParams::GetInstance(1, TYPE_DOUBLE, _idstype, IDATA_RANGE_MIXED), + _indi_src) {} Indi_BullsPower(ENUM_TIMEFRAMES _tf = PERIOD_CURRENT, int _shift = 0) : IndicatorTickOrCandleSource(INDI_BULLS, _tf, _shift) {} diff --git a/Indicators/Indi_CCI.mqh b/Indicators/Indi_CCI.mqh index cf7f2bfcd..57775a615 100644 --- a/Indicators/Indi_CCI.mqh +++ b/Indicators/Indi_CCI.mqh @@ -62,9 +62,11 @@ class Indi_CCI : public IndicatorTickSource { /** * Class constructor. */ - Indi_CCI(IndiCCIParams &_p, IndicatorData *_indi_src = NULL) - : IndicatorTickSource(_p, IndicatorDataParams::GetInstance(1, TYPE_DOUBLE, IDATA_BUILTIN, IDATA_RANGE_MIXED), - _indi_src) {} + Indi_CCI(IndiCCIParams &_p, ENUM_IDATA_SOURCE_TYPE _idstype = IDATA_BUILTIN, IndicatorData *_indi_src = NULL, + int _indi_src_mode = 0) + : IndicatorTickSource( + _p, IndicatorDataParams::GetInstance(1, TYPE_DOUBLE, _idstype, IDATA_RANGE_MIXED, _indi_src_mode), + _indi_src) {} Indi_CCI(ENUM_TIMEFRAMES _tf = PERIOD_CURRENT, int _shift = 0) : IndicatorTickSource(INDI_CCI, _tf, _shift) {} /** diff --git a/Indicators/Indi_CHO.mqh b/Indicators/Indi_CHO.mqh index f5f48157e..1e05734b0 100644 --- a/Indicators/Indi_CHO.mqh +++ b/Indicators/Indi_CHO.mqh @@ -58,9 +58,11 @@ class Indi_CHO : public IndicatorTickOrCandleSource { /** * Class constructor. */ - Indi_CHO(IndiCHOParams &_p, IndicatorData *_indi_src = NULL) + Indi_CHO(IndiCHOParams &_p, ENUM_IDATA_SOURCE_TYPE _idstype = IDATA_BUILTIN, IndicatorData *_indi_src = NULL, + int _indi_src_mode = 0) : IndicatorTickOrCandleSource( - _p, IndicatorDataParams::GetInstance(1, TYPE_DOUBLE, IDATA_BUILTIN, IDATA_RANGE_MIXED), _indi_src){}; + _p, IndicatorDataParams::GetInstance(1, TYPE_DOUBLE, _idstype, IDATA_RANGE_MIXED, _indi_src_mode), + _indi_src){}; Indi_CHO(ENUM_TIMEFRAMES _tf = PERIOD_CURRENT, int _shift = 0) : IndicatorTickOrCandleSource(INDI_CHAIKIN, _tf, _shift){}; diff --git a/Indicators/Indi_CHV.mqh b/Indicators/Indi_CHV.mqh index 7b8119289..9d514d3f7 100644 --- a/Indicators/Indi_CHV.mqh +++ b/Indicators/Indi_CHV.mqh @@ -59,9 +59,11 @@ class Indi_CHV : public IndicatorTickOrCandleSource { /** * Class constructor. */ - Indi_CHV(IndiCHVParams &_p, IndicatorData *_indi_src = NULL) + Indi_CHV(IndiCHVParams &_p, ENUM_IDATA_SOURCE_TYPE _idstype = IDATA_BUILTIN, IndicatorData *_indi_src = NULL, + int _indi_src_mode = 0) : IndicatorTickOrCandleSource( - _p, IndicatorDataParams::GetInstance(1, TYPE_DOUBLE, IDATA_BUILTIN, IDATA_RANGE_MIXED), _indi_src){}; + _p, IndicatorDataParams::GetInstance(1, TYPE_DOUBLE, _idstype, IDATA_RANGE_MIXED, _indi_src_mode), + _indi_src){}; Indi_CHV(ENUM_TIMEFRAMES _tf = PERIOD_CURRENT, int _shift = 0) : IndicatorTickOrCandleSource(INDI_CHAIKIN_V, _tf, _shift){}; diff --git a/Indicators/Indi_ColorBars.mqh b/Indicators/Indi_ColorBars.mqh index 78082f8a5..66ba38054 100644 --- a/Indicators/Indi_ColorBars.mqh +++ b/Indicators/Indi_ColorBars.mqh @@ -46,9 +46,10 @@ class Indi_ColorBars : public IndicatorTickOrCandleSource { /** * Class constructor. */ - Indi_ColorBars(IndiColorBarsParams &_p, IndicatorData *_indi_src = NULL) - : IndicatorTickOrCandleSource( - _p, IndicatorDataParams::GetInstance(5, TYPE_DOUBLE, IDATA_BUILTIN, IDATA_RANGE_MIXED), _indi_src){}; + Indi_ColorBars(IndiColorBarsParams &_p, IndicatorData *_indi_src = NULL, + ENUM_IDATA_SOURCE_TYPE _idstype = IDATA_BUILTIN) + : IndicatorTickOrCandleSource(_p, IndicatorDataParams::GetInstance(5, TYPE_DOUBLE, _idstype, IDATA_RANGE_MIXED), + _indi_src){}; Indi_ColorBars(ENUM_TIMEFRAMES _tf = PERIOD_CURRENT, int _shift = 0) : IndicatorTickOrCandleSource(INDI_COLOR_BARS, _tf, _shift){}; diff --git a/Indicators/Indi_ColorCandlesDaily.mqh b/Indicators/Indi_ColorCandlesDaily.mqh index e47528dac..2d7e9d0d8 100644 --- a/Indicators/Indi_ColorCandlesDaily.mqh +++ b/Indicators/Indi_ColorCandlesDaily.mqh @@ -46,9 +46,10 @@ class Indi_ColorCandlesDaily : public IndicatorTickOrCandleSource { /** * Class constructor. */ - Indi_ColorLine(IndiColorLineParams &_p, IndicatorData *_indi_src = NULL) - : IndicatorTickOrCandleSource( - _p, IndicatorDataParams::GetInstance(2, TYPE_DOUBLE, IDATA_BUILTIN, IDATA_RANGE_MIXED), _indi_src){}; + Indi_ColorLine(IndiColorLineParams &_p, IndicatorData *_indi_src = NULL, + ENUM_IDATA_SOURCE_TYPE _idstype = IDATA_BUILTIN) + : IndicatorTickOrCandleSource(_p, IndicatorDataParams::GetInstance(2, TYPE_DOUBLE, _idstype, IDATA_RANGE_MIXED), + _indi_src){}; Indi_ColorLine(ENUM_TIMEFRAMES _tf = PERIOD_CURRENT, int _shift = 0) : IndicatorTickOrCandleSource(INDI_COLOR_LINE, _tf, _shift){}; diff --git a/Indicators/Indi_CustomMovingAverage.mqh b/Indicators/Indi_CustomMovingAverage.mqh index 8db902680..eb498d602 100644 --- a/Indicators/Indi_CustomMovingAverage.mqh +++ b/Indicators/Indi_CustomMovingAverage.mqh @@ -59,9 +59,10 @@ class Indi_CustomMovingAverage : public IndicatorTickOrCandleSource { /** * Class constructor. */ - Indi_DEMA(IndiDEIndiMAParams &_p, IndicatorData *_indi_src = NULL) + Indi_DEMA(IndiDEIndiMAParams &_p, ENUM_IDATA_SOURCE_TYPE _idstype = IDATA_BUILTIN, IndicatorData *_indi_src = NULL, + int _indi_src_mode = 0) : IndicatorTickOrCandleSource( - _p, IndicatorDataParams::GetInstance(1, TYPE_DOUBLE, IDATA_BUILTIN, IDATA_RANGE_PRICE), _indi_src) {} + _p, IndicatorDataParams::GetInstance(1, TYPE_DOUBLE, _idstype, IDATA_RANGE_PRICE, _indi_src_mode), + _indi_src) {} Indi_DEMA(ENUM_TIMEFRAMES _tf = PERIOD_CURRENT, int _shift = 0) : IndicatorTickOrCandleSource(INDI_DEMA, _tf, _shift) {} diff --git a/Indicators/Indi_DeMarker.mqh b/Indicators/Indi_DeMarker.mqh index e45f2420b..af71bf5c4 100644 --- a/Indicators/Indi_DeMarker.mqh +++ b/Indicators/Indi_DeMarker.mqh @@ -53,9 +53,10 @@ class Indi_DeMarker : public IndicatorTickOrCandleSource { /** * Class constructor. */ - Indi_DeMarker(IndiDeMarkerParams &_p, IndicatorData *_indi_src = NULL) - : IndicatorTickOrCandleSource( - _p, IndicatorDataParams::GetInstance(1, TYPE_DOUBLE, IDATA_BUILTIN, IDATA_RANGE_RANGE), _indi_src) {} + Indi_DeMarker(IndiDeMarkerParams &_p, IndicatorData *_indi_src = NULL, + ENUM_IDATA_SOURCE_TYPE _idstype = IDATA_BUILTIN) + : IndicatorTickOrCandleSource(_p, IndicatorDataParams::GetInstance(1, TYPE_DOUBLE, _idstype, IDATA_RANGE_RANGE), + _indi_src) {} Indi_DeMarker(ENUM_TIMEFRAMES _tf = PERIOD_CURRENT, int _shift = 0) : IndicatorTickOrCandleSource(INDI_DEMARKER, _tf, _shift) {} diff --git a/Indicators/Indi_Demo.mqh b/Indicators/Indi_Demo.mqh index 3a561463a..7adc7080e 100644 --- a/Indicators/Indi_Demo.mqh +++ b/Indicators/Indi_Demo.mqh @@ -53,9 +53,11 @@ class Indi_Demo : public IndicatorTickOrCandleSource { /** * Class constructor. */ - Indi_Demo(IndiDemoParams &_p, IndicatorData *_indi_src = NULL) + Indi_Demo(IndiDemoParams &_p, ENUM_IDATA_SOURCE_TYPE _idstype = IDATA_BUILTIN, IndicatorData *_indi_src = NULL, + int _indi_src_mode = 0) : IndicatorTickOrCandleSource( - _p, IndicatorDataParams::GetInstance(1, TYPE_DOUBLE, IDATA_BUILTIN, IDATA_RANGE_MIXED), _indi_src){}; + _p, IndicatorDataParams::GetInstance(1, TYPE_DOUBLE, _idstype, IDATA_RANGE_MIXED, _indi_src_mode), + _indi_src){}; Indi_Demo(ENUM_TIMEFRAMES _tf = PERIOD_CURRENT, int _shift = 0) : IndicatorTickOrCandleSource(INDI_DEMO, _tf, _shift){}; diff --git a/Indicators/Indi_DetrendedPrice.mqh b/Indicators/Indi_DetrendedPrice.mqh index 9767ffe23..3271da137 100644 --- a/Indicators/Indi_DetrendedPrice.mqh +++ b/Indicators/Indi_DetrendedPrice.mqh @@ -52,9 +52,10 @@ class Indi_DetrendedPrice : public IndicatorTickOrCandleSource { /** * Class constructor. */ - Indi_Drawer(const IndiDrawerParams &_p, IndicatorData *_indi_src = NULL) - : IndicatorTickOrCandleSource(_p, IndicatorDataParams::GetInstance(0, TYPE_DOUBLE), _indi_src), redis(true) { + Indi_Drawer(const IndiDrawerParams &_p, ENUM_IDATA_SOURCE_TYPE _idstype = IDATA_BUILTIN, + IndicatorData *_indi_src = NULL, int _indi_src_mode = 0) + : IndicatorTickOrCandleSource( + _p, IndicatorDataParams::GetInstance(0, TYPE_DOUBLE, _idstype, IDATA_RANGE_UNKNOWN, _indi_src_mode), + _indi_src), + redis(true) { Init(); } Indi_Drawer(ENUM_TIMEFRAMES _tf = PERIOD_CURRENT, int _shift = 0) diff --git a/Indicators/Indi_Envelopes.mqh b/Indicators/Indi_Envelopes.mqh index 8fc30e78e..431598d19 100644 --- a/Indicators/Indi_Envelopes.mqh +++ b/Indicators/Indi_Envelopes.mqh @@ -91,9 +91,11 @@ class Indi_Envelopes : public IndicatorTickOrCandleSource { /** * Class constructor. */ - Indi_Envelopes(IndiEnvelopesParams &_p, IndicatorData *_indi_src = NULL) + Indi_Envelopes(IndiEnvelopesParams &_p, ENUM_IDATA_SOURCE_TYPE _idstype = IDATA_BUILTIN, + IndicatorData *_indi_src = NULL, int _indi_src_mode = 0) : IndicatorTickOrCandleSource( - _p, IndicatorDataParams::GetInstance(2, TYPE_DOUBLE, IDATA_BUILTIN, IDATA_RANGE_PRICE), _indi_src) { + _p, IndicatorDataParams::GetInstance(2, TYPE_DOUBLE, _idstype, IDATA_RANGE_PRICE, _indi_src_mode), + _indi_src) { Init(); } Indi_Envelopes(ENUM_TIMEFRAMES _tf = PERIOD_CURRENT, int _shift = 0) diff --git a/Indicators/Indi_Force.mqh b/Indicators/Indi_Force.mqh index 83476a19b..0880d6ee3 100644 --- a/Indicators/Indi_Force.mqh +++ b/Indicators/Indi_Force.mqh @@ -70,9 +70,11 @@ class Indi_Force : public IndicatorTickOrCandleSource { /** * Class constructor. */ - Indi_Force(IndiForceParams &_p, IndicatorData *_indi_src = NULL) + Indi_Force(IndiForceParams &_p, ENUM_IDATA_SOURCE_TYPE _idstype = IDATA_BUILTIN, IndicatorData *_indi_src = NULL, + int _indi_src_mode = 0) : IndicatorTickOrCandleSource( - _p, IndicatorDataParams::GetInstance(1, TYPE_DOUBLE, IDATA_BUILTIN, IDATA_RANGE_MIXED), _indi_src) {} + _p, IndicatorDataParams::GetInstance(1, TYPE_DOUBLE, _idstype, IDATA_RANGE_MIXED, _indi_src_mode), + _indi_src) {} Indi_Force(ENUM_TIMEFRAMES _tf = PERIOD_CURRENT, int _shift = 0) : IndicatorTickOrCandleSource(INDI_FORCE, _tf, _shift) {} diff --git a/Indicators/Indi_FractalAdaptiveMA.mqh b/Indicators/Indi_FractalAdaptiveMA.mqh index cf0751685..33a72fb83 100644 --- a/Indicators/Indi_FractalAdaptiveMA.mqh +++ b/Indicators/Indi_FractalAdaptiveMA.mqh @@ -54,9 +54,11 @@ class Indi_FrAMA : public IndicatorTickOrCandleSource { /** * Class constructor. */ - Indi_FrAMA(IndiFrAIndiMAParams &_p, IndicatorData *_indi_src = NULL) + Indi_FrAMA(IndiFrAIndiMAParams &_p, ENUM_IDATA_SOURCE_TYPE _idstype = IDATA_BUILTIN, IndicatorData *_indi_src = NULL, + int _indi_src_mode = 0) : IndicatorTickOrCandleSource( - _p, IndicatorDataParams::GetInstance(1, TYPE_DOUBLE, IDATA_BUILTIN, IDATA_RANGE_MIXED), _indi_src){}; + _p, IndicatorDataParams::GetInstance(1, TYPE_DOUBLE, _idstype, IDATA_RANGE_MIXED, _indi_src_mode), + _indi_src){}; Indi_FrAMA(ENUM_TIMEFRAMES _tf = PERIOD_CURRENT, int _shift = 0) : IndicatorTickOrCandleSource(INDI_FRAMA, _tf, _shift){}; diff --git a/Indicators/Indi_Fractals.mqh b/Indicators/Indi_Fractals.mqh index 2c074b427..f8ab83f3f 100644 --- a/Indicators/Indi_Fractals.mqh +++ b/Indicators/Indi_Fractals.mqh @@ -60,9 +60,10 @@ class Indi_Fractals : public IndicatorTickOrCandleSource { /** * Class constructor. */ - Indi_Fractals(IndiFractalsParams &_p, IndicatorData *_indi_src = NULL) + Indi_Fractals(IndiFractalsParams &_p, IndicatorData *_indi_src = NULL, + ENUM_IDATA_SOURCE_TYPE _idstype = IDATA_BUILTIN) : IndicatorTickOrCandleSource(_p, - IndicatorDataParams::GetInstance(FINAL_LO_UP_LINE_ENTRY, TYPE_DOUBLE, IDATA_BUILTIN, + IndicatorDataParams::GetInstance(FINAL_LO_UP_LINE_ENTRY, TYPE_DOUBLE, _idstype, IDATA_RANGE_PRICE_ON_SIGNAL), _indi_src) { Init(); diff --git a/Indicators/Indi_Gator.mqh b/Indicators/Indi_Gator.mqh index f2f094df3..dd0b06b7a 100644 --- a/Indicators/Indi_Gator.mqh +++ b/Indicators/Indi_Gator.mqh @@ -115,10 +115,11 @@ class Indi_Gator : public IndicatorTickOrCandleSource { /** * Class constructor. */ - Indi_Gator(IndiGatorParams &_p, IndicatorData *_indi_src = NULL) + Indi_Gator(IndiGatorParams &_p, ENUM_IDATA_SOURCE_TYPE _idstype = IDATA_BUILTIN, IndicatorData *_indi_src = NULL, + int _indi_src_mode = 0) : IndicatorTickOrCandleSource(_p, IndicatorDataParams::GetInstance(FINAL_GATOR_LINE_HISTOGRAM_ENTRY, TYPE_DOUBLE, - IDATA_BUILTIN, IDATA_RANGE_MIXED), + _idstype, IDATA_RANGE_MIXED, _indi_src_mode), _indi_src) { Init(); } diff --git a/Indicators/Indi_HeikenAshi.mqh b/Indicators/Indi_HeikenAshi.mqh index 01b823e38..bfc81a69c 100644 --- a/Indicators/Indi_HeikenAshi.mqh +++ b/Indicators/Indi_HeikenAshi.mqh @@ -82,9 +82,10 @@ class Indi_HeikenAshi : public IndicatorTickOrCandleSource /** * Class constructor. */ - Indi_HeikenAshi(IndiHeikenAshiParams &_p, IndicatorData *_indi_src = NULL) + Indi_HeikenAshi(IndiHeikenAshiParams &_p, IndicatorData *_indi_src = NULL, + ENUM_IDATA_SOURCE_TYPE _idstype = IDATA_BUILTIN) : IndicatorTickOrCandleSource( - _p, IndicatorDataParams::GetInstance(FINAL_HA_MODE_ENTRY, TYPE_DOUBLE, IDATA_BUILTIN, IDATA_RANGE_PRICE), + _p, IndicatorDataParams::GetInstance(FINAL_HA_MODE_ENTRY, TYPE_DOUBLE, _idstype, IDATA_RANGE_PRICE), _indi_src) { Init(); } diff --git a/Indicators/Indi_Ichimoku.mqh b/Indicators/Indi_Ichimoku.mqh index 2e2683ced..1a13c9e32 100644 --- a/Indicators/Indi_Ichimoku.mqh +++ b/Indicators/Indi_Ichimoku.mqh @@ -95,9 +95,11 @@ class Indi_Ichimoku : public IndicatorTickOrCandleSource { /** * Class constructor. */ - Indi_Ichimoku(IndiIchimokuParams &_p, IndicatorData *_indi_src = NULL) - : IndicatorTickOrCandleSource(_p, IndicatorDataParams::GetInstance(FINAL_ICHIMOKU_LINE_ENTRY, TYPE_DOUBLE, IDATA_BUILTIN, IDATA_RANGE_PRICE), - _indi_src) { + Indi_Ichimoku(IndiIchimokuParams &_p, IndicatorData *_indi_src = NULL, + ENUM_IDATA_SOURCE_TYPE _idstype = IDATA_BUILTIN) + : IndicatorTickOrCandleSource( + _p, IndicatorDataParams::GetInstance(FINAL_ICHIMOKU_LINE_ENTRY, TYPE_DOUBLE, _idstype, IDATA_RANGE_PRICE), + _indi_src) { Init(); } Indi_Ichimoku(ENUM_TIMEFRAMES _tf = PERIOD_CURRENT, int _shift = 0) diff --git a/Indicators/Indi_Killzones.mqh b/Indicators/Indi_Killzones.mqh index d8a8aada2..53eda21cd 100644 --- a/Indicators/Indi_Killzones.mqh +++ b/Indicators/Indi_Killzones.mqh @@ -96,11 +96,12 @@ class Indi_Killzones : public IndicatorTickOrCandleSource { /** * Class constructor. */ - Indi_Killzones(IndiKillzonesParams &_p, IndicatorData *_indi_src = NULL) - : IndicatorTickOrCandleSource(_p, - IndicatorDataParams::GetInstance(FINAL_INDI_KILLZONES_MODE_ENTRY, TYPE_FLOAT, - IDATA_CHART, IDATA_RANGE_PRICE), - _indi_src) {} + Indi_Killzones(IndiKillzonesParams &_p, IndicatorData *_indi_src = NULL, + ENUM_IDATA_SOURCE_TYPE _idstype = IDATA_CHART) + : IndicatorTickOrCandleSource( + _p, + IndicatorDataParams::GetInstance(FINAL_INDI_KILLZONES_MODE_ENTRY, TYPE_FLOAT, _idstype, IDATA_RANGE_PRICE), + _indi_src) {} Indi_Killzones(ENUM_TIMEFRAMES _tf = PERIOD_CURRENT, int _shift = 0) : IndicatorTickOrCandleSource(INDI_KILLZONES, _tf, _shift) {} diff --git a/Indicators/Indi_MA.mqh b/Indicators/Indi_MA.mqh index 89a23e6e0..c52ef1332 100644 --- a/Indicators/Indi_MA.mqh +++ b/Indicators/Indi_MA.mqh @@ -74,9 +74,11 @@ class Indi_MA : public IndicatorTickSource { /** * Class constructor. */ - Indi_MA(IndiMAParams &_p, IndicatorData *_indi_src = NULL) - : IndicatorTickSource(_p, IndicatorDataParams::GetInstance(1, TYPE_DOUBLE, IDATA_BUILTIN, IDATA_RANGE_PRICE), - _indi_src) {} + Indi_MA(IndiMAParams &_p, ENUM_IDATA_SOURCE_TYPE _idstype = IDATA_BUILTIN, IndicatorData *_indi_src = NULL, + int _indi_src_mode = 0) + : IndicatorTickSource( + _p, IndicatorDataParams::GetInstance(1, TYPE_DOUBLE, _idstype, IDATA_RANGE_PRICE, _indi_src_mode), + _indi_src) {} Indi_MA(ENUM_TIMEFRAMES _tf = PERIOD_CURRENT, int _shift = 0) : IndicatorTickSource(INDI_MA, _tf, _shift) {} /** diff --git a/Indicators/Indi_MACD.mqh b/Indicators/Indi_MACD.mqh index d8c6da7f7..4d9518d64 100644 --- a/Indicators/Indi_MACD.mqh +++ b/Indicators/Indi_MACD.mqh @@ -63,11 +63,12 @@ class Indi_MACD : public IndicatorTickOrCandleSource { /** * Class constructor. */ - Indi_MACD(IndiMACDParams &_p, IndicatorData *_indi_src = NULL) - : IndicatorTickOrCandleSource( - _p, - IndicatorDataParams::GetInstance(FINAL_SIGNAL_LINE_ENTRY, TYPE_DOUBLE, IDATA_BUILTIN, IDATA_RANGE_RANGE), - _indi_src) {} + Indi_MACD(IndiMACDParams &_p, ENUM_IDATA_SOURCE_TYPE _idstype = IDATA_BUILTIN, IndicatorData *_indi_src = NULL, + int _indi_src_mode = 0) + : IndicatorTickOrCandleSource(_p, + IndicatorDataParams::GetInstance(FINAL_SIGNAL_LINE_ENTRY, TYPE_DOUBLE, _idstype, + IDATA_RANGE_RANGE, _indi_src_mode), + _indi_src) {} Indi_MACD(ENUM_TIMEFRAMES _tf = PERIOD_CURRENT, int _shift = 0) : IndicatorTickOrCandleSource(INDI_MACD, _tf, _shift) {} diff --git a/Indicators/Indi_MFI.mqh b/Indicators/Indi_MFI.mqh index 238334d19..2d8b4a800 100644 --- a/Indicators/Indi_MFI.mqh +++ b/Indicators/Indi_MFI.mqh @@ -55,9 +55,11 @@ class Indi_MFI : public IndicatorTickOrCandleSource { /** * Class constructor. */ - Indi_MFI(IndiMFIParams &_p, IndicatorData *_indi_src = NULL) + Indi_MFI(IndiMFIParams &_p, ENUM_IDATA_SOURCE_TYPE _idstype = IDATA_BUILTIN, IndicatorData *_indi_src = NULL, + int _indi_src_mode = 0) : IndicatorTickOrCandleSource( - _p, IndicatorDataParams::GetInstance(1, TYPE_DOUBLE, IDATA_BUILTIN, IDATA_RANGE_RANGE), _indi_src) {} + _p, IndicatorDataParams::GetInstance(1, TYPE_DOUBLE, _idstype, IDATA_RANGE_RANGE, _indi_src_mode), + _indi_src) {} Indi_MFI(ENUM_TIMEFRAMES _tf = PERIOD_CURRENT, int _shift = 0) : IndicatorTickOrCandleSource(INDI_MFI, _tf, _shift) {} /** diff --git a/Indicators/Indi_MassIndex.mqh b/Indicators/Indi_MassIndex.mqh index 95cf7f4e6..2f0dcd364 100644 --- a/Indicators/Indi_MassIndex.mqh +++ b/Indicators/Indi_MassIndex.mqh @@ -54,9 +54,10 @@ class Indi_MassIndex : public IndicatorTickOrCandleSource { /** * Class constructor. */ - Indi_MassIndex(IndiMassIndexParams &_p, IndicatorData *_indi_src = NULL) - : IndicatorTickOrCandleSource( - _p, IndicatorDataParams::GetInstance(1, TYPE_DOUBLE, IDATA_BUILTIN, IDATA_RANGE_MIXED), _indi_src){}; + Indi_MassIndex(IndiMassIndexParams &_p, IndicatorData *_indi_src = NULL, + ENUM_IDATA_SOURCE_TYPE _idstype = IDATA_BUILTIN) + : IndicatorTickOrCandleSource(_p, IndicatorDataParams::GetInstance(1, TYPE_DOUBLE, _idstype, IDATA_RANGE_MIXED), + _indi_src){}; Indi_MassIndex(ENUM_TIMEFRAMES _tf = PERIOD_CURRENT, int _shift = 0) : IndicatorTickOrCandleSource(INDI_MASS_INDEX, _tf, _shift){}; diff --git a/Indicators/Indi_Momentum.mqh b/Indicators/Indi_Momentum.mqh index 0f13c5904..e228e8224 100644 --- a/Indicators/Indi_Momentum.mqh +++ b/Indicators/Indi_Momentum.mqh @@ -65,9 +65,11 @@ class Indi_Momentum : public IndicatorTickOrCandleSource { /** * Class constructor. */ - Indi_Momentum(IndiMomentumParams &_p, IndicatorData *_indi_src = NULL) + Indi_Momentum(IndiMomentumParams &_p, ENUM_IDATA_SOURCE_TYPE _idstype = IDATA_BUILTIN, + IndicatorData *_indi_src = NULL, int _indi_src_mode = 0) : IndicatorTickOrCandleSource( - _p, IndicatorDataParams::GetInstance(1, TYPE_DOUBLE, IDATA_BUILTIN, IDATA_RANGE_MIXED), _indi_src) {} + _p, IndicatorDataParams::GetInstance(1, TYPE_DOUBLE, _idstype, IDATA_RANGE_MIXED, _indi_src_mode), + _indi_src) {} Indi_Momentum(ENUM_TIMEFRAMES _tf = PERIOD_CURRENT, int _shift = 0) : IndicatorTickOrCandleSource(INDI_MOMENTUM, _tf, _shift) {} diff --git a/Indicators/Indi_OBV.mqh b/Indicators/Indi_OBV.mqh index 38ef7d284..7410d831a 100644 --- a/Indicators/Indi_OBV.mqh +++ b/Indicators/Indi_OBV.mqh @@ -62,9 +62,11 @@ class Indi_OBV : public IndicatorTickOrCandleSource { /** * Class constructor. */ - Indi_OBV(IndiOBVParams &_p, IndicatorData *_indi_src = NULL) + Indi_OBV(IndiOBVParams &_p, ENUM_IDATA_SOURCE_TYPE _idstype = IDATA_BUILTIN, IndicatorData *_indi_src = NULL, + int _indi_src_mode = 0) : IndicatorTickOrCandleSource( - _p, IndicatorDataParams::GetInstance(1, TYPE_DOUBLE, IDATA_BUILTIN, IDATA_RANGE_MIXED), _indi_src) {} + _p, IndicatorDataParams::GetInstance(1, TYPE_DOUBLE, _idstype, IDATA_RANGE_MIXED, _indi_src_mode), + _indi_src) {} Indi_OBV(ENUM_TIMEFRAMES _tf = PERIOD_CURRENT, int _shift = 0) : IndicatorTickOrCandleSource(INDI_OBV, _tf, _shift) {} /** diff --git a/Indicators/Indi_OsMA.mqh b/Indicators/Indi_OsMA.mqh index faadb39b6..0a81f2308 100644 --- a/Indicators/Indi_OsMA.mqh +++ b/Indicators/Indi_OsMA.mqh @@ -62,9 +62,11 @@ class Indi_OsMA : public IndicatorTickOrCandleSource { /** * Class constructor. */ - Indi_OsMA(IndiOsMAParams &_p, IndicatorData *_indi_src = NULL) + Indi_OsMA(IndiOsMAParams &_p, ENUM_IDATA_SOURCE_TYPE _idstype = IDATA_BUILTIN, IndicatorData *_indi_src = NULL, + int _indi_src_mode = 0) : IndicatorTickOrCandleSource( - _p, IndicatorDataParams::GetInstance(1, TYPE_DOUBLE, IDATA_BUILTIN, IDATA_RANGE_MIXED), _indi_src) {} + _p, IndicatorDataParams::GetInstance(1, TYPE_DOUBLE, _idstype, IDATA_RANGE_MIXED, _indi_src_mode), + _indi_src) {} Indi_OsMA(ENUM_TIMEFRAMES _tf = PERIOD_CURRENT, int _shift = 0) : IndicatorTickOrCandleSource(INDI_OSMA, _tf, _shift) {} diff --git a/Indicators/Indi_Pivot.mqh b/Indicators/Indi_Pivot.mqh index 6dc65fbd9..e9f98d642 100644 --- a/Indicators/Indi_Pivot.mqh +++ b/Indicators/Indi_Pivot.mqh @@ -56,9 +56,11 @@ class Indi_Pivot : public IndicatorTickOrCandleSource { /** * Class constructor. */ - Indi_Pivot(IndiPivotParams& _p, IndicatorData* _indi_src = NULL) + Indi_Pivot(IndiPivotParams& _p, ENUM_IDATA_SOURCE_TYPE _idstype = IDATA_BUILTIN, IndicatorData* _indi_src = NULL, + int _indi_src_mode = 0) : IndicatorTickOrCandleSource( - _p, IndicatorDataParams::GetInstance(9, TYPE_FLOAT, IDATA_BUILTIN, IDATA_RANGE_MIXED), _indi_src) { + _p, IndicatorDataParams::GetInstance(9, TYPE_FLOAT, _idstype, IDATA_RANGE_MIXED, _indi_src_mode), + _indi_src) { Init(); }; Indi_Pivot(ENUM_TIMEFRAMES _tf = PERIOD_CURRENT, int _shift = 0) diff --git a/Indicators/Indi_PriceChannel.mqh b/Indicators/Indi_PriceChannel.mqh index 23de9a63b..a334c24cc 100644 --- a/Indicators/Indi_PriceChannel.mqh +++ b/Indicators/Indi_PriceChannel.mqh @@ -48,9 +48,10 @@ class Indi_PriceChannel : public IndicatorTickOrCandleSource { /** * Class constructor. */ - Indi_RS(IndiRSParams &_p, IndicatorData *_indi_src = NULL) + Indi_RS(IndiRSParams &_p, ENUM_IDATA_SOURCE_TYPE _idstype = IDATA_MATH, IndicatorData *_indi_src = NULL, + int _indi_src_mode = 0) : IndicatorTickOrCandleSource( - _p, IndicatorDataParams::GetInstance(2, TYPE_DOUBLE, IDATA_MATH, IDATA_RANGE_PRICE_DIFF), _indi_src) { + _p, IndicatorDataParams::GetInstance(2, TYPE_DOUBLE, _idstype, IDATA_RANGE_PRICE_DIFF, _indi_src_mode), + _indi_src) { Init(); }; Indi_RS(ENUM_TIMEFRAMES _tf = PERIOD_CURRENT, int _shift = 0) : IndicatorTickOrCandleSource(INDI_RS, _tf, _shift) { diff --git a/Indicators/Indi_RSI.mqh b/Indicators/Indi_RSI.mqh index 1ccce509e..431d95470 100644 --- a/Indicators/Indi_RSI.mqh +++ b/Indicators/Indi_RSI.mqh @@ -94,9 +94,11 @@ class Indi_RSI : public IndicatorTickOrCandleSource { /** * Class constructor. */ - Indi_RSI(IndiRSIParams &_p, IndicatorData *_indi_src = NULL) + Indi_RSI(IndiRSIParams &_p, ENUM_IDATA_SOURCE_TYPE _idstype = IDATA_BUILTIN, IndicatorData *_indi_src = NULL, + int _indi_src_mode = 0) : IndicatorTickOrCandleSource( - _p, IndicatorDataParams::GetInstance(1, TYPE_DOUBLE, IDATA_BUILTIN, IDATA_RANGE_RANGE), _indi_src) {} + _p, IndicatorDataParams::GetInstance(1, TYPE_DOUBLE, _idstype, IDATA_RANGE_RANGE, _indi_src_mode), + _indi_src) {} Indi_RSI(ENUM_TIMEFRAMES _tf = PERIOD_CURRENT, int _shift = 0) : IndicatorTickOrCandleSource(INDI_RSI, _tf, _shift) {} /** diff --git a/Indicators/Indi_RVI.mqh b/Indicators/Indi_RVI.mqh index c9435bbee..4b1458276 100644 --- a/Indicators/Indi_RVI.mqh +++ b/Indicators/Indi_RVI.mqh @@ -53,11 +53,12 @@ class Indi_RVI : public IndicatorTickOrCandleSource { /** * Class constructor. */ - Indi_RVI(const IndiRVIParams &_p, IndicatorData *_indi_src = NULL) - : IndicatorTickOrCandleSource( - _p, - IndicatorDataParams::GetInstance(FINAL_SIGNAL_LINE_ENTRY, TYPE_DOUBLE, IDATA_BUILTIN, IDATA_RANGE_MIXED), - _indi_src) {} + Indi_RVI(const IndiRVIParams &_p, ENUM_IDATA_SOURCE_TYPE _idstype = IDATA_BUILTIN, IndicatorData *_indi_src = NULL, + int _indi_src_mode = 0) + : IndicatorTickOrCandleSource(_p, + IndicatorDataParams::GetInstance(FINAL_SIGNAL_LINE_ENTRY, TYPE_DOUBLE, _idstype, + IDATA_RANGE_MIXED, _indi_src_mode), + _indi_src) {} Indi_RVI(ENUM_TIMEFRAMES _tf = PERIOD_CURRENT, int _shift = 0) : IndicatorTickOrCandleSource(INDI_RVI, _tf, _shift) {} /** diff --git a/Indicators/Indi_RateOfChange.mqh b/Indicators/Indi_RateOfChange.mqh index aa7c8dcd1..127e3aaa1 100644 --- a/Indicators/Indi_RateOfChange.mqh +++ b/Indicators/Indi_RateOfChange.mqh @@ -51,9 +51,10 @@ class Indi_RateOfChange : public IndicatorTickOrCandleSource { /** * Class constructor. */ - Indi_SAR(IndiSARParams &_p, IndicatorData *_indi_src = NULL) + Indi_SAR(IndiSARParams &_p, ENUM_IDATA_SOURCE_TYPE _idstype = IDATA_BUILTIN, IndicatorData *_indi_src = NULL, + int _indi_src_mode = 0) : IndicatorTickOrCandleSource( - _p, IndicatorDataParams::GetInstance(1, TYPE_DOUBLE, IDATA_BUILTIN, IDATA_RANGE_PRICE), _indi_src) {} + _p, IndicatorDataParams::GetInstance(1, TYPE_DOUBLE, _idstype, IDATA_RANGE_PRICE, _indi_src_mode), + _indi_src) {} Indi_SAR(ENUM_TIMEFRAMES _tf = PERIOD_CURRENT, int _shift = 0) : IndicatorTickOrCandleSource(INDI_SAR, _tf, _shift) {} /** diff --git a/Indicators/Indi_StdDev.mqh b/Indicators/Indi_StdDev.mqh index 0c9ff8cd1..17a7f250e 100644 --- a/Indicators/Indi_StdDev.mqh +++ b/Indicators/Indi_StdDev.mqh @@ -77,9 +77,11 @@ class Indi_StdDev : public IndicatorTickSource { /** * Class constructor. */ - Indi_StdDev(IndiStdDevParams &_p, IndicatorData *_indi_src = NULL) - : IndicatorTickSource(_p, IndicatorDataParams::GetInstance(1, TYPE_DOUBLE, IDATA_BUILTIN, IDATA_RANGE_MIXED), - _indi_src) {} + Indi_StdDev(IndiStdDevParams &_p, ENUM_IDATA_SOURCE_TYPE _idstype = IDATA_BUILTIN, IndicatorData *_indi_src = NULL, + int _indi_src_mode = 0) + : IndicatorTickSource( + _p, IndicatorDataParams::GetInstance(1, TYPE_DOUBLE, _idstype, IDATA_RANGE_MIXED, _indi_src_mode), + _indi_src) {} Indi_StdDev(ENUM_TIMEFRAMES _tf = PERIOD_CURRENT, int _shift = 0) : IndicatorTickSource(INDI_STDDEV, _tf, _shift) {} /** diff --git a/Indicators/Indi_Stochastic.mqh b/Indicators/Indi_Stochastic.mqh index 1851dfe63..3a5ec7444 100644 --- a/Indicators/Indi_Stochastic.mqh +++ b/Indicators/Indi_Stochastic.mqh @@ -66,11 +66,12 @@ class Indi_Stochastic : public IndicatorTickOrCandleSource { /** * Class constructor. */ - Indi_Stochastic(IndiStochParams &_p, IndicatorData *_indi_src = NULL) - : IndicatorTickOrCandleSource( - _p, - IndicatorDataParams::GetInstance(FINAL_SIGNAL_LINE_ENTRY, TYPE_DOUBLE, IDATA_BUILTIN, IDATA_RANGE_RANGE), - _indi_src) {} + Indi_Stochastic(IndiStochParams &_p, ENUM_IDATA_SOURCE_TYPE _idstype = IDATA_BUILTIN, IndicatorData *_indi_src = NULL, + int _indi_src_mode = 0) + : IndicatorTickOrCandleSource(_p, + IndicatorDataParams::GetInstance(FINAL_SIGNAL_LINE_ENTRY, TYPE_DOUBLE, _idstype, + IDATA_RANGE_RANGE, _indi_src_mode), + _indi_src) {} Indi_Stochastic(ENUM_TIMEFRAMES _tf = PERIOD_CURRENT, int _shift = 0) : IndicatorTickOrCandleSource(INDI_STOCHASTIC, _tf, _shift) {} diff --git a/Indicators/Indi_TEMA.mqh b/Indicators/Indi_TEMA.mqh index 597139639..73c71241c 100644 --- a/Indicators/Indi_TEMA.mqh +++ b/Indicators/Indi_TEMA.mqh @@ -54,9 +54,11 @@ class Indi_TEMA : public IndicatorTickOrCandleSource { /** * Class constructor. */ - Indi_TEMA(IndiTEMAParams &_p, IndicatorData *_indi_src = NULL) + Indi_TEMA(IndiTEMAParams &_p, ENUM_IDATA_SOURCE_TYPE _idstype = IDATA_BUILTIN, IndicatorData *_indi_src = NULL, + int _indi_src_mode = 0) : IndicatorTickOrCandleSource( - _p, IndicatorDataParams::GetInstance(1, TYPE_DOUBLE, IDATA_BUILTIN, IDATA_RANGE_MIXED), _indi_src){}; + _p, IndicatorDataParams::GetInstance(1, TYPE_DOUBLE, _idstype, IDATA_RANGE_MIXED, _indi_src_mode), + _indi_src){}; Indi_TEMA(ENUM_TIMEFRAMES _tf = PERIOD_CURRENT, int _shift = 0) : IndicatorTickOrCandleSource(INDI_TEMA, _tf, _shift){}; diff --git a/Indicators/Indi_TRIX.mqh b/Indicators/Indi_TRIX.mqh index 862d267e2..c8be21d65 100644 --- a/Indicators/Indi_TRIX.mqh +++ b/Indicators/Indi_TRIX.mqh @@ -52,9 +52,11 @@ class Indi_TRIX : public IndicatorTickOrCandleSource { /** * Class constructor. */ - Indi_TRIX(IndiTRIXParams &_p, IndicatorData *_indi_src = NULL) + Indi_TRIX(IndiTRIXParams &_p, ENUM_IDATA_SOURCE_TYPE _idstype = IDATA_BUILTIN, IndicatorData *_indi_src = NULL, + int _indi_src_mode = 0) : IndicatorTickOrCandleSource( - _p, IndicatorDataParams::GetInstance(1, TYPE_DOUBLE, IDATA_BUILTIN, IDATA_RANGE_MIXED), _indi_src){}; + _p, IndicatorDataParams::GetInstance(1, TYPE_DOUBLE, _idstype, IDATA_RANGE_MIXED, _indi_src_mode), + _indi_src){}; Indi_TRIX(ENUM_TIMEFRAMES _tf = PERIOD_CURRENT, int _shift = 0) : IndicatorTickOrCandleSource(INDI_TRIX, _tf, _shift){}; diff --git a/Indicators/Indi_UltimateOscillator.mqh b/Indicators/Indi_UltimateOscillator.mqh index 33b6c2576..3ffbc420a 100644 --- a/Indicators/Indi_UltimateOscillator.mqh +++ b/Indicators/Indi_UltimateOscillator.mqh @@ -66,9 +66,10 @@ class Indi_UltimateOscillator : public IndicatorTickOrCandleSource { /** * Class constructor. */ - Indi_VIDYA(IndiVIDYAParams &_p, IndicatorData *_indi_src = NULL) + Indi_VIDYA(IndiVIDYAParams &_p, ENUM_IDATA_SOURCE_TYPE _idstype = IDATA_BUILTIN, IndicatorData *_indi_src = NULL, + int _indi_src_mode = 0) : IndicatorTickOrCandleSource( - _p, IndicatorDataParams::GetInstance(1, TYPE_DOUBLE, IDATA_BUILTIN, IDATA_RANGE_MIXED), _indi_src){}; + _p, IndicatorDataParams::GetInstance(1, TYPE_DOUBLE, _idstype, IDATA_RANGE_MIXED, _indi_src_mode), + _indi_src){}; Indi_VIDYA(ENUM_TIMEFRAMES _tf = PERIOD_CURRENT, int _shift = 0) : IndicatorTickOrCandleSource(INDI_VIDYA, _tf, _shift){}; diff --git a/Indicators/Indi_VROC.mqh b/Indicators/Indi_VROC.mqh index 468ec8b53..98433c611 100644 --- a/Indicators/Indi_VROC.mqh +++ b/Indicators/Indi_VROC.mqh @@ -51,9 +51,11 @@ class Indi_VROC : public IndicatorTickOrCandleSource { /** * Class constructor. */ - Indi_VROC(IndiVROCParams &_p, IndicatorData *_indi_src = NULL) + Indi_VROC(IndiVROCParams &_p, ENUM_IDATA_SOURCE_TYPE _idstype = IDATA_BUILTIN, IndicatorData *_indi_src = NULL, + int _indi_src_mode = 0) : IndicatorTickOrCandleSource( - _p, IndicatorDataParams::GetInstance(1, TYPE_DOUBLE, IDATA_BUILTIN, IDATA_RANGE_MIXED), _indi_src){}; + _p, IndicatorDataParams::GetInstance(1, TYPE_DOUBLE, _idstype, IDATA_RANGE_MIXED, _indi_src_mode), + _indi_src){}; Indi_VROC(ENUM_TIMEFRAMES _tf = PERIOD_CURRENT, int _shift = 0) : IndicatorTickOrCandleSource(INDI_VROC, _tf, _shift){}; diff --git a/Indicators/Indi_Volumes.mqh b/Indicators/Indi_Volumes.mqh index 0db8a7745..46a12532c 100644 --- a/Indicators/Indi_Volumes.mqh +++ b/Indicators/Indi_Volumes.mqh @@ -48,9 +48,11 @@ class Indi_Volumes : public IndicatorTickOrCandleSource { /** * Class constructor. */ - Indi_Volumes(IndiVolumesParams &_p, IndicatorData *_indi_src = NULL) + Indi_Volumes(IndiVolumesParams &_p, ENUM_IDATA_SOURCE_TYPE _idstype = IDATA_BUILTIN, IndicatorData *_indi_src = NULL, + int _indi_src_mode = 0) : IndicatorTickOrCandleSource( - _p, IndicatorDataParams::GetInstance(2, TYPE_DOUBLE, IDATA_BUILTIN, IDATA_RANGE_MIXED), _indi_src){}; + _p, IndicatorDataParams::GetInstance(2, TYPE_DOUBLE, _idstype, IDATA_RANGE_MIXED, _indi_src_mode), + _indi_src){}; Indi_Volumes(ENUM_TIMEFRAMES _tf = PERIOD_CURRENT, int _shift = 0) : IndicatorTickOrCandleSource(INDI_VOLUMES, _tf, _shift){}; diff --git a/Indicators/Indi_WPR.mqh b/Indicators/Indi_WPR.mqh index 1d872a618..f53c655ec 100644 --- a/Indicators/Indi_WPR.mqh +++ b/Indicators/Indi_WPR.mqh @@ -53,9 +53,11 @@ class Indi_WPR : public IndicatorTickOrCandleSource { /** * Class constructor. */ - Indi_WPR(IndiWPRParams &_p, IndicatorData *_indi_src = NULL) + Indi_WPR(IndiWPRParams &_p, ENUM_IDATA_SOURCE_TYPE _idstype = IDATA_BUILTIN, IndicatorData *_indi_src = NULL, + int _indi_src_mode = 0) : IndicatorTickOrCandleSource( - _p, IndicatorDataParams::GetInstance(1, TYPE_DOUBLE, IDATA_BUILTIN, IDATA_RANGE_RANGE), _indi_src) {} + _p, IndicatorDataParams::GetInstance(1, TYPE_DOUBLE, _idstype, IDATA_RANGE_RANGE, _indi_src_mode), + _indi_src) {} Indi_WPR(ENUM_TIMEFRAMES _tf = PERIOD_CURRENT, int _shift = 0) : IndicatorTickOrCandleSource(INDI_WPR, _tf, _shift) {} /** diff --git a/Indicators/Indi_WilliamsAD.mqh b/Indicators/Indi_WilliamsAD.mqh index 43e8cc399..a309a9d84 100644 --- a/Indicators/Indi_WilliamsAD.mqh +++ b/Indicators/Indi_WilliamsAD.mqh @@ -46,9 +46,10 @@ class Indi_WilliamsAD : public IndicatorTickOrCandleSource /** * Class constructor. */ - Indi_WilliamsAD(IndiWilliamsADParams &_p, IndicatorData *_indi_src = NULL) - : IndicatorTickOrCandleSource( - _p, IndicatorDataParams::GetInstance(1, TYPE_DOUBLE, IDATA_BUILTIN, IDATA_RANGE_MIXED), _indi_src){}; + Indi_WilliamsAD(IndiWilliamsADParams &_p, IndicatorData *_indi_src = NULL, + ENUM_IDATA_SOURCE_TYPE _idstype = IDATA_BUILTIN) + : IndicatorTickOrCandleSource(_p, IndicatorDataParams::GetInstance(1, TYPE_DOUBLE, _idstype, IDATA_RANGE_MIXED), + _indi_src){}; Indi_WilliamsAD(ENUM_TIMEFRAMES _tf = PERIOD_CURRENT, int _shift = 0) : IndicatorTickOrCandleSource(INDI_WILLIAMS_AD, _tf, _shift){}; diff --git a/Indicators/Indi_ZigZag.mqh b/Indicators/Indi_ZigZag.mqh index 59f7df91e..ad6effa22 100644 --- a/Indicators/Indi_ZigZag.mqh +++ b/Indicators/Indi_ZigZag.mqh @@ -59,10 +59,11 @@ class Indi_ZigZag : public IndicatorTickOrCandleSource { /** * Class constructor. */ - Indi_ZigZag(IndiZigZagParams &_p, IndicatorData *_indi_src = NULL) + Indi_ZigZag(IndiZigZagParams &_p, ENUM_IDATA_SOURCE_TYPE _idstype = IDATA_BUILTIN, IndicatorData *_indi_src = NULL, + int _indi_src_mode = 0) : IndicatorTickOrCandleSource(_p, - IndicatorDataParams::GetInstance(FINAL_ZIGZAG_LINE_ENTRY, TYPE_DOUBLE, - IDATA_BUILTIN, IDATA_RANGE_PRICE_ON_SIGNAL), + IndicatorDataParams::GetInstance(FINAL_ZIGZAG_LINE_ENTRY, TYPE_DOUBLE, _idstype, + IDATA_RANGE_PRICE_ON_SIGNAL), _indi_src) {} Indi_ZigZag(ENUM_TIMEFRAMES _tf = PERIOD_CURRENT, int _shift = 0) : IndicatorTickOrCandleSource(INDI_ZIGZAG, _tf, _shift) {} diff --git a/Indicators/Indi_ZigZagColor.mqh b/Indicators/Indi_ZigZagColor.mqh index cad1f31db..b26bd861b 100644 --- a/Indicators/Indi_ZigZagColor.mqh +++ b/Indicators/Indi_ZigZagColor.mqh @@ -56,10 +56,10 @@ class Indi_ZigZagColor : public IndicatorTickOrCandleSource { /** * Class constructor. */ - Indi_OHLC(IndiOHLCParams &_p, IndicatorData *_indi_src = NULL) - : IndicatorTickOrCandleSource(_p, IndicatorDataParams::GetInstance(FINAL_INDI_OHLC_MODE_ENTRY, TYPE_DOUBLE), + Indi_OHLC(IndiOHLCParams &_p, ENUM_IDATA_SOURCE_TYPE _idstype = IDATA_BUILTIN, IndicatorData *_indi_src = NULL, + int _indi_src_mode = 0) + : IndicatorTickOrCandleSource(_p, + IndicatorDataParams::GetInstance(FINAL_INDI_OHLC_MODE_ENTRY, TYPE_DOUBLE, _idstype, + IDATA_RANGE_PRICE, _indi_src_mode), _indi_src){}; Indi_OHLC(ENUM_TIMEFRAMES _tf = PERIOD_CURRENT, int _shift = 0) : IndicatorTickOrCandleSource(INDI_PRICE, _tf, _shift){}; diff --git a/Indicators/Price/Indi_Price.mqh b/Indicators/Price/Indi_Price.mqh index 827381fb6..e8a97a0c6 100644 --- a/Indicators/Price/Indi_Price.mqh +++ b/Indicators/Price/Indi_Price.mqh @@ -50,8 +50,11 @@ class Indi_Price : public IndicatorTickOrCandleSource { /** * Class constructor. */ - Indi_Price(PriceIndiParams &_p, IndicatorData *_indi_src = NULL) - : IndicatorTickOrCandleSource(_p, IndicatorDataParams::GetInstance(1, TYPE_DOUBLE), _indi_src){}; + Indi_Price(PriceIndiParams &_p, ENUM_IDATA_SOURCE_TYPE _idstype = IDATA_BUILTIN, IndicatorData *_indi_src = NULL, + int _indi_src_mode = 0) + : IndicatorTickOrCandleSource( + _p, IndicatorDataParams::GetInstance(1, TYPE_DOUBLE, _idstype, IDATA_RANGE_PRICE, _indi_src_mode), + _indi_src){}; Indi_Price(ENUM_TIMEFRAMES _tf = PERIOD_CURRENT, int _shift = 0) : IndicatorTickOrCandleSource(INDI_PRICE, _tf, _shift){}; diff --git a/Indicators/Special/Indi_Custom.mqh b/Indicators/Special/Indi_Custom.mqh index cfd0101e9..c23a3c19f 100644 --- a/Indicators/Special/Indi_Custom.mqh +++ b/Indicators/Special/Indi_Custom.mqh @@ -33,7 +33,7 @@ #endif // Includes. -#include "../../Indicator.mqh" +#include "../../Indicator/IndicatorTickOrCandleSource.h" // Structs. @@ -73,14 +73,18 @@ struct IndiCustomParams : public IndicatorParams { /** * Implements indicator class. */ -class Indi_Custom : public Indicator { +class Indi_Custom : public IndicatorTickOrCandleSource { public: /** * Class constructor. */ - Indi_Custom(IndiCustomParams &_p, IndicatorData *_indi_src = NULL) - : Indicator(_p, IndicatorDataParams::GetInstance(1, TYPE_DOUBLE, IDATA_ICUSTOM), _indi_src) {} - Indi_Custom(ENUM_TIMEFRAMES _tf = PERIOD_CURRENT) : Indicator(INDI_CUSTOM, _tf){}; + Indi_Custom(IndiCustomParams &_p, ENUM_IDATA_SOURCE_TYPE _idstype = IDATA_ICUSTOM, IndicatorData *_indi_src = NULL, + int _indi_src_mode = 0) + : IndicatorTickOrCandleSource( + _p, IndicatorDataParams::GetInstance(1, TYPE_DOUBLE, _idstype, IDATA_RANGE_UNKNOWN, _indi_src_mode), + _indi_src) {} + Indi_Custom(ENUM_TIMEFRAMES _tf = PERIOD_CURRENT, int _shift = 0) + : IndicatorTickOrCandleSource(INDI_CUSTOM, _tf, _shift){}; /** * Returns the indicator's value. diff --git a/Indicators/Special/Indi_Math.mqh b/Indicators/Special/Indi_Math.mqh index 4ed2aad41..dcf43f01b 100644 --- a/Indicators/Special/Indi_Math.mqh +++ b/Indicators/Special/Indi_Math.mqh @@ -82,9 +82,11 @@ class Indi_Math : public IndicatorTickOrCandleSource { /** * Class constructor. */ - Indi_Math(IndiMathParams &_p, IndicatorData *_indi_src = NULL) + Indi_Math(IndiMathParams &_p, ENUM_IDATA_SOURCE_TYPE _idstype = IDATA_INDICATOR, IndicatorData *_indi_src = NULL, + int _indi_src_mode = 0) : IndicatorTickOrCandleSource( - _p, IndicatorDataParams::GetInstance(1, TYPE_DOUBLE, IDATA_INDICATOR, IDATA_RANGE_MIXED), _indi_src){}; + _p, IndicatorDataParams::GetInstance(1, TYPE_DOUBLE, _idstype, IDATA_RANGE_MIXED, _indi_src_mode), + _indi_src){}; Indi_Math(ENUM_TIMEFRAMES _tf = PERIOD_CURRENT, int _shift = 0) : IndicatorTickOrCandleSource(INDI_SPECIAL_MATH, _tf, _shift){}; diff --git a/Indicators/Tick/Indi_TickMt.mqh b/Indicators/Tick/Indi_TickMt.mqh index 20c0fe906..8b1b39d4a 100644 --- a/Indicators/Tick/Indi_TickMt.mqh +++ b/Indicators/Tick/Indi_TickMt.mqh @@ -52,8 +52,10 @@ class Indi_TickMt : public IndicatorTick { /** * Class constructor. */ - Indi_TickMt(IndiTickMtParams &_p, IndicatorData *_indi_src = NULL) - : IndicatorTick(_p, IndicatorDataParams::GetInstance(3, TYPE_DOUBLE), _indi_src){}; + Indi_TickMt(IndiTickMtParams &_p, ENUM_IDATA_SOURCE_TYPE _idstype = IDATA_BUILTIN, IndicatorData *_indi_src = NULL, + int _indi_src_mode = 0) + : IndicatorTick(_p, IndicatorDataParams::GetInstance(3, TYPE_DOUBLE, _idstype), + _indi_src){}; Indi_TickMt(ENUM_TIMEFRAMES _tf = PERIOD_CURRENT, int _shift = 0, string _name = "") : IndicatorTick(INDI_TICK, _tf, _shift, _name) {} diff --git a/tests/IndicatorsTest.mq5 b/tests/IndicatorsTest.mq5 index d37403b81..6ec22c545 100644 --- a/tests/IndicatorsTest.mq5 +++ b/tests/IndicatorsTest.mq5 @@ -177,9 +177,11 @@ bool InitIndicators() { indis.Push(indi_bands); // Bollinger Bands over RSI. + /* @todo: Convert into new syntax. IndiBandsParams bands_over_rsi_params(20, 2, 0, PRICE_OPEN); // bands_over_rsi_params.SetDataSource(INDI_RSI); indis.Push(new Indi_Bands(bands_over_rsi_params)); + */ // Bears Power. IndiBearsPowerParams bears_params(13, PRICE_CLOSE); @@ -263,9 +265,11 @@ bool InitIndicators() { indis.Push(new Indi_RSI(rsi_params)); // Relative Strength Index (RSI). + /* @todo: Convert into new syntax. IndiRSIParams rsi_over_blt_stddev_params(); // rsi_over_blt_stddev_params.SetDataSource(INDI_STDDEV); indis.Push(new Indi_RSI(rsi_over_blt_stddev_params)); + */ // Relative Vigor Index (RVI). IndiRVIParams rvi_params(14); @@ -284,8 +288,7 @@ bool InitIndicators() { IndiStdDevParams stddev_on_price_params(); stddev_on_price_params.SetDraw(clrBlue, 1); - Ref indi_stddev_on_price = new Indi_StdDev(stddev_on_price_params); - indi_stddev_on_price.Ptr().SetDataSource(indi_price_for_stdev.Ptr(), PRICE_OPEN); + Ref indi_stddev_on_price = new Indi_StdDev(stddev_on_price_params, IDATA_BUILTIN, indi_price_for_stdev.Ptr()); indis.Push(indi_stddev_on_price.Ptr()); // Stochastic Oscillator. @@ -316,8 +319,7 @@ bool InitIndicators() { Ref indi_price_4_bands = new Indi_Price(price_params_4_bands); IndiBandsParams bands_on_price_params(); bands_on_price_params.SetDraw(clrCadetBlue); - Ref indi_bands_on_price = new Indi_Bands(bands_on_price_params); - indi_bands_on_price.Ptr().SetDataSource(indi_price_4_bands.Ptr()); + Ref indi_bands_on_price = new Indi_Bands(bands_on_price_params, IDATA_BUILTIN, indi_price_4_bands.Ptr()); indis.Push(indi_bands_on_price.Ptr()); // Standard Deviation (StdDev) over MA(SMA). @@ -329,8 +331,7 @@ bool InitIndicators() { IndiStdDevParams stddev_params_on_ma_sma(13, 10); stddev_params_on_ma_sma.SetDraw(true, 1); - Ref indi_stddev_on_ma_sma = new Indi_StdDev(stddev_params_on_ma_sma); - indi_stddev_on_ma_sma.Ptr().SetDataSource(indi_ma_sma_for_stddev.Ptr()); + Ref indi_stddev_on_ma_sma = new Indi_StdDev(stddev_params_on_ma_sma, IDATA_BUILTIN, indi_ma_sma_for_stddev.Ptr()); indis.Push(indi_stddev_on_ma_sma.Ptr()); // Standard Deviation (StdDev) in SMA mode over Price. @@ -339,8 +340,7 @@ bool InitIndicators() { IndiStdDevParams stddev_sma_on_price_params(); stddev_sma_on_price_params.SetDraw(true, 1); - Ref indi_stddev_on_sma = new Indi_StdDev(stddev_sma_on_price_params); - indi_stddev_on_sma.Ptr().SetDataSource(indi_price_for_stddev_sma.Ptr()); + Ref indi_stddev_on_sma = new Indi_StdDev(stddev_sma_on_price_params, IDATA_BUILTIN, indi_price_for_stddev_sma.Ptr()); indis.Push(indi_stddev_on_sma.Ptr()); // Moving Average (MA) over Price indicator. @@ -349,8 +349,7 @@ bool InitIndicators() { IndiMAParams ma_on_price_params(13, 0, MODE_SMA, PRICE_OPEN, 0); ma_on_price_params.SetDraw(clrYellowGreen); ma_on_price_params.SetIndicatorType(INDI_MA_ON_PRICE); - Ref indi_ma_on_price = new Indi_MA(ma_on_price_params); - indi_ma_on_price.Ptr().SetDataSource(indi_price_4_ma.Ptr()); + Ref indi_ma_on_price = new Indi_MA(ma_on_price_params, IDATA_BUILTIN, indi_price_4_ma.Ptr()); indis.Push(indi_ma_on_price.Ptr()); // Commodity Channel Index (CCI) over Price indicator. @@ -358,8 +357,7 @@ bool InitIndicators() { Ref indi_price_4_cci = new Indi_Price(price_params_4_cci); IndiCCIParams cci_on_price_params(); cci_on_price_params.SetDraw(clrYellowGreen, 1); - Ref indi_cci_on_price = new Indi_CCI(cci_on_price_params); - indi_cci_on_price.Ptr().SetDataSource(indi_price_4_cci.Ptr()); + Ref indi_cci_on_price = new Indi_CCI(cci_on_price_params, IDATA_BUILTIN, indi_price_4_cci.Ptr()); indis.Push(indi_cci_on_price.Ptr()); // Envelopes over Price indicator. @@ -367,8 +365,7 @@ bool InitIndicators() { Ref indi_price_4_envelopes = new Indi_Price(price_params_4_envelopes); IndiEnvelopesParams env_on_price_params(); env_on_price_params.SetDraw(clrBrown); - Ref indi_envelopes_on_price = new Indi_Envelopes(env_on_price_params); - indi_envelopes_on_price.Ptr().SetDataSource(indi_price_4_envelopes.Ptr()); + Ref indi_envelopes_on_price = new Indi_Envelopes(env_on_price_params, IDATA_BUILTIN, indi_price_4_envelopes.Ptr()); indis.Push(indi_envelopes_on_price.Ptr()); // DEMA over Price indicator. @@ -376,16 +373,14 @@ bool InitIndicators() { Ref indi_price_4_dema = new Indi_Price(price_params_4_dema); IndiDEIndiMAParams dema_on_price_params(13, 2, PRICE_OPEN); dema_on_price_params.SetDraw(clrRed); - Ref indi_dema_on_price = new Indi_DEMA(dema_on_price_params); - indi_dema_on_price.Ptr().SetDataSource(indi_price_4_dema.Ptr()); + Ref indi_dema_on_price = new Indi_DEMA(dema_on_price_params, IDATA_BUILTIN, indi_price_4_dema.Ptr()); indis.Push(indi_dema_on_price.Ptr()); // Momentum over Price indicator. Ref indi_price_4_momentum = new Indi_Price(); IndiMomentumParams mom_on_price_params(); mom_on_price_params.SetDraw(clrDarkCyan); - Ref indi_momentum_on_price = new Indi_Momentum(mom_on_price_params); - indi_momentum_on_price.Ptr().SetDataSource(indi_price_4_momentum.Ptr(), 0); + Ref indi_momentum_on_price = new Indi_Momentum(mom_on_price_params, IDATA_BUILTIN, indi_price_4_momentum.Ptr()); indis.Push(indi_momentum_on_price.Ptr()); // Relative Strength Index (RSI) over Price indicator. @@ -393,26 +388,22 @@ bool InitIndicators() { Ref indi_price_4_rsi = new Indi_Price(price_params_4_rsi); IndiRSIParams rsi_on_price_params(); rsi_on_price_params.SetDraw(clrBisque, 1); - Ref indi_rsi_on_price = new Indi_RSI(rsi_on_price_params); - indi_rsi_on_price.Ptr().SetDataSource(indi_price_4_rsi.Ptr()); + Ref indi_rsi_on_price = new Indi_RSI(rsi_on_price_params, IDATA_BUILTIN, indi_price_4_rsi.Ptr()); indis.Push(indi_rsi_on_price.Ptr()); - // Drawer (socket-based) indicator over RSI over Price. #ifndef __MQL4__ // @fixme: Fix it for MQL4. + // Drawer (socket-based) indicator over RSI over Price. IndiDrawerParams drawer_params(14, /*unused*/ PRICE_OPEN); drawer_params.SetDraw(clrBisque, 0); - // drawer_params.SetMaxModes(rsi_on_price_params.GetMaxModes()); - Ref indi_drawer_on_rsi = new Indi_Drawer(drawer_params); - indi_drawer_on_rsi.Ptr().SetDataSource(indi_rsi_on_price.Ptr(), PRICE_OPEN); + Ref indi_drawer_on_rsi = new Indi_Drawer(drawer_params, IDATA_BUILTIN, indi_rsi_on_price.Ptr()); indis.Push(indi_drawer_on_rsi.Ptr()); #endif // Applied Price over OHCL indicator. IndiAppliedPriceParams applied_price_params(); applied_price_params.SetDraw(clrAquamarine, 0); - IndiOHLCParams applied_price_ohlc_params; - Ref indi_applied_price_on_price = new Indi_AppliedPrice(applied_price_params); - indi_applied_price_on_price.Ptr().SetDataSource(new Indi_OHLC(applied_price_ohlc_params), PRICE_TYPICAL); + IndiOHLCParams applied_price_ohlc_params(PRICE_TYPICAL); + Ref indi_applied_price_on_price = new Indi_AppliedPrice(applied_price_params, IDATA_INDICATOR, new Indi_OHLC(applied_price_ohlc_params)); indis.Push(indi_applied_price_on_price.Ptr()); // ADXW. @@ -523,16 +514,14 @@ bool InitIndicators() { IndiMathParams math_params(MATH_OP_SUB, BAND_UPPER, BAND_LOWER, 0, 0); math_params.SetDraw(clrBlue); math_params.SetName("Bands(UP - LO)"); - Ref indi_math_1 = new Indi_Math(math_params); - indi_math_1.Ptr().SetDataSource(indi_bands.Ptr(), 0); + Ref indi_math_1 = new Indi_Math(math_params, IDATA_INDICATOR, indi_bands.Ptr()); indis.Push(indi_math_1.Ptr()); // Math (specialized indicator) via custom math method. IndiMathParams math_custom_params(MathCustomOp, BAND_UPPER, BAND_LOWER, 0, 0); math_custom_params.SetDraw(clrBeige); math_custom_params.SetName("Bands(Custom math fn)"); - Ref indi_math_2 = new Indi_Math(math_custom_params); - indi_math_2.Ptr().SetDataSource(indi_bands.Ptr(), 0); + Ref indi_math_2 = new Indi_Math(math_custom_params, IDATA_INDICATOR, indi_bands.Ptr()); indis.Push(indi_math_2.Ptr()); // RS (Math-based) indicator.