RSI Bug

Jun 26, 2012 at 8:15 PM
Edited Jun 26, 2012 at 8:17 PM

The for loop on line 26 of RSI.cs should read like this

 

 

for (int i = 0; i <= period; i++)
{
	if (i == 0)
	{
		continue;
	}
	double gain = 0;
	double loss = 0;

	CalculateGainLoss(inputList[i], inputList[i - 1], out gain, out loss);

	startGain += gain;
	startLoss += loss;
}

 

We need period + 1 to get period GainLoss's.