Log in to see Cloud of Tags

Wealth-Lab Wiki

TASC 2013-09 | Oscillators, Smoothed (Vervoort)


Traders' Tip text

This month, Sylvain Vervoort presents a “master class” on improving well-known indicators using smoothing techniques. A combination of TEMA and WMA does a nice job smoothing out wiggles in a %b oscillator, derived from zero-lag “Rainbow” data series (SVEZLRBPercB). The same Rainbow series, averaged with the typical price, visibly smooth the traditional Stochastic K oscillator.

To illustrate the application of SVEZLRBPercB and the smoothed Stochastic K, we include a demo long-only strategy with just two basic rules: buy when the StochK crosses above from oversold territory, and sell when it leaves overbought zone. As usual, the complexity of code is hidden by including the indicators in our TASCIndicators library. To run the sample Strategy in Wealth-Lab, you'll need TASCIndicators version 2013.08 or higher. Please install (or update) the library from our website to its latest version.


Figure 1. A Wealth-Lab 6 chart illustrating the application of smoothed indicators.

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

namespace WealthLab.Strategies { public class OscillatorsSmoothed : WealthScript { protected override void Execute() { HideVolume(); ChartPane cp = CreatePane( 40,true,true ); SVERBStochK K = SVERBStochK.Series(Bars,30,3); SVEZLRBPercB PB = SVEZLRBPercB.Series(Bars,3,18); PlotSeries( cp, PB, Color.DodgerBlue, LineStyle.Solid, 3 ); PlotSeriesOscillator( cp, K, 80, 20, Color.FromArgb(40, Color.Red), Color.FromArgb(40, Color.Blue), Color.Red, LineStyle.Solid, 2 );

for(int bar = GetTradingLoopStartBar(18); bar < Bars.Count; bar++) { if (IsLastPositionActive) { if( CrossUnder( bar, K, 80 ) ) SellAtMarket( bar+1, LastPosition ); } else { if( CrossOver( bar, K, 20 ) ) BuyAtMarket( bar+1 ); } } } } }

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.