This is the Chi-Squared that was coded by Mladen for MT4.
As explained by Mladen:
Chi squared ...
The way this indicator is written (the data it uses for calculation). this indicator belongs to moving averages thread indirectly
It is a Chi squared of a chosen type of a moving average.
In order to add some functionality other then testing how good a moving average fits the data it is applied to, added one option : Directional. If it is set to true, then the formula stays the same but it is trying to accommodate to the direction of the price changes too. Here is a comparison of a regular Chi-squared (upper) and "directional" one (lower). Bare in mind that when in "directional" mode, it is not a chi square any more but a kind of an offspring of chi squared