@DimsterTherefore I have struggled with trying to determine if "0" is positive or negative and I'm using the trending to make that determination. So a falling trend at zero, the formula needs to product a negative value, whereas a trend that has been rising suddenly hits a zero, I want that same math formula to produce a positive value. That sounds so convoluted but I hope you can grasp the idea.
To calculate the trend - whether it is declining or rising. Please try to specify. Namely, if you have, say, 1000 values, then you get a different trend for the whole range and a different trend for comparing, for example, the last 100 values. What you want to compare it with is also important. Is the default value for trend determination the maximum value from the set of all compared elements for a given period, or is it related to some specific value? I'll give an example.
Let's say you have 900 values from 900 to zero and then another hundred values from zero to hundred. If you want to determine a trend for all thousand numbers, the maximum is 1000 and 999 other values are less than a thousand, so this is a declining trend.
What happens if you compare only the last hundred values? The last hundred values are from zero to a hundred, as we agreed at the beginning of this example. Then it can be said that this is a growing trend, because in the last values 99 values are lower than the last value.
If we add another 100 values of the same size to these 100 values and we make a trend from these 100 values, we will find that the 100 values are just the same size and it is stagnation. That's how I look at it.