Documentation

chandeMomentumOscillator() function

Flux 0.39.0+

The chandeMomentumOscillator() function applies the technical momentum indicator developed by Tushar Chande.

chandeMomentumOscillator(
  n: 10,
  columns: ["_value"]
)

The Chande Momentum Oscillator (CMO) indicator calculates the difference between the sum of all recent data points with values greater than the median value of the data set and the sum of all recent data points with values lower than the median value of the data set, then divides the result by the sum of all data movement over a given time period. It then multiplies the result by 100 and returns a value between -100 and +100.

Parameters

n

The period or number of points to use in the calculation.

columns

The columns to operate on. Defaults to ["_value"].

tables

Input data. Default is piped-forward data (<-).

Output tables

For each input table with x rows, chandeMomentumOscillator() outputs a table with x - n rows.

Examples

Transform data with a two point Chande Momentum Oscillator

The following example uses data provided by the sampledata package to show how chandeMomentumOscillator() transforms data.

import "sampledata"

sampledata.int()
  |> chandeMomentumOscillator(n: 2)

View input and output


Upgrade to InfluxDB Cloud or InfluxDB 2.0!

InfluxDB Cloud and InfluxDB OSS 2.0 ready for production.