diff --git a/src/Calculations/MovingAvg.cs b/src/Calculations/MovingAvg.cs index 62e96a9..c8ddb19 100644 --- a/src/Calculations/MovingAvg.cs +++ b/src/Calculations/MovingAvg.cs @@ -336,7 +336,7 @@ public static StockData CalculateArnaudLegouxMovingAverage(this StockData stockD /// The length. /// The offset. /// - public static StockData CalculateEndPointMovingAverage(this StockData stockData, int length = 11) + public static StockData CalculateEndPointMovingAverage(this StockData stockData, int length = 11, int offset = 4) { List epmaList = new(); List signalsList = new(); @@ -350,7 +350,7 @@ public static StockData CalculateEndPointMovingAverage(this StockData stockData, double sum = 0, weightedSum = 0; for (var j = 0; j <= length - 1; j++) { - double weight = length - j - length; + double weight = length - j - offset; var prevValue = i >= j ? inputList[i - j] : 0; sum += prevValue * weight;