Looking at the code for these indicators, it seems the calculation is non-standard.
Taking the Fast Stochastic for example, the lines of interest are:
den.Set(MAX(High, PeriodK)[0] - MIN(Low, PeriodK)[0]);
...
double nomSum = SUM(nom, PeriodD)[0];
double denSum = SUM(den, PeriodD)[0];
...
D.Set(Math.Min(100, 100 * nomSum / denSum));
There is a similar situation with the regular Stochastic indicator, where %K should be smoothed by a moving average and then %D should be the result smoothed once more.
Am I missing something? I am no expert on these indicators, nor on NinjaScript programming.
thanks
Comment