I don't know if is an erro of my part or of the volumetric bars, but here is how I'm populating my bars.
protected override void OnMarketData( NinjaTrader.Data.MarketDataEventArgs e ){
if( e.MarketDataType == NinjaTrader.Data.MarketDataType.Last ){
if( CurrentBars[ 0 ] < 0 || BarsInProgress > 0 )
return;
double rounded = RoundToTickSize( e.Price );
if( e.Price <= e.Bid ){
bars[ 0 ][ rounded, Cluster.Long.BidVolume ] += e.Volume;
}else if( e.Price >= e.Ask ){
bars[ 0 ][ rounded, Cluster.Long.AskVolume ] += e.Volume;
}
}
The "bars" are a Series of my custom class that represents the bars, and on it's logic it places the volume on the difernt levels of prices.
As you can see on the images the other data except for the open of the first bar of the session matches exactly as the volumetric bars.
Comment