TASC 2019-07 | Exponential Deviation Bands (Apirine)

Modified on 2019/05/30 10:57 by Eugene — Categorized as: TASC Traders Tips

Traders' Tip text

Although author Vitali Apirine hasn’t provided a trading system this time, his Exponential Deviation Bands are similar in application to other bands like the Bollinger Bands - yet more responsive to price action.

One of possible approaches to trading them is during a rangebound market. Our simple system’s concept is based on the ADX indicator’s trait. A declining ADX indicates a less directional market which may be approached with a swing trading system. In the flat market an entry can be made when the lower band is violated - and with an upsurge in the ADX ending that trade.

Entry rules


Exit rules



Image

Figure 1. Walmart was trading in ranges during our in-sample period from 1/1/2000 to 1/1/2010 (at the bottom). System was able to beat the market (see equity in the top half of the chart).


Image

Figure 2. Both good and bad example trades on the Daily chart of WMT (data provided by Yahoo).

Install (or update) the TASCIndicators library to its most-recent version from our website or using the built-in Extension Manager. Once you see "ExpDevBandLower" and "ExpDevBandUpper" listed under the TASC Magazine Indicators group they're ready for use in Wealth-Lab.



WealthScript Code (C#)

using System;
using System.Collections.Generic;
using System.Text;
using System.Drawing;
using WealthLab;
using WealthLab.Indicators;
using TASCIndicators;

namespace WealthLab.Strategies { public class TASCJuly2019 : WealthScript { private StrategyParameter paramPeriod; private StrategyParameter paramDev; private StrategyParameter paramExit;

public TASCJuly2019() { paramPeriod = CreateParameter("Period",20,10,100,10); paramDev = CreateParameter("Deviations",2,0.5,4,0.5); paramExit = CreateParameter("Exit after",10,2,40,2); } protected override void Execute() { var period = paramPeriod.ValueInt; var dev = paramDev.Value; int exitAfter = paramExit.ValueInt;

var adx = ADX.Series( Bars, period); var ma = SMA.Series( Close, period); var ebu = ExpDevBandUpper.Series( Close, period,dev,false); var ebl = ExpDevBandLower.Series( Close, period,dev,false);

ChartPane adxPane = CreatePane( 20, false, true); PlotSeries( adxPane, adx, Color.Black, LineStyle.Solid, 1); PlotSeriesFillBand( PricePane, ebl,ebu,Color.Red,Color.Transparent,LineStyle.Solid,1); PlotSeries( PricePane, ma, Color.Red, LineStyle.Solid, 1 ); HideVolume();

for(int bar = GetTradingLoopStartBar(1); bar < Bars.Count; bar++) { if (IsLastPositionActive) { Position p = LastPosition;

if (bar+1 - p.EntryBar >= exitAfter) SellAtMarket( bar+1, p, "Timed exit"); else if(adx[bar] > adx[bar - 10] ) ExitAtMarket( bar+1, p, "Trend alert"); } else { if(adx[bar] < adx[bar - period]) BuyAtLimit( bar+1, ebl[bar]); } } } } }

Gene Geren (Eugene)
Wealth-Lab team