InfluxDB Docs

chandeMomentumOscillator() function

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

Function type: Aggregate

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.

Data type: Integer

columns

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

Data type: Array of Strings

Examples

Table transformation with a ten point Chande Momentum Oscillator

Input table
_time_value
00011
00022
00033
00044
00055
00066
00077
00088
00099
001010
001111
001212
001313
001414
001515
001614
001713
001812
001911
002010
00219
00228
00237
00246
00255
00264
00273
00282
00291
Query
// ...
  |> chandeMomentumOscillator(n: 10)
Output table
_time_value
0011100
0012100
0013100
0014100
0015100
001680
001760
001840
001920
00200
0021-20
0022-40
0023-60
0024-80
0025-100
0026-100
0027-100
0028-100
0029-100