public ATRBandLower(Bars bars, DataSeries ds, int atrPeriod, double atrMult, string description) public static ATRBandLower(Bars bars, DataSeries ds, int atrPeriod, double atrMult)
using System; using System.Collections.Generic; using System.Text; using System.Drawing; using WealthLab; using WealthLab.Indicators; using Community.Indicators;namespace WealthLab.Strategies { public class MyStrategy : WealthScript { protected override void Execute() { HideVolume(); LinearReg lr = LinearReg.Series( Close,10 ); ATRBandUpper ub = new ATRBandUpper( Bars, lr, 10, 2, "My Upper ATR Band" ); ATRBandLower lb = new ATRBandLower( Bars, lr, 10, 2, "My Lower ATR Band" ); PlotSeriesFillBand( PricePane, ub, lb, Color.Transparent, Color.FromArgb( 30, Color.Blue ), LineStyle.Solid, 1 ); for(int bar = ub.FirstValidValue; bar < Bars.Count; bar++) { if (IsLastPositionActive) { Position p = LastPosition; if ( bar+1 - p.EntryBar >= 10 ) ExitAtMarket( bar+1, p, "Timed" ); } else { if( ( CumUp.Series( High,1 )bar >= 2 ) && ( Highbar > ubbar )) ShortAtMarket( bar + 1 ); else if( ( CumDown.Series( Low,1 )bar >= 2 ) && ( Lowbar < lbbar )) BuyAtMarket( bar + 1 ); } } } } }