using System; using System.Collections.Generic; using System.Text; using System.Drawing; using WealthLab; using WealthLab.Indicators;namespace WealthLab.Strategies { public class GardnerSeasonal : WealthScript { StrategyParameter _period; public GardnerSeasonal() { _period = CreateParameter("Period", 50, 10, 100, 5); } protected override void Execute() { DataSeries sma = SMA.Series(Close, _period.ValueInt); PlotSeries(PricePane, sma, Color.Blue, LineStyle.Solid, 2); for(int bar = GetTradingLoopStartBar(5); bar < Bars.Count; bar++) { if (IsLastPositionActive) { Position p = LastPosition; if (Datebar.Month == 5) SellAtMarket(bar + 1, p); } else { if (Datebar.Month == 10 && Closebar > smabar ) BuyAtMarket(bar + 1); } } } } }