Momentum Indicator (MOM)

Indicator that compares the current price of an asset with prices from previous periods to calculate the momentum.

Momentum Indicator (MOM) compares the current price of an asset with prices from previous periods to calculate the momentum.

Trading application

A horizontal line is drawn at the central point of the indicator. The MOM line being situated above the central line suggests an uptrend, while seeing MOM line move beneath the central line can identify a downtrend.

Divergences also reflect bullish or bearish conditions: we can consider it bearish if the asset’s price increases more than the MOM (e.g. reaching a new high while the indicator doesn’t), while it would be bullish to see the asset’s price decreasing more than the MOM does.

Calculation

MOM=(PricePn)100MOM = (Price-Pn)*100

Pn = Previous price (generally 14 periods ago)

Parameters

Input Parameters

Name

Type

Range of value

Description

period

int

<1, int.MaxValue>

Number of bars used in the calculation.

Output Parameters

Indicator ouptuts a single value.

Type

Range of value

double

(0, double.MaxValue)

Examples

// Prints the current 20 period MOM value using
// the daily bars close price value.
mom = indicators.Momentum(20).OnSeries(dailyBars.Close);
Log("The current MOM value is " + mom.Value.ToString());

// Prints the previous MOM value
mom = indicators.Momentum(20).Keep(2).OnSeries(dailyBars.Close);
Log("The previous MOM value is " + mom.Values[1].ToString());

Complete example

using Signals.DataSeries.Bars;
using Signals.Framework;
using Signals.Indicators.Momentum;

public class MyStrategy : SingleMarketStrategy
{
    private Bars dailyBars;
    private Momentum mom;

    public override void Setup(DataMarketplace data, IndicatorsMarketplace indicators)
    {
        dailyBars = data.Bars(BarPeriodType.Day, 1).WithOffset(25);
        mom = indicators.Momentum(20).Keep(2).OnSeries(dailyBars.Close);
    }

    public override void RegisterActions()
    {
        OnUpdateOf(dailyBars).Do(() =>
        {   
            // Prints the current MOM value
            Log("The current MOM value is " + mom.Value.ToString());

            // Prints the previous MOM value
            Log("The previous MOM value is " + mom.Values[1].ToString());
        });
    }
}

Last updated