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 (Date[bar].Month == 5) SellAtMarket(bar + 1, p); } else { if (Date[bar].Month == 10 && Close[bar] > sma[bar] ) BuyAtMarket(bar + 1); } } } } }