public CMF(Bars bars, int period, string description) public static CMF Series(Bars bars, 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 { // Thank you fundtimer public Color WS4ColorToNET( double WS4Color ) { return Color.FromArgb( (int)Math.Floor( ( WS4Color % 1000 ) / 100 * 28.4 ), (int)Math.Floor( ( WS4Color % 100 ) / 10 * 28.4 ), (int)Math.Floor( WS4Color % 10 * 28.4 ) ); } protected override void Execute() { // Use strength of CMF above zero to color bars double x = 0; ChartPane CMFPane = CreatePane( 40, true, true ); PlotSeries( CMFPane, CMF.Series( Bars, 20 ), Color.Blue, WealthLab.LineStyle.Histogram, 1 ); SetBarColors( Color.Silver, Color.Silver ); for(int bar = 20; bar < Bars.Count; bar++) { x = CMF.Series( Bars, 20 )[bar] * 20; if( x > 0 ) SetBarColor( bar, WS4ColorToNET( x ) ); } } } }