public Momentum(DataSeries ds, int period, string description) public static Momentum Series(DataSeries ds, int period) public static double Value(int bar, DataSeries ds, int period)
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() { // This Strategy plots absolute momentum, and calculates momentum as a percentage of current price. DataSeries mom30 = Momentum.Series( Close, 30 ); mom30.Description = "Standard Momentum"; DataSeries MomPct = mom30/Close; MomPct *= 100; MomPct.Description = "Percentage Momentum"; ChartPane MomPane = CreatePane( 30, true, true ); ChartPane MomPctPane = CreatePane( 30, true, true ); PlotSeries( MomPane, mom30, Color.Black, WealthLab.LineStyle.Histogram, 3 ); PlotSeries( MomPctPane, MomPct, Color.Black, WealthLab.LineStyle.Histogram, 3 ); } } }