public DSS(Bars bars, int period1, int period2, int stochP, string description) public static DSS Series(Bars bars, int period1, int period2, int stochP)
using System; using System.Collections.Generic; using System.Text; using System.Drawing; using WealthLab; using WealthLab.Indicators;namespace WealthLab.Strategies { public class MyStrategy : WealthScript { protected override void Execute() { // Buy when DSS turns up from an oversold level DataSeries dss = DSS.Series( Bars, 10, 20, 5 ); ChartPane DSSPane = CreatePane( 50, true, true ); PlotSeries( DSSPane, dss, Color.Crimson, LineStyle.Solid, 2 ); // DSS is considered "unstable" due to the inner use of EMA for(int bar = 60; bar < Bars.Count; bar++) { if (!IsLastPositionActive) { if( ( TurnUp( bar, dss ) ) & ( dss[bar-1] < 24 ) ) BuyAtMarket( bar+1, "DSS" ); } else { if( TurnDown( bar, dss ) ) SellAtMarket( bar+1, LastPosition, "DSS" ); } } } } }