Login Page - Create Account

Support Board


Date/Time: Thu, 26 Dec 2024 22:49:22 +0000



Post From: Need Example of SLOPE Function for Spreadsheet Column K-X formulas

[2016-03-15 23:41:56]
Jeffrey - Posts: 2187
The description on the Spreadsheet Functions page should be updated shortly.

Here is a copy of the description:
Returns the slope of the linear regression line through a set of known X and Y values. The first parameter is a reference to a range of cells containing the known Y values, and the second parameter is a reference to a range of cells containing the known X values. Only numeric values in the given ranges will be used. Returns #NUM! if the number of known X and Y values do not match. Returns #DIV/0! if no numeric values are given, or the slope is vertical.

Example:
=SLOPE(E3:E12, A3:A12)
This formula will calculate the slope of the last 10 bar Closes in relation the the date-times of those bars, when used in context of the the Spreadsheet study. For this example, the range E3:E12 contains the Close values of the last 10 bars, and the range A3:A12 contains the corresponding date-time values for those same 10 bars. The result will be a positive value when the Close values are generally ascending over time, and a negative value when the Close values are generally descending.

The first important thing to recognize about the SLOPE formula function is that it always requires two parameters. When you first said SLOPE(AB4:AB9) doesn't work, this was because it was missing the parameter for the KnownX values. A possible correction to this could be: SLOPE(AB4:AB9, A4:A9) -- which uses the date-time values of the same bars as the KnownX values.

If for some reason you would rather use the indexes of the bars rather than date-time values of the bars, you could fill another column with the formula =-ROW() and reference that instead of the date-time column.
Date Time Of Last Edit: 2016-03-16 01:11:58