My drawing tool aims to gather and separate the order flow activity in each value area of a bar (above, at or below value). To do this I have to manually calculate the value area and then group each price and that price's data respectively. The tool will only be used on a daily volumetric bar, and on one bar at a time.
So far, the infrastructure is complete for the drawing tool and I have managed to isolate the price and the volume of the VPOC of the bar. My problem is figuring out how to correctly loop through all the prices and adding the volume to correctly find the value area. Provided is a sample of what I have written:
double tickSize = AttachedTo.Instrument.MasterInstrument.TickSize;
double BarLow = myBars.Bars.GetLow(startIdx);
double BarHigh = myBars.Bars.GetHigh(startIdx);
double p;
​
for (p = barHigh; p >= barLow; p -= tickSize)
{
dailyBarVPOCVolume = barsType.Volumes[i].GetMaximumVolume(null, out vpocPrice);
}
Here I am able to get the volume of the VPOC and the price as shown in the picture for day 03.
Should I use the vpoc as an anchor point to then loop though prices above and below then add their volumes to calculate the Value Area (until the "Vol%ofTotalDay Print is approx. 70%) or can it be calculated another way?
Comment