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() { var ama = AMA.Series( Bars, 10); var kama = KAMA.Series( Close, 10); PlotSeries( PricePane, ama,Color.Red,LineStyle.Solid,2); PlotSeries( PricePane, kama,Color.DarkGreen,LineStyle.Solid,2); for(int bar = GetTradingLoopStartBar(11 * 3); bar < Bars.Count; bar++) { if ( IsLastPositionActive ) { Position p = LastPosition; if ( CrossUnder( bar, ama, kama)) SellAtMarket( bar + 1, p); } else { if ( CrossOver( bar, ama, kama)) BuyAtMarket( bar + 1); } } } } }