Using a Date Attribute in a Calculated Indicator

In this calculation, two reading-based inputs from the same indicator are used to calculate the rate of rise of that indicator based on its last 10 readings. The two inputs are:
This calculation takes the difference in reading values and divides it by the number of days that have elapsed between the first and 10th reading. To do this, it first declares a variable called DateDelta. The value of this variable is then set by subtracting the first date in the array from the last one, which results in the number of days. Next, the value of the ReadingDifference input is divided by the value in the DateDelta variable.
For example:

VB.NET

Dim DateDelta As TimeSpan = DateArray(9) - DateArray(0)
Return ReadingDifference/Date.Delta.TotalDays

C#

TimeSpan DateDelta = DateArray[9] - DateArray[0];
return ReadingDifference/DateDelta.TotalDays;