I've just wrote a small scipt that logs the maximum volume in the VolumetricBars series which is set like :
else if (State == State.Configure)
{
// adding volumetric series to the script
AddVolumetric(null, Data.BarsPeriodType.Month, 1, Data.VolumetricDeltaType.BidAsk, 1);
}
Here is the code for logging and identifying the max volume of the monthly bar:
protected override void OnBarUpdate()
{
IdentifyHighestVolumePrice();
}
private void IdentifyHighestVolumePrice()
{
NinjaTrader.NinjaScript.BarsTypes.VolumetricBarsTy pe barsType = BarsArray[1].BarsType as BarsTypes.VolumetricBarsType;
try
{
// identifies the highest volume of the current bar
double priceOfHighestVolume;
barsType.Volumes[CurrentBars[1]].GetMaximumVolume(null, out priceOfHighestVolume);
Log("priceOfHighestVolume at month " + CurrentBars[1]);
Log(priceOfHighestVolume);
}
catch
{
}
}
Ive attached screenshots of the chart and logs. There are logs for the first monthly bar (october which because i only have 75 days loaded is only the partial month), november and december.
Im calculating OnBarClose. And tick replay is off.
Thanks a lot,
Tarik

Comment