MultiTF trend function
- Indicators
- Vasyl Temchenko
- Version: 1.3
- Updated: 18 April 2021
- Activations: 5
This is a function in the indicator shell. Generates a trading signal for a specified number of TFs (from 1 to 4). The indicators supplied with the terminal are not used. The basic calculation is made using the MACD formula, but using a modified third generation EMA (responds more quickly to a sudden change in trend).
In addition, the function:
- draws two bands showing the strength of the trend.
- detects the moment of trend change to the opposite one and informs about it with an alert and sound signal (if allowed). Alert pops up once, only at the moment of a trend change. UP or DN-signal for each of the monitored TF is generated if there are at least 2 dots of the same color. The final signal is formed by the indicators of all allowed TFs.
The signal of the current TF can be turned off - the trend will be drawn, but the signal will not be taken into account. This allows you to freely switch chart-TF for an overview of the general situation, without violating the correctness of the function. I do not recommend allowing more than 2 TFs to work unnecessarily. Or allow everything, but make trading decisions without waiting for the final UP or DN signal. On a weak trend (a small gap between the lines, the dots are almost horizontal, the color alternates), I recommend closing profitable deals and not trading. Or trading by place pending orders in the direction of the presumptive trend development. On a strong trend, it is permissible to trade market orders
Input parameters
- FastPeriod, SlowPeriod, DeviationPeriod, Deviation weight - standard MACD parameters by default. In the vast majority of cases, there is no need to change them.
- CurrentTF_ON - permission to take into account the signal of the current TF
- TF TF_1, TF_2, TF_3 - selection of a period less than Monthly enables trend control on this TF
- BarsToCount - limiting the depth of viewing history. A smaller value speeds up the calculation when switching TF. 0 = Full story (not recommended).