MomentumPct

Modified on 2008/05/03 08:43 by Administrator — Categorized as: Standard Indicators

Syntax

public MomentumPct(DataSeries source, int period, string description)
public static MomentumPct Series(DataSeries source, int period)
public static double Value(int bar, DataSeries source, int period)

Parameter Description

source Price series
period Indicator calculation period

Description

MomentumPct is the current price divided by the price of a previous period and the quotient is multiplied by 100. The result is an indicator that oscillates around 100. Values less than 100 indicate negative momentum, or decreasing price, and vice versa.

Interpretation


Calculation

MomentumPct = 100 * Pricetoday / Pricen periods ago

Example

using System;
using System.Collections.Generic;
using System.Text;
using System.Drawing;
using WealthLab;
using WealthLab.Indicators;

namespace WealthLab.Strategies { public class MyStrategy : WealthScript { protected override void Execute() { // Duplicate the MomentumPctSeries calculation int Period = 20; DataSeries hTmp = ( Close >> Period ); DataSeries hMomPct = ( Close/hTmp ) * 100;

ChartPane MomPctPane = CreatePane( 30, true, true ); PlotSeries( MomPctPane, hMomPct, Color.Red, WealthLab.LineStyle.Solid, 2 ); PlotSeries( MomPctPane, MomentumPct.Series( Close, Period ), Color.Black, WealthLab.LineStyle.Solid, 2 ); } } }