Examples of accessing volume profile values

Questions about MultiCharts .NET and user contributed studies.
Abhi
Posts: 25
Joined: 28 Nov 2015
Has thanked: 5 times
Been thanked: 1 time

Examples of accessing volume profile values

Postby Abhi » 19 Jan 2019

Sorry a very daft question, are there more examples on how to access volume profile values. Agreed that .NET is a steep learning curve compared to easy language, but without more examples it is very difficult to code on your own for simply plotting VAH and VAL on a scanner.

There is only one example that is on the below volume profile wiki page, unless there are more examples of say plotting yesterday's VAH and VAL it is an uphill task to plot simple values.

https://www.multicharts.com/trading-sof ... me_Profile

Easy language was easier but there are quite a lot of examples on TS forums to help do your coding.


Abhi
Posts: 25
Joined: 28 Nov 2015
Has thanked: 5 times
Been thanked: 1 time

Re: Examples of accessing volume profile values

Postby Abhi » 27 Jan 2019

Thanks Henry, it looks like you can get the values of volume profile on a chart. You cannot get the values of VP on a watch list. Is it a true conclusion.

Abhi
Posts: 25
Joined: 28 Nov 2015
Has thanked: 5 times
Been thanked: 1 time

Re: Examples of accessing volume profile values

Postby Abhi » 27 Jan 2019

Here is the code. Please help Henry :)

using System;
using System.Drawing;
using System.Linq;
using PowerLanguage.Function;

namespace PowerLanguage.Indicator
{
[SameAsSymbol(true)]
[UpdateOnEveryTick(true)]
[SkipIdenticalTicks(false)]
public class AG_Volume_Profile : IndicatorObject
{

public AG_Volume_Profile(object _ctx):base(_ctx)
{
}

private IPlotObject PreviousRange, CurrentRange, PreviousBullishBar, CurentBullishBar, PreviousBearishBar, CurentBearishBar, PreviousVolume, CurrentVolume ;

private EResolution resolution;

private double VolumeValue;



protected override void Create()
{



PreviousRange = AddPlot(new PlotAttributes("PrevRange", EPlotShapes.Point,Color.Yellow, Color.Empty, 4,0,true));
CurrentRange = AddPlot(new PlotAttributes("CurrRange", EPlotShapes.Point,Color.Yellow, Color.Empty, 4,0,true));


PreviousBullishBar = AddPlot(new PlotAttributes("PrevBullBar", EPlotShapes.Point,Color.Green, Color.Empty, 4,0,true));
CurentBullishBar = AddPlot(new PlotAttributes("CurrBullBar", EPlotShapes.Point,Color.Green, Color.Empty, 4,0,true));


PreviousBearishBar = AddPlot(new PlotAttributes("PrevBearBar", EPlotShapes.Point,Color.Red, Color.Empty, 4,0,true));
CurentBearishBar = AddPlot(new PlotAttributes("CurrBearBar", EPlotShapes.Point,Color.Red, Color.Empty, 4,0,true));


PreviousVolume = AddPlot(new PlotAttributes("CurrVol", EPlotShapes.Point,Color.White, Color.Empty, 4,0,true));
CurrentVolume = AddPlot(new PlotAttributes("PrevVol", EPlotShapes.Point,Color.White, Color.Empty, 4,0,true));
}

protected override void StartCalc()
{
ExecInfo.MaxBarsBack = 3;

resolution = Bars.Info.Resolution.Type;

if ( resolution == EResolution.Day )
{
VolumeValue = 750000;
}

if ( resolution == EResolution.Week )
{
VolumeValue = 3500000;
}

//VolumeProfile.EChanged += VolumeProfileOnEChanged;

}
protected override void CalcBar()
{
if (Bars.High[1] - Bars.Low[1] > 0.99)
{
PreviousRange.Set(Bars.High[1] - Bars.Low[1]);
}

if (Bars.High[0] - Bars.Low[0] > 0.99)
{
CurrentRange.Set(Bars.High[0] - Bars.Low[0]);
}


PreviousBullishBar.Set(Bars.High[1] - Bars.Close[1]);
CurentBullishBar.Set(Bars.High[0] - Bars.Close[0]);




PreviousBearishBar.Set(Bars.Close[1] - Bars.Low[1]);
CurentBearishBar.Set(Bars.Close[0] - Bars.Low[0]);



if (Bars.Volume[1] > VolumeValue)
{
PreviousVolume.Set(Bars.Volume[1]/1000000);
}

if (Bars.Volume[0] > VolumeValue)
{
CurrentVolume.Set(Bars.Volume[0]/1000000);
}

/*int bn = Bars.FullSymbolData.Current-1;
var vp = VolumeProfile.ItemForBar(bn);
if (vp != null)
{
//max_VA.Set((double)vp.HighVAForBar(bn).Dbl );
//min_VA.Set((double)vp.LowVAForBar(bn).Dbl );
}*/


}

/* private void VolumeProfileOnEChanged(bool full)
{
//Recalculate if the profile has been completely changed.
if (full)
this.ExecControl.Recalculate();
} */

}
}

