public static WMA Series(DataSeries ds, int period) public static double Value(int bar, DataSeries ds, int period) public WMA(DataSeries ds, int period, string description)
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 sample system acts on crossovers of 60 and 80 period WMAs DataSeries WMASlow = WMA.Series( Close, 80 ); DataSeries WMAFast = WMA.Series( Close, 60 ); PlotSeries( PricePane, WMAFast, Color.Blue, LineStyle.Solid, 1 ); PlotSeries( PricePane, WMASlow, Color.Red, WealthLab.LineStyle.Solid, 1 ); for(int bar = 80; bar < Bars.Count; bar++) { if (IsLastPositionActive) { if( CrossUnder( bar, WMAFast, WMASlow ) ) SellAtMarket( bar+1, LastPosition ); else SellAtLimit( bar+1, LastPosition, LastPosition.EntryPrice*1.2 ); } else { if( CrossOver( bar, WMAFast, WMASlow ) ) BuyAtMarket( bar+1 ); } } } } }