Log in to see Cloud of Tags

Wealth-Lab Wiki

TASC 2017-04 | Volume-Weighted Moving Average Breakouts (Calhoun)

RSS

Traders' Tip text

The Volume-Weighted Moving Average (VWMA) offers an additional dimension by using volume in addition to price. Typically, the VWMA is used in conjunction with an SMA of the same or different period.

Among the possible use cases of including the VWMA can be named:

  • avoiding false breakouts on no volume support;
  • trend direction confirmation;
  • indication of a weakening trend when it moves below the SMA;
  • a profit taking or exit signal when the distance between the VWMA and the SMA tightens, and more.

Another example is the swing-trading setup from Ken Calhoun's article: the VWMA crossing above the SMA may signal a potential bullish trend change, and the opposite crossunder is used to close the position. Please see below for WealthScript Strategy code.

Image

Figure 1. highlights a successful trade in FAS.

After updating the TASCIndicators library to v2017.03 or later, the VWMA indicator can be found under the TASC Magazine Indicators group. You can plot it on a chart or use it as an entry or exit condition in a Rule-based Strategy without having to program a line of code yourself.

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 { private StrategyParameter paramPeriodVWMA; private StrategyParameter paramPeriodSMA; public MyStrategy() { paramPeriodVWMA = CreateParameter("VWMA Period",50,2,300,1); paramPeriodSMA = CreateParameter("SMA Period",70,2,300,1); } protected override void Execute() { var sma = SMA.Series(Close,paramPeriodSMA.ValueInt); var vwma = VWMA.Series(Bars,paramPeriodVWMA.ValueInt); for(int bar = GetTradingLoopStartBar(1); bar < Bars.Count; bar++) { if (IsLastPositionActive) { if( CrossUnder(bar,vwma,sma)) SellAtMarket(bar+1, LastPosition); } else { if( CrossOver(bar,vwma,sma)) BuyAtMarket(bar+1); } } PlotSeries(PricePane,vwma,Color.Red,LineStyle.Solid,1); PlotSeries(PricePane,sma,Color.Blue,LineStyle.Solid,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.