public ROC(DataSeries source, int period, string description) public static ROC Series(WealthLab.DataSeries source, int period) public static double Value(int bar, DataSeries source, 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 system is based on a smoothed Rate of Change. Entry occurs when smoothed ROC rises above zero. The long Position is closed when the smoothed ROC turns down. */ DataSeries roc = ROC.Series( Close, 40 ); DataSeries SMARoc = SMA.Series( roc, 14 ); ChartPane ROCPane = CreatePane( 35, true, true ); PlotSeries( ROCPane, roc, Color.DarkBlue, WealthLab.LineStyle.Histogram, 3 ); PlotSeries( ROCPane, SMARoc, Color.Black, WealthLab.LineStyle.Dotted, 2 ); for(int bar = 54; bar < Bars.Count; bar++) { if (IsLastPositionActive) { if( TurnDown( bar, SMARoc ) ) SellAtMarket( bar+1, LastPosition ); } else { if( CrossOver( bar, SMARoc, 0 ) ) BuyAtMarket( bar+1 ); } } } } }