public public BressertDSS(Bars bars, int periodStochastic, int periodEMA, string description) public static BressertDSS Series(Bars bars, int periodStochastic, int periodEMA)
using System; using System.Collections.Generic; using System.Text; using System.Drawing; using WealthLab; using WealthLab.Indicators; using Community.Indicators; /* Requires installation of Community Indicators extension */namespace WealthLab.Strategies { public class MyStrategy : WealthScript { protected override void Execute() { //A system based on BressertDSS Levels var r = 13; var n = 8; var b = BressertDSS.Series(Bars, r, n); ChartPane bp = CreatePane(30,false,true); PlotSeries(bp,b,Color.CadetBlue,LineStyle.Solid,2); DrawHorzLine(bp,20,Color.Red,LineStyle.Dashed,1); DrawHorzLine(bp,80,Color.Blue,LineStyle.Dashed,1); for(int bar = GetTradingLoopStartBar(r); bar < Bars.Count; bar++) { if( CrossUnder( bar, b, 20 ) ) BuyAtMarket( bar+1 ); if ( ( ActivePositions.Count > 0 ) && CrossOver( bar, b, 20 ) ) { for( int p = ActivePositions.Count - 1; p > -1 ; p-- ) SellAtMarket( bar+1, ActivePositionsp ); } } } } }