Wednesday, July 1, 2009

DeMarker Indicator

Recently I came across references to the use of the DeMarker indicator in Forex. Some even claimed it a cornerstone of their trading strategy. I suspect it is part of the hype to promote sales of their trading methodology.

It certainly stirred my curiosity to take second look at DeMarker.














It is amongst the host of indicators on the Meta-4 trader platform. Ah.. I remembered reading it long time ago. But I gave up unable to make sense out of it then.

This is the extract from the Meta-4 Trader User Guide:

Technical Indicators — DeMarker
The value of the DeMarker for the "i" interval is calculated as follows:
The DeMax(i) is calculated:
If high(i) > high(i-1),
then DeMax(i) = high(i)-high(i-1),
otherwise DeMax(i) = 0

The DeMin(i) is calculated:
If low(i) < low(i-1),
then DeMin(i) = low(i-1) - low(i),
otherwise DeMin(i) = 0

The DeMark indicator is calculated as:
DeMark(i) = SMA(DeMax, N)/(SMA(DeMax,N)+SMA(DeMin,N))

where SMA is the Simple Moving Average,
N is the number of periods used in the calculations.

I find the above so brief and cryptic mathematically I couldn't make sense out of it!
Fortunately the review of RSI is still fresh in mind - Eureka!

Let's take a quick recap of the RSI:

RSI = 1 - (1/1+Rs)
with Rs = Avg(Gains)/Avg(Losses)
and substituting;

RSI = Avg(Gains)/(Avg(gains) + Avg(Losses))

Avg(); is an averaging function = SMA()

Isn't this the exact form of the DeMarker formula!

Comparing:
Avg(Gains) => SMA(DeMax,N)
Avg(Losses) => SMA(DeMin,N)

So what is different?
RSI averages the gains and losses over a period.

DeMarker has a different treatment to the gains & losses over the period.
SMA(DeMax,N) takes into account only the difference between gains if the successive closing price is higher than the previous closing, else it is ignored (i.e. value set to zero and dropped)

Similarly SMA(DeMin,N) takes into account only the difference between loss if the successive closing price is lower than the previous closing, else it is ignored (i.e. value set to zero and dropped)

In a nutshell, both indicators utilize the basic formula of the form:

Indicator(%) = 1 - 1/(1 + Avg(G)/Avg(L))

RSI plots the true average of gains,(G), & losses, (L)

while

DeMarker averages the differences of gains,(^G) & losses, (^L);
where "^" means incremental

In mathematical sense, taking the difference between discreet serial time data is analogous to "differentiation" operation as in calculus of continuous functions. So in this sense DeMarker is gauging the average rate of price gains/losses.


Both indicators are useful to signal impending change in market direction. Generally I find the DeMarker is more sensitive as it tends to accentuates the high/low of cycles more. Double click to enlarge an illustration of their comparison.











Hope you find this meaningful and make your observations to draw conclusions.

Sunday, June 28, 2009

RSI Indicator

The RSI is among the widely used indicators. There are ample information around explaining its use, so no point repeating here. But I do find a lack of simple explanation providing insights behind the formula. Perhaps I can add a little in this direction.



















To recap the RSI formula

RSI = 1 - (1/1+Rs); which keeps RSI within the range 0 to 1
or RSI(%)= 100 x RSI; range between 0 to 100%

where Rs = Avg(Gains)/Avg(Losses) over a period
The default period is normally set at 14

So this indicator basically takes the ratio of average gains/average losses

Hence when price movement is side way with Avg(Gains)=Avg(Losses), Rs = 1
RSI = 1/2 or 50%; the 50% line is visually useful too.

So it can be seen that if the
(average upward price movement) > (average downward price movement)
RSI > 50%

The 70% line is reached when Rs = 0.7/0.3 = 2.33 (by solving the formula)
i.e. (average upward price movement) = 2.33 times the (average downward price movement);
often taken as threshold entering the zone of price saturation being overbought.
I would simply interpret as Rs > 2 times.

Likewise, if the
(average upward price movement) < (average downward price movement)
RSI < 50%

The 30% line is reached when Rs = 0.3/0.7 = 0.433 (which I simply interpret as RS < 1/2)
i.e. (average upward price movement) = 0.433 times the (average downward price movement);
often taken as threshold entering the zone of price saturation being over sold.

One of RSI's usefulness is:

Its divergence from the price trend signals a potential trend reversal. This is revealed by lower values of Rs even as the prices move higher. This is also commonly visible on price charts as the "candle body" gets smaller (with a higher time frame) before a trend reverses. The RSI indicator shows this with more mathematical precision.