Traders' Tip text
The Anchored VWAP Channel indicators, MidasUpper and MidasLower, can be found in Wealth-Lab’s TASCIndicators library June update. The script provided here provides the simple visual method to use the channel by using the sliders to assign bar numbers to the start and swing points. Arrows indicate the current channel’s anchor points. Since we’re dealing with bar numbers, use the sliders for coarse adjustment and fine tune by specifying a parameter’s bar number, as shown. One approach to objectively evaluating the channel might be to identify the first X% swing points at the start of each trading day, and developing a breakout strategy based on channel support and resistance.
Figure 1. Although the channel appears to have some predictive power, subjective determination of the start and swing points (arrows) clearly influence the outcome.
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 AnchoredVWAPChannel : WealthScript
{
private StrategyParameter _startBar;
private StrategyParameter _barsToUpper;
private StrategyParameter _barsToLower;
public AnchoredVWAPChannel()
{
_startBar = CreateParameter("Start Bar",2300,0,10000,5);
_barsToUpper = CreateParameter("Bars to Upper",23,0,200,1);
_barsToLower = CreateParameter("Bars to Lower",32,0,200,1);
}
protected override void Execute()
{
int startBar = _startBar.ValueInt;
int barsToUpper = _barsToUpper.ValueInt;
int barsToLower = _barsToLower.ValueInt;
Font font = new Font("Wingdings", 8, FontStyle.Bold);
string upArrow = Convert.ToChar(0x00E9).ToString();
string dnArrow = Convert.ToChar(0x00EA).ToString();
AnnotateBar(upArrow, startBar + barsToLower, false, Color.Green, Color.Transparent, font);
AnnotateBar(dnArrow, startBar + barsToUpper, true, Color.Red, Color.Transparent, font);
PlotSeries(PricePane,MidasLower.Series(Bars, startBar, barsToLower),Color.Black,LineStyle.Solid,1);
PlotSeries(PricePane,MidasUpper.Series(Bars, startBar, barsToUpper),Color.Black,LineStyle.Solid,1);
}
}
}