The augment_cmo function calculates the Chande Momentum Oscillator (CMO) for a given financial instrument using either pandas or polars engine, and returns the augmented DataFrame.
The data parameter is the input data that can be either a pandas DataFrame or a pandas DataFrameGroupBy object. It contains the data on which the Chande Momentum Oscillator (CMO) will be calculated.
required
date_column
str
The name of the column in the data that contains the dates or timestamps.
required
close_column
str
The close_column parameter is used to specify the column in the input data that contain the values on which the CMO will be calculated.
required
periods
Union[int, Tuple[int, int], List[int]]
The periods parameter in the augment_cmo function specifies the number of rolling periods over which the Chande Momentum Oscillator (CMO) is calculated. It can be provided as an integer, a tuple of two integers (start and end periods), or a list of integers.
14
reduce_memory
bool
The reduce_memory parameter is a boolean flag that indicates whether or not to reduce the memory usage of the data before performing the CMO calculation. If set to True, the function will attempt to reduce the memory usage of the input data. If set to False, the function will not attempt to reduce the memory usage of the input data.
False
engine
str
The engine parameter specifies the computation engine to use for calculating the Chande Momentum Oscillator (CMO). It can take two values: โpandasโ or โpolarsโ.
'pandas'
Returns
Type
Description
pd.DataFrame
The function augment_cmo returns a pandas DataFrame that contains the augmented data with the Chande Momentum Oscillator (CMO) values added.
Notes
The Chande Momentum Oscillator (CMO), developed by Tushar Chande, is a technical analysis tool used to gauge the momentum of a financial instrument. It is similar to other momentum indicators like the Relative Strength Index (RSI), but with some distinct characteristics. Hereโs what the CMO tells us:
Momentum of Price Movements:
The CMO measures the strength of trends in price movements. It calculates the difference between the sum of gains and losses over a specified period, normalized to oscillate between -100 and +100. Overbought and Oversold Conditions:
Values close to +100 suggest overbought conditions, indicating that the price might be too high and could reverse. Conversely, values near -100 suggest oversold conditions, implying that the price might be too low and could rebound. Trend Strength:
High absolute values (either positive or negative) indicate strong trends, while values near zero suggest a lack of trend or a weak trend. Divergences:
Divergences between the CMO and price movements can be significant. For example, if the price is making new highs but the CMO is declining, it may indicate weakening momentum and a potential trend reversal. Crossing the Zero Line:
When the CMO crosses above zero, it can be seen as a bullish signal, whereas a cross below zero can be interpreted as bearish. Customization:
The period over which the CMO is calculated can be adjusted. A shorter period makes the oscillator more sensitive to price changes, suitable for short-term trading. A longer period smooths out the oscillator for a longer-term perspective. Itโs important to note that while the CMO can provide valuable insights into market momentum and potential price reversals, it is most effective when used in conjunction with other indicators and analysis methods. Like all technical indicators, the CMO should not be used in isolation but rather as part of a comprehensive trading strategy.