Line Weighted Moving AverageA weighted moving average is also designed to put more weight on recent data and less weight on past data. A weighted moving average is calculated by multiplying each of the previous day's data by a weight. The following table shows how a 5-day weighted moving average is calculated.
Note how the 5-day weighted moving average gives five times more weight to today's price (i.e., 5 * 29) than to the price five days ago (i.e., 1* 25). Syntax:Public Function LinearWeightedMovAvg(ByVal LWMAIn() As Double, ByVal Lag As Long) As Double Parameters:
Example:
Dim TA4Net As New TA4Net.CTAFunctions("YOUR-REGISTRATION-CODE") Dim Result() As Double Dim CloseValues() As Double
' loading values to array CloseValues = GetCloseValues() ' calculating Technical Analysis function Result = TA4Net.LineWeightedMovAvg(CloseValues, 14)
|
|
TA4.NET® Franz AG
2004© |
| Browser Based Help. Published by chm2web software. |