using System; using System.Collections.Generic; using System.Text; using System.Drawing; using WealthLab; using WealthLab.Indicators; using TASCIndicators;namespace WealthLab.Strategies { public class TASC201602 : WealthScript { private StrategyParameter slider1; private StrategyParameter slider2; private StrategyParameter slider3; public TASC201602() { slider1 = CreateParameter("HHS Period",20,10,100,10); slider2 = CreateParameter("LLS Period2",20,10,100,10); slider3 = CreateParameter("Smooth HHLLS",3,1,10,1); } protected override void Execute() { var hhs = SMA.Series( HHS.Series(Bars,slider1.ValueInt), slider3.ValueInt); var lls = SMA.Series( LLS.Series(Bars,slider2.ValueInt), slider3.ValueInt); hhs.Description = "Smoothed HHS"; lls.Description = "Smoothed LLS"; for(int bar = GetTradingLoopStartBar(20); bar < Bars.Count; bar++) { if (IsLastPositionActive) { if( CrossUnder(bar,hhs,lls)) SellAtMarket(bar+1, LastPosition); } else { if( CrossOver(bar,hhs,lls)) BuyAtMarket(bar+1); } } ChartPane paneHHLLS1 = CreatePane(40,true,true); PlotSeries(paneHHLLS1,hhs,Color.Green,LineStyle.Solid,1); PlotSeries(paneHHLLS1,lls,Color.Red,LineStyle.Solid,1); HideVolume(); } } }