Author: traderak20, based on iUniMA.mq5 by Integer
If you're looking to up your trading game, the iUniMA MTF (Multi-Timeframe) indicator is a tool you won't want to miss. This handy indicator lets you choose from various types of moving averages, including SMA, EMA, SMMA, LWMA, AMA, DEMA, TEMA, FRAMA, and VIDYA. You can apply it to any timeframe, whether it's higher or lower than your current chart's timeframe.
What's cool about this indicator is that it offers an additional setting for a second timeframe to use for calculations. If you're working with a timeframe lower than your current one, the indicator will adapt to provide the most relevant values based on the price type you choose.
Here are a couple of examples:
- Example 1: timeframe_1 = 5 minutes, timeframe_2 = 1 minute, calculations based on Close price series:
For any bar on timeframe_1, the indicator will display the latest bar from timeframe_2 that has a Close time before or at the Close time of the bar on timeframe_1. This applies to both closed bars and the current open bar.
- Example 2: timeframe_1 = 5 minutes, timeframe_2 = 1 minute, calculations based on Open price series:
In this case, the indicator will show the latest bar from timeframe_2 with an opening time before or at the Open time of the bar on timeframe_1. The idea here is that if you're calculating your indicators based on the Open time, you’re likely looking to trade when a new bar opens. Hence, at the Open of a new 5-minute bar, you’ll only see the Open of the first of the five 1-minute bars that make it up, ignoring the rest.
The great part is you can mix and match any timeframes—even if they don’t sync perfectly, like timeframe_1 = 5 minutes and timeframe_2 = 12 minutes. The indicator will ensure they stay in sync, working similarly to the examples above.
Pro Tip: When switching between timeframes, give it a few seconds for the price data to load. If the indicator doesn’t show up, try refreshing the chart manually.
To manage error messages, check the source code:
bool ShowErrorMessages=false; // Enable or disable error messages for debugging

Update History:
2010 09 26: v03
- Improved display of values on timeframes smaller than the chart's timeframe;
- Set buffers to EMPTY_VALUE instead of 0 after: if(convertedTime<tempTimeArray_TF2[0]);
- Code optimization;
- Removed PLOT_DRAW_BEGIN from OnInit() - inherited from single time frame indicator;
- Moved ArraySetAsSeries of buffers and arrays into OnInit();
2010 08 28: v02
- Indicator first published;

Comments 0