public Kalman(DataSeries source, string description) public static Kalman Series(DataSeries source)
using System; using System.Collections.Generic; using System.Text; using System.Drawing; using WealthLab; using WealthLab.Indicators;namespace WealthLab.Strategies { public class KalmanDemo : WealthScript { protected override void Execute() { DataSeries Average = ( High + Low ) / 2; DataSeries hCMO = CMO.Series( Average, 14 ); ChartPane CMOPane = CreatePane( 40, true, true ); PlotSeries( CMOPane, hCMO, Color.Blue, LineStyle.Solid, 3 ); PlotSeries( CMOPane, Kalman.Series( hCMO ), Color.Black, LineStyle.Solid, 2 ); for(int bar = 20; bar < Bars.Count; bar++) { if (IsLastPositionActive) { if( CrossOver( bar, hCMO, 0 ) ) SellAtMarket( bar+1, LastPosition, "CMO 0" ); } else { if( ( CMO.Value( bar-1, Average, 14 ) < -50 ) & CrossOver( bar, hCMO, Kalman.Series( hCMO ) ) ) BuyAtMarket( bar+1, "CMO Kalman" ); } } } } }