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() { int period = 60; double d = 2; DataSeries relVol = Close*0; relVol.Description = "Relative Volume"; DataSeries theFoM = Volume*0; theFoM.Description = "Freedom of Movement"; for(int bar = 0; bar < Bars.Count; bar++) { relVolbar = RelVol.Series(Bars,period)bar > 0 ? RelVol.Series(Bars,period)bar : 0; theFoMbar = FOM.Series(Bars,period)bar > 0 ? FOM.Series(Bars,period)bar : 0; } HideVolume(); ChartPane r = CreatePane( 30,false,true ); PlotSeries( r, relVol, Color.Black, LineStyle.Histogram, 3 ); ChartPane f = CreatePane( 30,false,true ); PlotSeries( f, theFoM, Color.Black, LineStyle.Histogram, 3 ); for(int bar = 1; bar < Bars.Count; bar++) { if (relVolbar <= d) SetSeriesBarColor( bar, relVol, Color.DarkGray); if (theFoMbar < d) SetSeriesBarColor( bar, theFoM, Color.DarkGray); if (theFoMbar > d || relVolbar > d) // Draw DPLs { DrawLine(PricePane,bar,Closebar,Bars.Count-1,Closebar,Color.Blue,LineStyle.Solid,1); } } } } }