using System; using System.Collections.Generic; using System.Text; using System.Drawing; using WealthLab; using WealthLab.Indicators;namespace WealthLab.Strategies { public class TMV_1202Star : WealthScript { protected override void Execute() { DataSeries K1 = KeltnerLower.Series( Bars, 13, 13 ); DataSeries K2 = KeltnerUpper.Series( Bars, 13, 13 ); ADX adx = ADX.Series( Bars,10 ); SMA sma = SMA.Series( Close,8 ); DataSeries OscV = (SMA.Series( Volume,20 ) - Volume)/SMA.Series( Volume,20 ) * 100; OscV.Description = "Volume Oscillator"; DataSeries cci = CCI.Series( Bars, 13 ); ChartPane cPane = CreatePane( 30, true, true ); ChartPane oPane = CreatePane( 30, false, true ); SetBarColors( Color.DarkGray,Color.DarkGray ); PlotSeries( PricePane, SMA.Series( Close,13 ), Color.Red, LineStyle.Solid, 1); PlotSeriesFillBand( PricePane, K1, K2, Color.Red, Color.Empty, LineStyle.Solid, 1); PlotSeriesOscillator( oPane, OscV, 50, -50, Color.Blue, Color.Red, Color.Empty, LineStyle.Histogram, 2); PlotSeries( oPane, OscV, Color.Black, LineStyle.Solid, 2); PlotSeries( cPane, cci, Color.Purple, LineStyle.Histogram, 3 ); DrawHorzLine( cPane, -100, Color.Red, LineStyle.Dashed, 1 ); DrawHorzLine( cPane, 100, Color.Blue, LineStyle.Dashed, 1 ); for(int bar = GetTradingLoopStartBar(30); bar < Bars.Count; bar++) { bool adxPriceRising = adx[bar] > adx[bar-1] && Close[bar] > sma[bar]; bool adxPriceFalling = adx[bar] > adx[bar-1] && Close[bar] < sma[bar]; if( adxPriceRising ) SetBarColor( bar, Color.LightGreen ); else if( adxPriceFalling ) SetBarColor( bar, Color.Red ); } } } }