RobotFX curates the best open-source MetaTrader code to inspire your trading automation.
The TSI_MACD indicator with the timeframe selection option available in input parameters:
input ENUM_TIMEFRAMES TimeFrame=PERIOD_H4; // Indicator chart period (timeframe)
To provide correct operation of the indicator, place the compiled TSI_MACD.mq5 indicator file in terminal_data_folder\MQL5\Indicators.

Trade the powerful Traders Dynamic Index strategy automatically with this dedicated TDI Expert Advisor. More details.
Figure 1. The TSI_MACD_HTF indicator
Build better strategies with RobotFX professional tools – check them out.
7046