User avatar
Henry MultiСharts
Posts: 9046
Joined: 25 Aug 2011
Has thanked: 1250 times
Been thanked: 2905 times

Re: Examples of accessing volume profile values

Postby Henry MultiСharts » 28 Jan 2019

Hello Abhi,

Please describe the specific difficulty you have with it.

Abhi
Posts: 25
Joined: 28 Nov 2015
Has thanked: 5 times
Been thanked: 1 time

Re: Examples of accessing volume profile values

Postby Abhi » 28 Jan 2019

Thanks Henry for asking, I want to display volume area high and volume area low on a watch list along with other values that I monitor. as in the screenshot below.

is it possible to do it. instead of opening each chart and check for the VAH and VAL, I want to read on the watch list.

Screenshot.png
Screenshot.png (72.6 KiB) Viewed 441 times

User avatar
Henry MultiСharts
Posts: 9046
Joined: 25 Aug 2011
Has thanked: 1250 times
Been thanked: 2905 times

Re: Examples of accessing volume profile values

Postby Henry MultiСharts » 31 Jan 2019

Abhi, accessing the Volume Profile values (like in your code above) will work on a chart with the enabled Volume Profile only. You will need to use the DataLoader in your code in order to receive the Volume Profile data in the scanner window.

Abhi
Posts: 25
Joined: 28 Nov 2015
Has thanked: 5 times
Been thanked: 1 time

Re: Examples of accessing volume profile values

Postby Abhi » 27 Feb 2019

Henry MultiСharts wrote:Abhi, accessing the Volume Profile values (like in your code above) will work on a chart with the enabled Volume Profile only. You will need to use the DataLoader in your code in order to receive the Volume Profile data in the scanner window.


Thanks Henry I saw the DataLoader example to call a symbol in the memory but I don't see an example where - from the DataLoader we have called the volume profile to load into the memory.


https://www.multicharts.com/trading-sof ... DataLoader

User avatar
Henry MultiСharts
Posts: 9046
Joined: 25 Aug 2011
Has thanked: 1250 times
Been thanked: 2905 times

Re: Examples of accessing volume profile values

Postby Henry MultiСharts » 28 Feb 2019

Abhi wrote:
Henry MultiСharts wrote:Abhi, accessing the Volume Profile values (like in your code above) will work on a chart with the enabled Volume Profile only. You will need to use the DataLoader in your code in order to receive the Volume Profile data in the scanner window.

Thanks Henry I saw the DataLoader example to call a symbol in the memory but I don't see an example where - from the DataLoader we have called the volume profile to load into the memory.
There is no ready sample code for that, please refer to the DataLoader Property in the help file (PowerLanguage .Net Editor->Help tab-> PowerLanguage .Net Help).

Abhi
Posts: 25
Joined: 28 Nov 2015
Has thanked: 5 times
Been thanked: 1 time

Re: Examples of accessing volume profile values

Postby Abhi » 06 Apr 2019

Henry MultiСharts wrote:
Abhi wrote:
Henry MultiСharts wrote:Abhi, accessing the Volume Profile values (like in your code above) will work on a chart with the enabled Volume Profile only. You will need to use the DataLoader in your code in order to receive the Volume Profile data in the scanner window.

Thanks Henry I saw the DataLoader example to call a symbol in the memory but I don't see an example where - from the DataLoader we have called the volume profile to load into the memory.
There is no ready sample code for that, please refer to the DataLoader Property in the help file (PowerLanguage .Net Editor->Help tab-> PowerLanguage .Net Help).


Hi Henry, have gone through the powerlanguage.NET help - the dataloader interface will load the chart in the memory that's true but I don't see anywhere the dataloader interface can load a chart with volume profile enabled in the memory.

you are making me go through all the material and I am going through the pain of reading them through without any success. All you have to say that dataloader cannot load a chart in the memory without volume profile enabled.

User avatar
Henry MultiСharts
Posts: 9046
Joined: 25 Aug 2011
Has thanked: 1250 times
Been thanked: 2905 times

Re: Examples of accessing volume profile values

Postby Henry MultiСharts » 18 Apr 2019

Abhi wrote:Hi Henry, have gone through the powerlanguage.NET help - the dataloader interface will load the chart in the memory that's true but I don't see anywhere the dataloader interface can load a chart with volume profile enabled in the memory.

you are making me go through all the material and I am going through the pain of reading them through without any success. All you have to say that dataloader cannot load a chart in the memory without volume profile enabled.
DataLoader can load the data without volume profile enabled. You can find attached a sample code that loads the volume profile data using DataLoader and plots the min and max volume of the last bar in the request (yesterday).
Attachments
Test_DataLoaderLoadFootPrint.pln
(1.75 KiB) Downloaded 16 times


Return to “MultiCharts .NET”