public CMO(DataSeries source, int period, string description) public static CMO Series(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 simple system buys when CMO is oversold, and sells when CMO is overbought */ for(int bar = 20; bar < Bars.Count; bar++) { if (IsLastPositionActive) { if( CMO.Value( bar, Close, 20 ) > 45 ) SellAtMarket( bar+1, LastPosition, "CMO Exit" ); } else { if( CMO.Series( Close, 20 )bar < -55 ) BuyAtMarket( bar+1, "CMO Entry" ); } } } } }