More changes to support BollingerBands.
This commit is contained in:
@@ -173,9 +173,9 @@ namespace PortfolioManager.Models
|
||||
LeastSquaresResult leastSquaresResult = bollingerBands.LeastSquaresFitClose();
|
||||
SortedDateTimeDataAdapter sortedDateTimeDataAdapter = new SortedDateTimeDataAdapter();
|
||||
List<BollingerBandElement> sortedBollingerBands = bollingerBands.OrderBy(x => x.Date).ToList();
|
||||
for (int index = 0; index < bollingerBands.Count; index++)
|
||||
for (int index = 0; index < sortedBollingerBands.Count; index++)
|
||||
{
|
||||
BollingerBandElement element = bollingerBands[index];
|
||||
BollingerBandElement element = sortedBollingerBands[index];
|
||||
int leastSquaresIndex = (leastSquaresResult.LeastSquares.Length - 1) - index;
|
||||
sortedDateTimeDataAdapter.Add(element.Date, leastSquaresResult.LeastSquares[leastSquaresIndex]);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user