TA Indicators

Guide

SMA Indicator

The Simple Moving Average (SMA) Indicator calculates a rolling average over a specified number of periods. It is one of the most widely used technical indicators in financial and data analysis.

SMA smooths out fluctuations in a data series by averaging a defined number of recent values. For example, an SMA with a period of 5 will take the last 5 input values, sum them, and divide by 5. This process repeats across the dataset, producing a series of averaged values that help identify trends over time.

This method takes an input array of numerical values and generates the corresponding SMA values based on the specified period and scale.

Input Parameters:

Name Description
Values The array of input values used for calculating the SMA.
Period The number of consecutive values to include in each average (e.g., 5, 10, 20).
Scale The number of decimal digits to round the resulting SMA values.

Result Mapping

The calculated SMA values are stored in the Execution State at the location defined by the provided JSON Path expression.

* * *

EMA Indicator

The Exponential Moving Average (EMA) Indicator is a type of moving average that gives more weight to recent values in the dataset, making it more responsive to changes compared to the Simple Moving Average (SMA).

The EMA is calculated using a smoothing factor (multiplier) derived from the chosen period:

Multiplier = 2 Period + 1

Each EMA value is computed by combining the most recent input value with the previous EMA value:

EMA t = ( Value t × Multiplier ) + ( EMA t 1 × ( 1 Multiplier ) )

The first EMA value is initialized using the SMA of the first Period values. This approach allows the EMA to adjust quickly to recent changes while still smoothing out noise in the data.

This method takes an input array of numerical values and generates the EMA values based on the specified period and scale.

Input Parameters:

Name Description
Values The array of input values used for calculating the EMA.
Period The number of values considered for smoothing. A smaller period makes the EMA more sensitive to changes.
Scale The number of decimal digits to round the resulting EMA values.

Result Mapping

The calculated EMA values are stored in the Execution State at the location defined by the provided JSON Path expression.

* * *

RSI Indicator

The RSI (Relative Strength Index) is a momentum oscillator that measures the speed and magnitude of recent price changes. It helps determine whether an asset is overbought (typically RSI > 70) or oversold (typically RSI < 30).

The RSI is calculated in the following steps:

  • Compute the average gains and average losses over the selected Period.
  • Calculate the Relative Strength (RS) as the ratio of average gain to average loss.
  • Transform RS into the RSI value using the standard formula.

Formula 1: Relative Strength (RS)

RS = Average Gain Average Loss

Formula 2: RSI

RSI = 100 - 100 1 + RS

This calculation ensures that RSI values range between 0 and 100.

Input Parameters:

Name Description
Values Array of input values used for RSI calculation
Period Number of data points used to calculate average gain and loss
Scale Number of decimal digits in the result values

Result Mapping

The result is stored in the execution state at the location defined by the provided JSON Path expression.

* * *

StochRSI Indicator

The Stochastic Relative Strength Index (StochRSI) is a momentum oscillator derived from the Relative Strength Index (RSI). It measures the level of RSI relative to its range (highest and lowest values) over a defined period. Unlike standard RSI, which operates on raw price values, StochRSI is applied to RSI values, making it more sensitive and faster-moving.

It is commonly used to identify overbought (values > 0.8) and oversold (values < 0.2) conditions.

Formula

The StochRSI at time t is calculated as:

StochRSI t = RSI t - min RSI ( RSI RSI over Period ) max RSI ( RSI RSI over Period ) - min RSI ( RSI RSI over Period )

Calculation Steps

  • Compute RSI values for the input series using the chosen RSI period.
  • For each RSI value, determine the minimum RSI and maximum RSI over the last N periods.
  • Apply the StochRSI formula to normalize the current RSI value between 0 and 1.

Input Parameters:

Name Description
Values Array of input values used to calculate RSI before applying the StochRSI formula
Period The number of periods used to calculate the minimum and maximum RSI values (commonly 14)
Scale The number of decimal digits in the result values

Result Mapping

The calculated StochRSI values are stored in the execution state at the location defined by the JSON Path expression.

* * *

MACD Indicator

The Moving Average Convergence Divergence (MACD) is a widely used momentum indicator that shows the relationship between two exponential moving averages (EMAs) of a time series. It helps identify trend direction, momentum shifts, and potential buy/sell signals.

The MACD calculation produces three arrays:

  • MACD Line – the difference between a short-term EMA and a long-term EMA.
  • Signal Line – a smoothing of the MACD Line, typically using a 9-period EMA.
  • Histogram – the difference between the MACD Line and the Signal Line, highlighting convergence/divergence.

Formula

MACD Line

MACD t = EMA short,t - EMA long,t

Signal Line

Signal t = EMA signalPeriod,MACD

Histogram

Histogram t = MACD t - Signal t

Calculation Steps

  • Compute the short-period EMA and long-period EMA of the input values.
  • Subtract the long EMA from the short EMA to obtain the MACD Line.
  • Apply an EMA of the MACD Line using the specified Signal Period to obtain the Signal Line.
  • Subtract the Signal Line from the MACD Line to compute the Histogram.

Input Parameters:

Name Description
Values Array of input values (e.g., closing prices)
Short Period Number of periods for the short EMA (commonly 12)
Long Period Number of periods for the long EMA (commonly 26)
Signal Period Number of periods for the Signal Line EMA (commonly 9)
Scale Number of decimal digits to round the results

Result Mapping

The method outputs an object with three arrays:

  • macd → MACD Line values
  • signal → Signal Line values
  • histogram → Histogram values

All results are stored in the execution state at the location defined by the JSON Path expression.

* * *

Diff Arrays

The Diff Arrays method calculates the element-wise differences between two arrays. The arrays are tail-aligned, meaning that calculation starts from the last elements of both arrays. The resulting array length is equal to the shorter of the two input arrays.

This method is particularly useful for comparing indicators, price series, or any other time-aligned numerical datasets.

Input Parameters:

Name Description
List 1 The first input array
List 2 The second input array (aligned with List 1 from the end)
Scale The number of decimal digits to round the difference values

Result Mapping

The output is an array of numeric differences, stored in the execution state at the location defined by the JSON Path expression.