Log in to see Cloud of Tags

Wealth-Lab Wiki

TASC 2019-07 | Exponential Deviation Bands (Apirine)

RSS

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

  • Buy at limit at the Lower Exponential Deviation Band if ADX is less than it was 10 bars ago.

Exit rules

  • Sell on the open after 10 bars in the trade.
  • Sell on the open if the ADX rises above its value 10 bars ago.


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

Important Disclaimer: The information provided by Wealth-Lab is strictly for informational purposes and is not to be construed as advice or solicitation to buy or sell any security.  The owner of Wealth-Lab.com assumes no liability resulting from the use of the material contained herein for investment purposes. By using this web site, you agree to the terms of this disclaimer and our Terms of Use.


ScrewTurn Wiki. Some of the icons created by FamFamFam.