Coppock Indicator

hayseed

Master Trader
Jul 27, 2010
1,185
279
149
usa
there are 4 or 5 coppock indicators...... all seem to have a unique issue...... along with several other indicators like the roc with signal ma.....

when a symbol's digits are 0, in other words whole numbers, they will either not plot at all, or plot correctly but with unusable values...... examples would be dow, dax, stoxx50 and such......

nq, es, gold, silver and the like all have at least 1 decimal point...... they work ok.....

if you change line 43 from

MQL5:
IndicatorSetInteger(INDICATOR_DIGITS, _Digits);

to

MQL5:
IndicatorSetInteger(INDICATOR_DIGITS, digits);

where digits is set in the inputs, it will work on symbols including those that are whole numbers only..... came up with several other methods but using the input idea works best......

my goal was to code alerts when the coppock crossed the 0 line...... without proper values it cant be done, or at least not by me......

once the digits issue is solved, they all work perfectly......h

//-----

MYMH25M15.png
 

Enivid

Administrator
Staff member
Nov 30, 2008
19,413
1,566
144
Odesa
www.earnforex.com
Yes, it doesn't make sense to base the indicator digits on the symbol digits here because the result is a ratio of prices in this indicator. It's enough just to set the indicator digits to 4 or any other such high precision and it will work equally well for all symbols.