TrendSpider makes it easy to customize the mathematical formulas that are used as a sorting algorithm for all possible automated trend lines. By customizing or adding your own values, you can change the way that TrendSpider identifies trend lines or identify your own custom trend lines.
You can get started in a few easy steps:
- Click the ... button next to the Trends button in the top toolbar.
- Click on the Advanced button.
- Click on the Trends tab in the left-hand sidebar.
- Add new trend lines by clicking on the Add button.
- Click Apply to push the changes live.
The Trend Formula Reference section of the Trends tab shows the most popular built-in variables:
Function | Description |
---|---|
length | The number of bars covered by the line. |
seriesLength | The total number of bars in the series. |
priceDev25 | The 25th quantile of deviation percentage between the trend line and (H + L) / 2. From 0 to 1. |
priceDev50 | The 50th quantile of deviation percentage between the trend line and (H + L) / 2. |
priceDev75 | The 75th quantile of deviation percentage between the trend line and (H + L) / 2. |
hits | The number of highs or lows touching the trend line. |
points | The highest highs or lowest lows calculated at the given window size. |
points2x | The highest highs or lowest lows calculated at the given window size * 2. Every "points2x" is also "point". |
bounceUp | The case when a trend line is touched by the high of a bar, but not by its adjacent bar's high. |
peaksUp | The case when a trend line is touched by the high of a long bar. "Long" means that the difference between the bar's high and its adjacent bar's high is greater than (1.5 * ATR(14)). Every peakUp is also a bounceUp. |
bounceDown | The case when a trend line is touched by the low of a bar, but not by its adjacent bar's low. |
peaksDown | The case when a trend line is touched by the low of a long bar. "Long" means that the difference between the bar's high and its adjacent bar's high is greater than (1.5 * ATR(14)). Every peakDown is also a bounceDown. |
violations | The number of bars that actually cross a trend line. |
There are several other variables and functions that you can use to build these formulas:
Function | Description |
abs(x) | Calculate the absolute value of a number. |
add(x, y) | Add two or more values, x + y. |
cbrt(x) | Calculate the cube root of a value. |
ceil(x) | Round a value towards plus infinity. If x is complex, both real and imaginary parts are rounded towards plus infinite. |
cube(x) | Compute the cube of a value, x * x * x. |
divide(x, y) | Divide two values, x / y. |
dotDivide(x, y) | Divide two matrices element wise. |
dotMultiply(x, y) | Multiple two matrices element wise. |
dotPow(x, y) | Calculate the power of x to y element wise. |
exp(x) | Calculate the exponent of a value. |
expm1(x) | Calculate the value of subtracting 1 from the exponential value. |
fix(x) | Round a value toward zero. |
floor(x) | Round a value toward minus infinite. |
gcd(a, b) | Calculate the greatest common divisor for two or more values or arrays. |
lcm(a, b) | Calculate the least common multiple for two or more values or arrays. |
log(x[,base]) | Calculate the logarithm of a value. |
log10(x) | Calculate the 10-base logarithm of a value. |
log1p(x) | Calculate the logarithm of a value + 1. |
log2(x) | Calculate the 2-base of a value. |
mod(x, y) | Calculate the modulus or remainder of an integer division. |
multiply(x, y) | Multiply two or more values, x * y. |
nthRoot(a) | Calculate the nth root of a value. |
pow(x, y) | Calculate the power of x to y, x ^ y. |
sign(x) | Compute the sign of a value. |
sqrt(x) | Calculate the square root of a value. |
square(x) | Calculate the square of a value, x * x. |
subtract(x, y) | Subtract two values, x - y. |
mad(a, b, c, …) | Calculate the median absolute derivation of a matrix or a list with values. |
max(a, b, c, …) | Calculate the maximum value of a matrix or a list of values. |
mean(a, b, c, …) | Calculate the mean value of a matrix or list of values. |
median(a, b, c, …) | Calculate the median value of a matrix or list of values. |
min(a, b, c, …) | Calculate the minimum value of a matrix or list of values. |
mode(a, b, c, …) | Calculate the mode of a set of numbers or list with values (numbers or characters). |
prod(a, b, c, …) | Calculate the product of a matrix or a list with values. |
quantileSeq(a, prob[, sorted]) | Calculate the prob order quantile of a matrix or a list with values. |
std(a, b, c, …) | Calculate the standard deviation of a matrix or a list with values. |
sum(a, b, c, …) | Calculate the sum of a matrix or a list with values. |
variance(a, b, c, …) | Calculate the variance of a matrix or a list with values. |
acos(x) | Calculate the inverse cosine of a value. |
acosh(x) | Calculate the hyperbolic arccos of a value, defined as acosh(x) = ln(sqrt(x^2 - 1)+x). |
acot(x) | Calculate the inverse cotangent of a value, defined as acot(x) = atan(1/x). |
acoth(x) | Calculate the hyperbolic arccotangent of a value, defined as acoth(x) = atanh(1/x) = (ln((x+1)/x) + ln(x/(x-1))) / 2. |
acsc(x) | Calculate the inverse cosecant of a value, defined as acsc(x) = asin(1/x). |
acsch(x) | Calculate the hyperbolic arccosecant of a value, defined as acsch(x) = asinh(1/x) = ln(1/x + sqrt(1/x^2 + 1)). |
asech(x) | Calculate the inverse secant of a value. |
asin(x) | Calculate the inverse sine of a value. |
asinh(x) | Calculate the hyperbolic arcsine of a value, defined as asinh(x) = ln(x + sqrt(x^2 + 1)). |
atan(x) | Calculate the inverse tangent of a value. |
atanx(y, x) | Calculate the inverse tangent function with two arguments, y/x. |
atanh(x) | Calculate the hyperbolic arctangent of a value, defined as atanh(x) = ln((1 + x)/(1 - x)) / 2. |
cos(x) | Calculate the cosine of a value. |
cosh(x) | Calculate the hyperbolic cosine of a value, defined as cosh(x) = 1/2 * (exp(x) + exp(-x)). |
cot(x) | Calculate the cotangent of a value. |
coth(x) | Calculate the hyperbolic cotangent of a value, defined as coth(x) = 1 / tanh(x). |
csc(x) | Calculate the cosecant of a value, defined as csc(x) = 1/sin(x). |
csch(x) | Calculate the hyperbolic cosecant of a value, defined as csch(x) = 1 / sinh(x). |
sec(x) | Calculate the secant of a value, defined as sec(x) = 1/cos(x). |
sech(x) | Calculate the hyperbolic secant of a value, defined as sech(x) = 1 / cosh(x). |
sin(x) | Calculate the sine of a value. |
sinh(x) | Calculate the hyperbolic sine of a value, defined as sinh(x) = 1/2 * (exp(x) - exp(-x)). |
tan(x) | Calculate the tangent of a value. |
tanh(x) | Calculate the hyperbolic tangent of a value, defined as tanh(x) = (exp(2 * x) - 1) / (exp(2 * x) + 1). |
Sep 30, 2024