Log in to see Cloud of Tags

Wealth-Lab Wiki

TASC 2013-04 | Low Frequency Trading (McEwan)


Traders' Tip text

Note: requires MS123 IndexDefinitions extension v2013.05 or higher

In this month's issue, Ron McEwan introduces a formula that loosely resembles another market breadth indicator known as the “Swenlin Trading Oscillator” (STO). Created by Carl Swenlin, it's intended to be an overbought/oversold indicator that can assist in identifying short-term tops and bottoms.

Both market breadth indices start with the same basic component: the daily percent change of advancers/decliners multiplied by 1000. But unlike the STO that double smoothes it by applying a 4-day exponential moving average of the result and then a 5-day simple moving average on it, the index by Mr. McEwan first cumulates the value and then smooths it with a one-year SMA. This automatically turns it into a long-term indicator, since the rationale behind its creation is to present a less stressful way of trading.


Figure 1. A Wealth-Lab 6.4 chart showing Ron McEwan's market breadth index applied to a Daily chart. The indicator is built against the Dow 30 stocks. Selling opportunities are highlighted in red, and bullish trends – in green.

There's no reason not to apply the market breadth formula to any custom portfolio, not just NYSE stocks. By adjusting the SMA period, motivated traders can experiment with a different investment horizon.

To use the index as a component of a Wealth-Lab trading system, perform these easy steps:
  1. Install the MS123 IndexDefinitions library from the Extensions section of our website www.wealth-lab.com and restart Wealth-Lab.
  2. In the "Index-Lab" tool, select a DataSet of the Dow 30 stocks (or NYSE, or your favorite watchlist) and pick “Low Frequency Trading” from the list of available indices to create the customized index. Type in “LFT_DOW_30” as the Index Name. See Figure 2 for an illustration.
  3. Copy/paste the included Strategy's C# code or simply let Wealth-Lab do the job: in “Open Strategy” dialog, click “Download” to get the strategy code.


Figure 2. The Index-Lab dialog for creating the configurable "LFT" index.

WealthScript Code (C#)

using System;
using System.Text;
using System.Drawing;
using WealthLab;
using WealthLab.Indicators;

namespace WealthLab.Strategies { public class LFT_demo : WealthScript { protected override void Execute() { DataSeries lftRaw = GetExternalSymbol("%LFT_DOW_30",true).Volume; DataSeries lft = GetExternalSymbol("%LFT_DOW_30",true).Close; lftRaw.Description = "Cumulative A/D (Dow 30)"; lft.Description = "1 Yr Average Cumulative A/D (Dow 30)";

HideVolume(); ChartPane lftPane = CreatePane( 70,true,true ); PlotSeries( lftPane, lftRaw, Color.DarkBlue, LineStyle.Solid, 2); PlotSeries( lftPane, lft, Color.DarkRed, LineStyle.Solid, 2); for(int bar = lft.FirstValidValue; bar < Bars.Count; bar++) { bool buy = lftRaw[bar] > lft[bar]; bool sell = lftRaw[bar] < lft[bar]; if( sell ) SetBackgroundColor( bar, Color.FromArgb( 30, Color.Red ) ); if( buy ) SetBackgroundColor( bar, Color.FromArgb( 30, Color.Green ) ); } } } }

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.