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.
Examples of accessing volume profile values
- Henry MultiСharts
- Posts: 9165
- Joined: 25 Aug 2011
- Has thanked: 1264 times
- Been thanked: 2957 times
Re: Examples of accessing volume profile values
Hello Abhi,
Here is the documentation and examples for accessing this type of data:
http://www.multicharts.com/discussion/v ... 19&t=46751
http://www.multicharts.com/discussion/v ... 77#p101877
http://www.multicharts.com/trading-soft ... me_Profile
Here is the documentation and examples for accessing this type of data:
http://www.multicharts.com/discussion/v ... 19&t=46751
http://www.multicharts.com/discussion/v ... 77#p101877
http://www.multicharts.com/trading-soft ... me_Profile
Re: Examples of accessing volume profile values
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();
} */
}
}
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();
} */
}
}
- Henry MultiСharts
- Posts: 9165
- Joined: 25 Aug 2011
- Has thanked: 1264 times
- Been thanked: 2957 times
Re: Examples of accessing volume profile values
Hello Abhi,
Please describe the specific difficulty you have with it.
Please describe the specific difficulty you have with it.
Re: Examples of accessing volume profile values
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.
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.
- Henry MultiСharts
- Posts: 9165
- Joined: 25 Aug 2011
- Has thanked: 1264 times
- Been thanked: 2957 times
Re: Examples of accessing volume profile values
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.
Re: Examples of accessing volume profile values
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.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.
https://www.multicharts.com/trading-sof ... DataLoader
- Henry MultiСharts
- Posts: 9165
- Joined: 25 Aug 2011
- Has thanked: 1264 times
- Been thanked: 2957 times
Re: Examples of accessing volume profile values
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).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.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.
Re: Examples of accessing volume profile values
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.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).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.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.
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.
- Henry MultiСharts
- Posts: 9165
- Joined: 25 Aug 2011
- Has thanked: 1264 times
- Been thanked: 2957 times
Re: Examples of accessing volume profile values
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).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.
- Attachments
-
- Test_DataLoaderLoadFootPrint.pln
- (1.75 KiB) Downloaded 356 times