The SlopeDirectionLine indicator with the timeframe selection option available in input parameters:
input ENUM_TIMEFRAMES TimeFrame=PERIOD_H4; // Indicator chart period (timeframe)
Originally this indicator has been written in MQL4 and was first published in the Code Base on 15.01.2008.
Figure 1. The SlopeDirectionLine_HTF indicator
Translated from Russian by MetaQuotes Software Corp.
Original code: https://www.mql5.com/ru/code/1996
An optimized version of the InverseReaction indicator, which operates at a maximum speed in the IREA Expert Advisor.ExchangePrice
Shows the relative change of the current price from the price N/M bars ago.