DetrendedPriceOscillator


Summary

The Detrended Price Oscillator shows intermediate overbought and oversold levels.

Syntax

public DetrendedPriceOscillator DetrendedPriceOscillator(DataSeries source, int periods, MovingAverageType maType)

Parameters

NameDescription

Example 1

private _detrendedPriceOscillator _dpoFast;
private _detrendedPriceOscillator _dpoSlow;
protected override void OnStart()
{
    _dpoFast = Indicators.DetrendedPriceOscillator(Source, PeriodFast, MaType);
    _dpoSlow = Indicators.DetrendedPriceOscillator(Source, PeriodSlow, MaType);
}
protected override void OnBar()
{
    if(_dpoFast.Result.Count < 1)
        return;
    int currentIndex = _dpoFast.Result.Count - 1;
    int prevIndex = currentIndex - 1;
    if (_dpoFast.Result[prevIndex] > _dpoSlow.Result[prevIndex])
    {
        //Do something
    }
}