Expert Advisors • Indicators • Scripts • Libraries

MQL.RobotFX.org is the biggest collection of MetaTrader expert advisors (MT5 & MT4), indicators, scripts and libraries that can be used to improve trading results, minimize risks or simply automate trading tasks

MetaTrader 5 Indicator | Trend Oscillator

Original author:

Evgeniy Gutorov

A trend oscillator indicator. The main algorithm for getting the source signals using the formula:

InputSeries[bar] = (Close[bar] - Open[bar]) / (High[bar] - Low[bar])

To calculate the oscillator signal generated by the green line we use the following formula:

Osc=Sum(Period) / Sum(Abs(Period)) * 100

where:

  • Sum(Period) - a sum of source signal values for a period;
  • Sum(Abs(Period)) - a sum of absolute source signal values for a period.

The red line is the Hodrick-Prescott filter which redraws if the redraw period in the beginning bars is big. For that reason it's better to use the period of 2 to get more reliable results.

Originally this indicator has been written in MQL4 and was first published in the Code Base on 15.08.2009.

MetaTrader Experts, Indicators, Scripts and Libraries

Fig. 1 The geTrendOsc trend oscillator

12521

Best MetaTrader Indicators + Profitable Expert Advisors