Skip to content

Commit

Permalink
Removes CustomMovingAverage indicator in favor of MA
Browse files Browse the repository at this point in the history
  • Loading branch information
kenorb committed Jun 25, 2023
1 parent 1ece853 commit 6e2b81f
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 203 deletions.
1 change: 0 additions & 1 deletion .github/workflows/test-indicators.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ jobs:
- Indi_CCI.test
- Indi_CHO.test
- Indi_CHV.test
- Indi_CustomMovingAverage.test
- Indi_DeMarker.test
- Indi_Demo.test
- Indi_DetrendedPrice.test
Expand Down
137 changes: 0 additions & 137 deletions Indicators/Indi_CustomMovingAverage.mqh

This file was deleted.

12 changes: 10 additions & 2 deletions Indicators/Price/Indi_MA.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,14 @@ struct IndiMAParams : IndicatorParams {
IndiMAParams(unsigned int _period = 13, int _ma_shift = 0, ENUM_MA_METHOD _ma_method = MODE_SMA,
ENUM_APPLIED_PRICE _ap = PRICE_OPEN, int _shift = 10)
: period(_period), ma_shift(_ma_shift), ma_method(_ma_method), applied_array(_ap), IndicatorParams(INDI_MA) {
if (custom_indi_name == "") {
#ifdef __MQL5__
SetCustomIndicatorName("Examples\\Custom Moving Average");
#else
SetCustomIndicatorName("Custom Moving Averages");
#endif
}
shift = _shift;
SetCustomIndicatorName("Examples\\Moving Average");
};
IndiMAParams(IndiMAParams &_params) { THIS_REF = _params; };
};
Expand Down Expand Up @@ -674,13 +680,15 @@ class Indi_MA : public Indicator<IndiMAParams> {
break;
case IDATA_ICUSTOM:
_value = iCustom(istate.handle, GetSymbol(), GetTf(), iparams.custom_indi_name, /* [ */ GetPeriod(),
GetMAShift(), GetMAMethod(), GetAppliedPrice() /* ] */, 0, ToRelShift(_abs_shift));
GetMAShift(), GetMAMethod() /* ] */, 0, ToRelShift(_abs_shift));
break;
case IDATA_INDICATOR:
// Calculating MA value from specified indicator.
_value = Indi_MA::iMAOnIndicator(THIS_PTR, GetDataSource(), GetSymbol(), GetTf(), GetPeriod(), GetMAShift(),
GetMAMethod(), GetAppliedPrice(), ToRelShift(_abs_shift));
break;
default:
SetUserError(ERR_INVALID_PARAMETER);
}

return _value;
Expand Down
1 change: 0 additions & 1 deletion Indicators/includes.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@
#include "Indi_CCI.mqh"
#include "Indi_CHO.mqh"
#include "Indi_CHV.mqh"
#include "Indi_CustomMovingAverage.mqh"
#include "Indi_DEMA.mqh"
#include "Indi_DeMarker.mqh"
#include "Indi_Demo.mqh"
Expand Down
27 changes: 0 additions & 27 deletions Indicators/tests/Indi_CustomMovingAverage.test.mq4

This file was deleted.

31 changes: 0 additions & 31 deletions Indicators/tests/Indi_CustomMovingAverage.test.mq5

This file was deleted.

4 changes: 0 additions & 4 deletions tests/IndicatorsTest.mq5
Original file line number Diff line number Diff line change
Expand Up @@ -517,10 +517,6 @@ bool InitIndicators() {
IndiZigZagColorParams zigzag_color_params();
indis.Add(new Indi_ZigZagColor(zigzag_color_params));

// Custom Moving Average.
IndiCustomMovingAverageParams cma_params();
indis.Add(new Indi_CustomMovingAverage(cma_params));

// Math (specialized indicator).
IndiMathParams math_params(MATH_OP_SUB, BAND_UPPER, BAND_LOWER, 0, 0);
// math_params.SetPlot(clrBlue); // @fixme
Expand Down

0 comments on commit 6e2b81f

Please sign in to comment.