diff --git a/Indicators/Indi_AMA.mqh b/Indicators/Indi_AMA.mqh index 76daa7318..a50e2fff6 100644 --- a/Indicators/Indi_AMA.mqh +++ b/Indicators/Indi_AMA.mqh @@ -145,7 +145,7 @@ class Indi_AMA : public Indicator { /** * OnInit() method for AMA indicator. */ - static void CalculateInit(int InpPeriodAMA, int InpFastPeriodEMA, int InpSlowPeriodEMA, int InpShiftAMA, + static void CalculateInit(int InpPeriodAMA, int _period_fast_ema, int _period_slow_ema, int _ishift_ama, double &ExtFastSC, double &ExtSlowSC, int &ExtPeriodAMA, int &ExtSlowPeriodEMA, int &ExtFastPeriodEMA) { // Check for input values. @@ -156,20 +156,20 @@ class Indi_AMA : public Indicator { InpPeriodAMA, ExtPeriodAMA); } else ExtPeriodAMA = InpPeriodAMA; - if (InpSlowPeriodEMA <= 0) { + if (_period_slow_ema <= 0) { ExtSlowPeriodEMA = 30; PrintFormat( - "Input parameter InpSlowPeriodEMA has incorrect value (%d). Indicator will use value %d for calculations.", - InpSlowPeriodEMA, ExtSlowPeriodEMA); + "Input parameter _period_slow_ema has incorrect value (%d). Indicator will use value %d for calculations.", + _period_slow_ema, ExtSlowPeriodEMA); } else - ExtSlowPeriodEMA = InpSlowPeriodEMA; - if (InpFastPeriodEMA <= 0) { + ExtSlowPeriodEMA = _period_slow_ema; + if (_period_fast_ema <= 0) { ExtFastPeriodEMA = 2; PrintFormat( - "Input parameter InpFastPeriodEMA has incorrect value (%d). Indicator will use value %d for calculations.", - InpFastPeriodEMA, ExtFastPeriodEMA); + "Input parameter _period_fast_ema has incorrect value (%d). Indicator will use value %d for calculations.", + _period_fast_ema, ExtFastPeriodEMA); } else - ExtFastPeriodEMA = InpFastPeriodEMA; + ExtFastPeriodEMA = _period_fast_ema; // Calculate ExtFastSC & ExtSlowSC. ExtFastSC = 2.0 / (ExtFastPeriodEMA + 1.0); @@ -180,14 +180,14 @@ class Indi_AMA : public Indicator { * OnCalculate() method for AMA indicator. */ static int Calculate(INDICATOR_CALCULATE_METHOD_PARAMS_SHORT, ValueStorage &ExtAMABuffer, int InpPeriodAMA, - int InpFastPeriodEMA, int InpSlowPeriodEMA, int InpShiftAMA) { + int _period_fast_ema, int _period_slow_ema, int _ishift_ama) { double ExtFastSC; double ExtSlowSC; int ExtPeriodAMA; int ExtSlowPeriodEMA; int ExtFastPeriodEMA; - CalculateInit(InpPeriodAMA, InpFastPeriodEMA, InpSlowPeriodEMA, InpShiftAMA, ExtFastSC, ExtSlowSC, ExtPeriodAMA, + CalculateInit(InpPeriodAMA, _period_fast_ema, _period_slow_ema, _ishift_ama, ExtFastSC, ExtSlowSC, ExtPeriodAMA, ExtSlowPeriodEMA, ExtFastPeriodEMA); int i; // Check for rates count. diff --git a/Indicators/Indi_FractalAdaptiveMA.mqh b/Indicators/Indi_FractalAdaptiveMA.mqh index 5ddbed457..d7d783a08 100644 --- a/Indicators/Indi_FractalAdaptiveMA.mqh +++ b/Indicators/Indi_FractalAdaptiveMA.mqh @@ -144,7 +144,7 @@ class Indi_FrAMA : public Indicator { } static int Calculate(INDICATOR_CALCULATE_METHOD_PARAMS_LONG, ValueStorage &FrAmaBuffer, int InpPeriodFrAMA, - int InpShift, ENUM_APPLIED_PRICE InpAppliedPrice) { + int _ishift, ENUM_APPLIED_PRICE _applied_price) { if (rates_total < 2 * InpPeriodFrAMA) return (0); int start, i; @@ -152,7 +152,7 @@ class Indi_FrAMA : public Indicator { if (prev_calculated == 0) { start = 2 * InpPeriodFrAMA - 1; for (i = 0; i <= start; i++) - FrAmaBuffer[i] = AppliedPriceValueStorage::GetApplied(open, high, low, close, i, InpAppliedPrice); + FrAmaBuffer[i] = AppliedPriceValueStorage::GetApplied(open, high, low, close, i, _applied_price); } else start = prev_calculated - 1; @@ -170,7 +170,7 @@ class Indi_FrAMA : public Indicator { double n3 = (hi3 - lo3) / (2 * InpPeriodFrAMA); double d = (MathLog(n1 + n2) - MathLog(n3)) / math_log_2; double alfa = MathExp(-4.6 * (d - 1.0)); - double _iprice = AppliedPriceValueStorage::GetApplied(open, high, low, close, i, InpAppliedPrice); + double _iprice = AppliedPriceValueStorage::GetApplied(open, high, low, close, i, _applied_price); FrAmaBuffer[i] = alfa * _iprice + (1 - alfa) * FrAmaBuffer[i - 1].Get(); } diff --git a/Indicators/Indi_MA.mqh b/Indicators/Indi_MA.mqh index 2f1a7ec69..6a796a9b0 100644 --- a/Indicators/Indi_MA.mqh +++ b/Indicators/Indi_MA.mqh @@ -267,23 +267,23 @@ class Indi_MA : public Indicator { * Calculates Simple Moving Average (SMA). The same as in "Example Moving Average" indicator. */ static void CalculateSimpleMA(int rates_total, int prev_calculated, int begin, ValueStorage &price, - ValueStorage &ExtLineBuffer, int _ma_period) { + ValueStorage &_line_buff, int _ma_period) { int i, start; // First calculation or number of bars was changed. if (prev_calculated == 0) { start = _ma_period + begin; // Set empty value for first start bars. - for (i = 0; i < start - 1; i++) ExtLineBuffer[i] = 0.0; + for (i = 0; i < start - 1; i++) _line_buff[i] = 0.0; // Calculate first visible value. double first_value = 0; for (i = begin; i < start; i++) first_value += price[i].Get(); first_value /= _ma_period; - ExtLineBuffer[start - 1] = first_value; + _line_buff[start - 1] = first_value; } else start = prev_calculated - 1; // Main loop. for (i = start; i < rates_total && !IsStopped(); i++) { - ExtLineBuffer[i] = ExtLineBuffer[i - 1] + (price[i] - price[i - _ma_period]) / _ma_period; + _line_buff[i] = _line_buff[i - 1] + (price[i] - price[i - _ma_period]) / _ma_period; } } @@ -291,21 +291,21 @@ class Indi_MA : public Indicator { * Calculates Exponential Moving Average (EMA). The same as in "Example Moving Average" indicator. */ static void CalculateEMA(int rates_total, int prev_calculated, int begin, ValueStorage &price, - ValueStorage &ExtLineBuffer, int _ma_period) { + ValueStorage &_line_buff, int _ma_period) { int i, limit; double SmoothFactor = 2.0 / (1.0 + _ma_period); // First calculation or number of bars was changed. if (prev_calculated == 0) { limit = _ma_period + begin; - ExtLineBuffer[begin] = price[begin]; + _line_buff[begin] = price[begin]; for (i = begin + 1; i < limit; i++) { - ExtLineBuffer[i] = price[i] * SmoothFactor + ExtLineBuffer[i - 1] * (1.0 - SmoothFactor); + _line_buff[i] = price[i] * SmoothFactor + _line_buff[i - 1] * (1.0 - SmoothFactor); } } else limit = prev_calculated - 1; // Main loop. for (i = limit; i < rates_total && !IsStopped(); i++) { - ExtLineBuffer[i] = price[i] * SmoothFactor + ExtLineBuffer[i - 1] * (1.0 - SmoothFactor); + _line_buff[i] = price[i] * SmoothFactor + _line_buff[i - 1] * (1.0 - SmoothFactor); } } @@ -313,7 +313,7 @@ class Indi_MA : public Indicator { * Calculates Linearly Weighted Moving Average (LWMA). The same as in "Example Moving Average" indicator. */ static void CalculateLWMA(int rates_total, int prev_calculated, int begin, ValueStorage &price, - ValueStorage &ExtLineBuffer, int _ma_period) { + ValueStorage &_line_buff, int _ma_period) { int i, limit; static int weightsum; double sum; @@ -322,7 +322,7 @@ class Indi_MA : public Indicator { weightsum = 0; limit = _ma_period + begin; // Set empty value for first limit bars. - for (i = 0; i < limit; i++) ExtLineBuffer[i] = 0.0; + for (i = 0; i < limit; i++) _line_buff[i] = 0.0; // Calculate first visible value. double firstValue = 0; for (i = begin; i < limit; i++) { @@ -331,14 +331,14 @@ class Indi_MA : public Indicator { firstValue += k * price[i].Get(); } firstValue /= (double)weightsum; - ExtLineBuffer[limit - 1] = firstValue; + _line_buff[limit - 1] = firstValue; } else limit = prev_calculated - 1; // Main loop. for (i = limit; i < rates_total && !IsStopped(); i++) { sum = 0; for (int j = 0; j < _ma_period; j++) sum += (_ma_period - j) * price[i - j].Get(); - ExtLineBuffer[i] = sum / weightsum; + _line_buff[i] = sum / weightsum; } //--- } @@ -347,23 +347,23 @@ class Indi_MA : public Indicator { * Calculates Smoothed Moving Average (SMMA). The same as in "Example Moving Average" indicator. */ static void CalculateSmoothedMA(int rates_total, int prev_calculated, int begin, ValueStorage &price, - ValueStorage &ExtLineBuffer, int _ma_period) { + ValueStorage &_line_buff, int _ma_period) { int i, limit; // First calculation or number of bars was changed. if (prev_calculated == 0) { limit = _ma_period + begin; // Set empty value for first limit bars. - for (i = 0; i < limit - 1; i++) ExtLineBuffer[i] = 0.0; + for (i = 0; i < limit - 1; i++) _line_buff[i] = 0.0; // Calculate first visible value. double firstValue = 0; for (i = begin; i < limit; i++) firstValue += price[i].Get(); firstValue /= _ma_period; - ExtLineBuffer[limit - 1] = firstValue; + _line_buff[limit - 1] = firstValue; } else limit = prev_calculated - 1; // Main loop. for (i = limit; i < rates_total && !IsStopped(); i++) - ExtLineBuffer[i] = (ExtLineBuffer[i - 1] * (_ma_period - 1) + price[i].Get()) / _ma_period; + _line_buff[i] = (_line_buff[i - 1] * (_ma_period - 1) + price[i].Get()) / _ma_period; //--- } @@ -582,7 +582,7 @@ class Indi_MA : public Indicator { * Calculates Moving Average. The same as in "Example Moving Average" indicator. */ static int Calculate(const int rates_total, const int prev_calculated, const int begin, ValueStorage &price, - ValueStorage &ExtLineBuffer, int _ma_method, int _ma_period) { + ValueStorage &_line_buff, int _ma_method, int _ma_period) { // Check for bars count. if (rates_total < _ma_period - 1 + begin) { // Not enough bars for calculation. @@ -590,22 +590,22 @@ class Indi_MA : public Indicator { } if (prev_calculated == 0) { // First calculation or number of bars was changed. - ArrayInitialize(ExtLineBuffer, (double)0); + ArrayInitialize(_line_buff, (double)0); } // Calculation. switch (_ma_method) { case MODE_EMA: - CalculateEMA(rates_total, prev_calculated, begin, price, ExtLineBuffer, _ma_period); + CalculateEMA(rates_total, prev_calculated, begin, price, _line_buff, _ma_period); break; case MODE_LWMA: - CalculateLWMA(rates_total, prev_calculated, begin, price, ExtLineBuffer, _ma_period); + CalculateLWMA(rates_total, prev_calculated, begin, price, _line_buff, _ma_period); break; case MODE_SMMA: - CalculateSmoothedMA(rates_total, prev_calculated, begin, price, ExtLineBuffer, _ma_period); + CalculateSmoothedMA(rates_total, prev_calculated, begin, price, _line_buff, _ma_period); break; case MODE_SMA: - CalculateSimpleMA(rates_total, prev_calculated, begin, price, ExtLineBuffer, _ma_period); + CalculateSimpleMA(rates_total, prev_calculated, begin, price, _line_buff, _ma_period); break; } // Return value of prev_calculated for next call. diff --git a/Indicators/Indi_TEMA.mqh b/Indicators/Indi_TEMA.mqh index cd380ea24..8c1be3f40 100644 --- a/Indicators/Indi_TEMA.mqh +++ b/Indicators/Indi_TEMA.mqh @@ -127,11 +127,11 @@ class Indi_TEMA : public Indicator { /** * OnCalculate() method for TEMA indicator. * - * Note that InpShift is used for drawing only and thus is unused. + * Note that _ishift is used for drawing only and thus is unused. */ static int Calculate(INDICATOR_CALCULATE_METHOD_PARAMS_SHORT, ValueStorage &TemaBuffer, ValueStorage &Ema, ValueStorage &EmaOfEma, ValueStorage &EmaOfEmaOfEma, - int InpPeriodEMA, int InpShift) { + int InpPeriodEMA, int _ishift) { if (rates_total < 3 * InpPeriodEMA - 3) return (0); //--- int start; diff --git a/Indicators/Indi_VIDYA.mqh b/Indicators/Indi_VIDYA.mqh index 8e13b4c27..aff6a87f1 100644 --- a/Indicators/Indi_VIDYA.mqh +++ b/Indicators/Indi_VIDYA.mqh @@ -132,10 +132,10 @@ class Indi_VIDYA : public Indicator { /** * OnCalculate() method for VIDyA indicator. * - * Note that InpShift is used for drawing only and thus is unused. + * Note that _ishift is used for drawing only and thus is unused. */ static int Calculate(INDICATOR_CALCULATE_METHOD_PARAMS_SHORT, ValueStorage &VIDYA_Buffer, int InpPeriodCMO, - int InpPeriodEMA, int InpShift) { + int InpPeriodEMA, int _ishift) { double ExtF = 2.0 / (1.0 + InpPeriodEMA); if (rates_total < InpPeriodEMA + InpPeriodCMO - 1) return (0);