using System; using System.Collections.Generic; using System.Text; using System.Drawing; using WealthLab; using WealthLab.Indicators; using TASCIndicators;namespace WealthLab.Strategies { public class OscillatorsSmoothed : WealthScript { protected override void Execute() { HideVolume(); ChartPane cp = CreatePane( 40,true,true ); SVERBStochK K = SVERBStochK.Series(Bars,30,3); SVEZLRBPercB PB = SVEZLRBPercB.Series(Bars,3,18); PlotSeries( cp, PB, Color.DodgerBlue, LineStyle.Solid, 3 ); PlotSeriesOscillator( cp, K, 80, 20, Color.FromArgb(40, Color.Red), Color.FromArgb(40, Color.Blue), Color.Red, LineStyle.Solid, 2 ); for(int bar = GetTradingLoopStartBar(18); bar < Bars.Count; bar++) { if (IsLastPositionActive) { if( CrossUnder( bar, K, 80 ) ) SellAtMarket( bar+1, LastPosition ); } else { if( CrossOver( bar, K, 20 ) ) BuyAtMarket( bar+1 ); } } } } }