public RevEngSMA_TC(DataSeries ds, int period1, int period2, string description) public static RevEngSMA_TC Series(DataSeries ds, int period1, int period2)
using System; using System.Collections.Generic; using System.Text; using System.Drawing; using WealthLab; using WealthLab.Indicators; using TASCIndicators;namespace WealthLab.Strategies { public class MyStrategy : WealthScript { protected override void Execute() { LineStyle LS = LineStyle.Solid; DataSeries tc = RevEngSMA_TC.Series(Close, 20, 50); DataSeries sma1 = SMA.Series(Close, 20); DataSeries sma2 = SMA.Series(Close, 50); ChartPane tcPane = CreatePane( 50, true, true ); // Plot the Close with the RevEngSMA_TC to observe the crossovers PlotSeries(tcPane, Close, Color.Black, LS, 1); PlotSeries(tcPane, tc, Color.Blue, LS, 1); // Plot the SMAs as you normally would in the PricePane PlotSeries(PricePane, sma1, Color.Green, LS, 1); PlotSeries(PricePane, sma2, Color.Red, LS, 1); // Highlight the crossovers of Close and RevEngSMA_TC for (int bar = 50; bar < Bars.Count; bar++) { if( CrossOver(bar, Close, tc) || CrossUnder(bar, Close, tc) ) SetBackgroundColor(bar, Color.Beige); } } } }