Support Board
Date/Time: Sat, 18 May 2024 19:51:28 +0000
Post From: Arnaud Legoux Moving Average
[2020-08-18 18:16:08] |
cmet - Posts: 538 |
Research on quantitative forecasting in food prices: https://www.cjournal.cz/files/308.pdf The formula cited in that paper is in the attached image. It is the same as post #3. Below is a version written for Tradestation in 2010, shortly after the ALMA was introduced. No evidence of its accuracy but was written by a very respected coder on ForexFactory. {Function; ALAverage}
inputs: Price (numericseries), Window(numericsimple), Sigma(numericsimple), Offset(numericsimple); variables: m(0),s(0),Wtd(0), WtdSum(0),CumWt(0), k(0); m = Floor(Offset * (Window - 1)); s = Window/Sigma; WtdSum = 0; CumWt = 0; for k = 0 to Window - 1 begin Wtd = ExpValue(-((k-m)*(k-m))/(2*s*s)); WtdSum = WtdSum + Wtd * Price[Window - 1 - k] ; CumWt = CumWt + Wtd; end ; ALAverage = WtdSum / CumWt ; Date Time Of Last Edit: 2020-08-18 18:27:24
|
ALMA Formula.png / V - Attached On 2020-08-18 18:15:38 UTC - Size: 7.96 KB - 352 views |