nonLagEMA(src, length) =>
alpha = 2 / (length + 1)
nonLag = 0.0
nonLag := alpha * src + (1 - alpha) * nz(nonLag[1])
nonLag
nonLagOscillator = 100 * (close - nonLagEMA(close, fastPeriod)) / nonLagEMA(close, fastPeriod)​
protected double NonLagEMA(Series<double> src, int length) {
double alpha = 2.0 / (length + 1);
double nonLag = 0.0;
nonLag = alpha * src[0] + (1 - alpha) * nonLag);
return nonLag;
}
currentClose[0] = Close[0];
nonLagOscillator[0] = 100 * (Close[0] - NonLagEMA(currentClose, fast_period)) / NonLagEMA(currentClose, fast_period);

Comment