Linear weighted Move Average is already supplied as a standard indicator
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Inputs: Price, , Length;
Variables: Sum(0), Counter(0), CSum(0);
Sum = 0;
CSum = 0;
For counter = 0 To Length - 1 Begin
Sum = Sum + Price[counter] * (Length - counter) ;
CSum = CSum + Length - counter;
End;
If CSum > 0 Then
WAverage = Sum / CSum
Else
WAverage = 0;
NOTE:
1) When you see [1] this means, 1 bar previous.
2) Times series ( ie price) are not placed in arrays in ts2000i langauge code, Price already assumes that it is an array.
There will be more so I hope you dont mind, like your software very much. Still learning.