Description
The Demarker indicator is named after Tom Demarker who claims to have developed this indicator to overcome the shortcomings of other overbought/oversold oscillators. There are different versions of it in the market; in some cases the indicator uses 0 and 1 as the maximum and minimum of oscillation, while in others the typical 0-100 range is preferred.
Any level between 0.3 and 0.7 is regarded as a neutral level characterizing a continuation phase. If the price is in an uptrend, and the indicator value is also rising, the trend is expected to go on. If we observe an uptrend, while the indicator value is falling, we're faced with a divergence, implying that the uptrend is slowly losing momentum and may suffer an abrupt reversal. Similarly, when the price is in a downtrend, but the indicator's value is rising, we suspect that the downtrends is weak. The oscillator and price action are converging, implying an ultimate reversal. If both the indicator and the price are in an uptrend, the interpretation is that the existing price pattern will continue to develop.
using System;
using cAlgo.API;
using cAlgo.API.Internals;
using cAlgo.API.Indicators;
namespace cAlgo.Indicators
{
[Indicator(IsOverlay = false, AccessRights = AccessRights.None)]
[Levels(0.3, 0.7)]
public class DeMarker : Indicator
{
[Parameter(DefaultValue = 14)]
public int Period { get; set; }
[Output("Main")]
public IndicatorDataSeries Result { get; set; }
private IndicatorDataSeries _deMax;
private IndicatorDataSeries _deMin;
private SimpleMovingAverage _deMinSma;
private SimpleMovingAverage _deMaxSma;
protected override void Initialize()
{
_deMax = CreateDataSeries();
_deMin = CreateDataSeries();
_deMaxSma = Indicators.SimpleMovingAverage(_deMax, Period);
_deMinSma = Indicators.SimpleMovingAverage(_deMin, Period);
}
public override void Calculate(int index)
{
if (MarketSeries.High[index] > MarketSeries.High[index - 1])
_deMax[index] = MarketSeries.High[index] - MarketSeries.High[index - 1];
else
_deMax[index] = 0;
if (MarketSeries.Low[index] < MarketSeries.Low[index - 1])
_deMin[index] = MarketSeries.Low[index - 1] - MarketSeries.Low[index];
else
_deMin[index] = 0;
Result[index] = _deMaxSma.Result[index] / (_deMaxSma.Result[index] + _deMinSma.Result[index]);
}
}
}
modarkat
Joined on 25.12.2013
- Distribution: Free
- Language: C#
- Trading platform: cTrader Automate
- File name: DeMarker.algo
- Rating: 0
- Installs: 4742
- Modified: 13/10/2021 09:54