public Median(DataSeries source, int period, string description) public static Median 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() { DataSeries hMedFast = Median.Series( Close, 13 ); DataSeries hMedSlow = Median.Series( Close, 25 ); PlotSeries( PricePane, hMedFast, Color.Brown, WealthLab.LineStyle.Solid, 2 ); PlotSeries( PricePane, hMedSlow, Color.Black, WealthLab.LineStyle.Solid, 2 ); for(int bar = 25; bar < Bars.Count; bar++) { if( CrossOver( bar, hMedFast, hMedSlow ) ) BuyAtMarket( bar+1 ); else if( CrossUnder( bar, hMedFast, hMedSlow ) ) SellAtMarket( bar+1, Position.AllPositions ); } } } }