Syntax
public static void PriceVolumeDist(this WealthScript obj, int Lookback, Color LineColor, Color FillColor)
public void PriceVolumeDist( int Lookback, System.Color LineColor, System.Color FillColor );
Parameter Description
Lookback | Number of bars used in the distribution |
LineColor | Outline color of the distribution bars. For no outline, pass the same color as FillColor |
FillColor | Fill color of the distibution bars |
Description
A price-volume distribution is the total volume traded in price ranges (or bins) displayed in relative terms as horizontal bars alongside the right chart axis. The price-volume distribution is calculated for the number of bars specified in the
Lookback parameter, as described in the example.
Originally created by Robert Sucher and Dion Kurczek.
Example
The following example plots the Price Volume Distribution with blue lines and a light blue background for the most recent 250 bars:
Price Volume Distribution (Crude Oil continuous contract) |
Example using C# extension methods:
using System;
using System.Collections.Generic;
using System.Text;
using System.Drawing;
using WealthLab;
using WealthLab.Indicators;
namespace WealthLab.Strategies
{
public class PriceVolumeDistribution_Test : WealthScript
{
protected override void Execute()
{
Color LineColor = Color.Blue;
Color FillColor = Color.FromArgb( 30, Color.Blue );
int Lookback = 250;
if( Bars.Count < Lookback ) return;
this.PriceVolumeDist( Lookback, LineColor, FillColor );
}
}
}
Legacy syntax example:
using System;
using System.Collections.Generic;
using System.Text;
using System.Drawing;
using WealthLab;
using WealthLab.Indicators;
using Community.Components; /*** Requires installation of Community.Components Extension from www.wealth-lab.com > Extensions ***/
namespace WealthLab.Strategies
{
public class PriceVolumeDistribution_Test : WealthScript
{
protected override void Execute()
{
Calculate c = new Calculate( this );
Color LineColor = Color.Blue;
Color FillColor = Color.FromArgb( 30, Color.Blue );
int Lookback = 250;
if( Bars.Count < Lookback ) return;
c.PriceVolumeDist( Lookback, LineColor, FillColor );
}
}
}