Order Flow Volumetric Bars
<< Click to Display Table of Contents >> Order Flow Volumetric Bars |
NinjaTrader Order Flow Volumetric bars provide a detailed ‘x-ray’ view into each price bar’s aggressive buying and selling activity. This technique primarily attempts to answer the question which side was the most aggressive at each price level. This is done by calculating the delta (greek for difference) between buying and selling volume.
Many of the NinjaTrader Order Flow Volumetric Bar and Bar Statistics values could be accessed from your custom NinjaScript objects further leveraging the power of these analysis techniques.
BarDelta |
Gets a long value with the total bar's delta |
CumulativeDelta |
Gets a long value with the cumulative delta (Note: the accumulation is reset at the session break) |
DeltaSh |
The delta since last time price touched the high of the bar, usually negative |
DeltaSl |
The delta since last time price touched the low of the bar, usually positive. |
GetAskVolumeForPrice(double price) |
Gets the ask volume (long value) for the passed in price |
GetBidVolumeForPrice(double price) |
Gets the sell volume (long value) for the passed in price |
GetDeltaForPrice(double price) |
Gets the horizontal delta (long value) for the passed in price |
GetDeltaPercent() |
Gets a double value with the delta % of volume for the bar |
GetMaximumPositiveDelta() |
Gets the highest positive delta (long value) for the bar (if there is no positive delta in the bar, it will get the lowest negative delta) |
GetMaximumNegativeDelta() |
Gets the highest negative delta (long value) for the bar (if there is no negative delta in the bar, it will get the lowest positive delta) |
GetMaximumVolume(bool? askVolume, out double price) |
Gets the highest Ask, Bid or combined volume (long value) for the bar and returns the price at which it occurred.
- pass in true for getting the highest Ask volume - pass in false for getting the highest Bid volume - pass in null for getting the highest combined volume
For scenarios where Ticks per level is greater than 1, this method will return the lowest price - with Ticks per level known, the remaining prices in the result cell could be custom calculated if desired. |
GetTotalVolumeForPrice(double price) |
Gets the total volume (long value) for the passed in price |
MaxSeenDelta |
Gets the highest delta (long value) seen intrabar |
MinSeenDelta |
Gets the lowest delta (long value) seen intrabar |
TotalBuyingVolume |
Gets the total buying volume (long value) for the bar |
TotalSellingVolume |
Gets the total selling volume (long value) for the bar |
Trades |
Gets to total number of trades (long value) for the bar |
protected override void OnBarUpdate() // This sample assumes the Volumetric series is the primary DataSeries on the chart, if you would want to add a Volumetric series to a // script, you could call AddVolumetric() in State.Configure and then for example use // NinjaTrader.NinjaScript.BarsTypes.VolumetricBarsType;
NinjaTrader.NinjaScript.BarsTypes.VolumetricBarsType barsType = Bars.BarsSeries.BarsType as Print("Delta Since High (bar): " + barsType.Volumes[CurrentBar].DeltaSh); Print("Delta Since Low (bar): " + barsType.Volumes[CurrentBar].DeltaSl); |
Note: Please note in the example above a CurrentBar reference is used as index, and not a BarsAgo reference. |