Syntax
public McGinleyDynamic(DataSeries ds, int period, string description)
public static McGinleyDynamic Series(DataSeries ds, int period)
Parameter Description
ds | Data series |
period | Lookback period |
Description
The McGinley Dynamic Indicator is a moving average with a volatility filter designed to further smooth out the price action. It would be used similar to a moving average.
Interpretation
Use it like you would use other moving averages.
Calculation
The indicator is calculated using the following simplified formula:
Yesterday's EMA + ( ( Today's close - Yesterday's EMA ) / ( Today's close / Yesterday's EMA * 125 ) )Example
This example compares McGinley Dynamic Indicator with a simple moving average of the same period:
using System;
using System.Collections.Generic;
using System.Text;
using System.Drawing;
using WealthLab;
using WealthLab.Indicators;
using Community.Indicators;
namespace WealthLab.Strategies
{
public class MyStrategy : WealthScript
{
private StrategyParameter paramPeriod;
public MyStrategy()
{
paramPeriod = CreateParameter("Period", 10, 2, 100, 2);
}
protected override void Execute()
{
int period = paramPeriod.ValueInt;
McGinleyDynamic mcgd = McGinleyDynamic.Series( Close,period );
PlotSeries( PricePane, mcgd, Color.Blue, LineStyle.Solid, 1 );
PlotSeries( PricePane, SMA.Series( Close,period ), Color.Red, LineStyle.Solid, 1 );
}
}
}