WeightedMovingAverage


Summary

The Weighted Moving Average is a moving average that gives more weith to the latest values.

Syntax

public interface WeightedMovingAverage : MovingAverage, IIndicator

Members

NameTypeSummary
Result PropertyThe resulting time series of the WeightedMovingAverage Indicator calculation

Example 1

private WeightedMovingAverage _weightedMovingAverage;
protected override void OnStart()
{
    _weightedMovingAverage = Indicators.WeightedMovingAverage(Source, Period);
}
protected override void OnTick()
{
    if(Trade.IsExecuting)
        return;
    int index = MarketSeries.Close.Count - 1;
    if(Symbol.Bid > _weightedMovingAverage.Result[index])
    {
        Trade.CreateMarketOrder(TradeType.Buy, Symbol, Volume);
    }
 }