Log in to see Cloud of Tags

Wealth-Lab Wiki

TASC 2015-09 | Decyclers (Ehlers)

RSS

Traders' Tip text

In this issue, Dr. John Ehlers shares two new "decycler" indicators whose main feature is ability to identify trends with virtually zero lag.

To demonstrate the timely response of Decycler oscillator to market action, the enclosed long-only trading system applies the idea of using a Decycler oscillator pair with different parameters as per the article:

  • Enter long when the yellow line crosses over the red line
  • Exit long when the yellow line crosses under the red line

On the price pane, the decycler is plotted along with the hysteresis lines (+/- 0.5 percent). The green background indicates an uptrend in the market (the prices are above the upper hysteresis line) and the red background indicates a downtrend (the prices are below the lower hysteresis line). The bottom pane illustrates trend detection according to the pair of Decycler oscillators. The yellow line has a period of 100 a K value of 1.2 and the red line has a period of 125 and a K value of 1.

Image

Figure 1. The price pane shows the decycler indicator with the hysteresis lines. The bottom pane plots a pair of decycler oscillators.

As can be seen on Figure 1, robust application of the indicators in a trading system require putting in some logic against whipsaw conditions such as from March’2015 to June'2015.

To execute the included trading system, Wealth-Lab users need to install (or update to) the latest version of the TASCIndicators library from the Extensions section of our website if they haven't already done so, and restart Wealth-Lab.

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

namespace WealthLab.Strategies { public class MyStrategy : WealthScript { protected override void Execute() { // Decycler and oscillator SimpleDecycler sd = SimpleDecycler.Series(Close,125); DecyclerOscillator do1 = DecyclerOscillator.Series(Close,125,1.0); // Hysteresis band 0.5% DecyclerOscillator do2 = DecyclerOscillator.Series(Close,(int)(125 * 0.8),1.0 * 1.2);

HideVolume(); ChartPane paneDecyclerOsc = CreatePane(30,false,true); PlotSeries(paneDecyclerOsc,do1,Color.Red,LineStyle.Solid,2); PlotSeries(paneDecyclerOsc,do2,Color.Goldenrod,LineStyle.Solid,2); PlotSeries(PricePane,sd,Color.Red,LineStyle.Solid,2); PlotSeriesFillBand(PricePane, sd * 1.005, sd * 0.995, Color.Goldenrod, Color.Transparent, LineStyle.Solid, 2);

for(int bar = GetTradingLoopStartBar(125); bar < Bars.Count; bar++) { if ( Close[bar] > (sd[bar] * 1.005) ) SetPaneBackgroundColor( PricePane, bar, Color.FromArgb(30,Color.Green) );

else if ( Close[bar] < (sd[bar] * 0.995) ) SetPaneBackgroundColor( PricePane, bar, Color.FromArgb(30,Color.Red) );

bool reverse2Uptrend = CrossOver( bar, do2, do1 ); bool reverse2Downtrend = CrossUnder( bar, do2, do1 ); if (IsLastPositionActive) { if ( !reverse2Downtrend || reverse2Uptrend ) SetPaneBackgroundColor( paneDecyclerOsc, bar, Color.FromArgb(30,Color.Green) ); if( reverse2Downtrend ) SellAtMarket(bar+1, LastPosition); } else { if ( reverse2Downtrend || !reverse2Uptrend ) SetPaneBackgroundColor( paneDecyclerOsc, bar, Color.FromArgb(30,Color.Red) );

if( reverse2Uptrend ) BuyAtMarket(bar+1); } } } } }

Eugene
Wealth-Lab team
www.wealth-lab.com

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.