Order Flow Volumetric Bars

<< Click to Display Table of Contents >>

Navigation:  Operations > Charts > Order Flow + >

Order Flow Volumetric Bars

Previous page Return to chapter overview Next page

Show/Hide Hidden Text

 

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 (please see the Delta type property explanation below).

 

With the delta value known for each price level in the bar, it is then classified per each session for analysis and emphasizes the buying / selling strength unfolding. This is done by a gradient coloring approach shading the value cells in the bar, where the level of sensitivity for the gradient can be set via the Shading sensitivity property. The higher this value is set, the finer the gradient can be applied to various levels of strength - the NinjaTrader default is 20 levels.

 

This can be thought of as a way of not only saying who ‘won / lost’ the price level’s auction, but also by what margin or strength. This is not a signal in itself per se, but rather a mechanical means to classify the buying vs selling activity at each individual price level and thus offer the trader a more detailed look what happens inside the price bars.

 

A second comparison of buy sell volumes is the Imbalance detection. Here the price level buying and selling volumes are compared diagonally to understand which side of the market was stronger by exceeding the set Imbalance ratio. For example if the buying volume was 1000 contracts and the selling volume diagonal below was 300 then buying Imbalance was detected (assuming a default Imbalance ratio of 1.5). This can be helpful especially if multiple Imbalances 'cluster' close together to form support / resistance areas.

 

NinjaTrader Order Flow Volumetric bars can provide a large degree of details and facilitate displaying the information in a dynamically sized way, as the text is re-sized as your horizontally or vertically adjust the chart's scale range.

 

Critical: To perform the delta buy / sell aggressor classification, historical bid / ask tick data access by your provider is needed. To see which data providers can offer which type of data in NinjaTrader, please review this table.

 

Forex spot data charting is traditionally driven from the bid side only, since no 'true' last exists. Provided values would not represent a centralized auction based market as with stocks or futures - as such Order Flow Volumetric Bars would not be supported on Forex spot data.

 

tog_minus        Order Flow Volumetric Overview

Order Flow Volumetric Overview:

 

Below we show a 5 minute Order Flow Volumetric BidAsk style chart of the popular E-Mini S&P 500 contract. An exemplary bar is annotated to show the different components you will work with on an Order Flow Volumetric chart.

 

1. Order Flow Volumetric bar

2. Sell Volume per each price level seen in the bar

3. Buy Volume per each price level seen in the bar

4. Open/Close bar

5. Maximum highlight in the bar - this shows the price(s) with the highest volume or delta  in the bar

6. Bar Statistics panel (only 3 out of possible 10 values activated here)

 

OFVM1

 

On the next image, we see an excerpt of the same chart, however now the chart style type is changed to Delta. The bar highlighted yellow corresponds to the annotated bar above - this style, instead of the individual buy / sell volumes, show the combined delta value for each price level.

If positive the level was seeing buying strength, negative if selling strength.

 

OFVM2

 

 

Now let's take a look how the actual values we see in the bar are calculated from the market data, as an example take the first level of our Volumetric BidAsk bar in the first screen-shot (numbers right below the 2/3 annotated numbers) :

 

We see a bid or selling volume of 70 and a ask or buying volume of 254.

 

Taking the difference (Buy volume - Sell volume) so 254 - 70 we get the delta value of 184 - which we see as first cell value in the 2nd screen-shot showing the Delta type.

 

The shading taking place in the bars will always be based on this delta value calculated, the chart style just defines what kind of textual data detail will be displayed (the actual Bid Ask Volumes or the Delta value).

 

Moving on to the lower portion Bar Statistics (6), we see the Buy Vol and Sell Vol for the bar and a delta as well exposed - however, please note that these are summed values for the entire bar.

 

If we sum all the buy volumes we would get 21949; summing sell volumes for the bar is 17919. All the price level deltas summed would equal the delta of the entire bar 4030.

 

 

Order Flow Volumetric Imbalance charting:

 

The screen-shot below explains the workings of the Imbalance detection in more detail. You can see the Buy / Sell volumes are compared diagonally here to arrive at the classification if buy or sell imbalance is present.

 

Let's run through the first calculation for the example bar:

 

1. Buy volume of 57 is compared to the diagonal below sell volume of 106

2. Dividing the buy volume into the sell volume we get a ratio of 106 / 57 = 1.86

3. NinjaTrader by default sets the ratio for Imbalance at 1.5, so this level gets marked with Sell Imbalance (magenta text color per default).

4. As a further condition, a minimum difference between the compared values must be present. This value is defaulted to 10 - which is valid in our example as well.

 

In the case that both Imbalance and Maximum would trigger for the same cell, the Maximum would override and be displayed (example shown below at annotation 1).

 

OFVM3

 

 

Order Flow Volumetric Bar Statistics:

 

The Volumetric Bar statistics show important values for each Volumetric bar in a static grid-like fashion. The same gradient strength shading as for the main Volumetric bars is applied here.

 

Via a right click in the right hand side scale section (1) the individual statistic values could be enabled / disabled 'on the fly'.

 

OFVM4

 

tog_minus        Order Flow Volumetric Imbalance Customization Example

Order Flow Volumetric Imbalance Customization example:

 

This section presents an example of how NinjaTrader Order Flow Volumetric bars can be highly customized to your trading style. Traders focused on Order Flow Volumetric Imbalances may consider working these charting ideas into their NinjaTrader setup.

 

The settings we present below could be used as a starting point -

 

OFVM6

 

The regular 5 Minute CandleStick chart is brought in to this chart via a second Data Series, so forming a MultiSeries chart with our main 5min Order Flow Volumetric bars. This can advantageous if you prefer to plot the regular bar / candlestick portion in the middle of the bar between the Buy/Sell volume columns.

 

OFVM5

 

tog_minus        Order Flow Volumetric Bars parameters

Data series:

 

Base period type

Sets the base period type the Volumetric bars should be calculated on, possible values include:

 

Tick,

Volume,

Second,

Minute,

Day,

Week,

Month,

Year,

Range

Base period value

Period of your chosen Base period type for Volumetric bars (i.e. 3 Minute, 450 Tick)

Delta type

Sets how the delta is calculated for buy / sell aggressor classification. Possible values are:

BidAsk or UpDownTick.

 

BidAsk - Last trade at the ask or higher is considered buying volume, Last trade at the bid or lower selling volume.

 

UpDownTick - Last trade happens while Ask > Last Ask is considered buying, Last trade happens while Bid < Last Bid considered selling, all volume in between is added to the prior direction - this mode is an important proxy for markets / data providers where best bid / ask information is not available with last price tick data (i.e. Forex spot)

Ticks per level

Sets the level of aggregation for individual price levels, i.e. if price levels should be merged together, default 1 – so each price level delta result is seen individually inside the price bars

 

(Please note that with a higher Ticks per level set, there could be Volumetric remainder cells as result that are actually smaller than your set Ticks per level, as not all bar range could be evenly divisible by the Ticks per level value)

Size filter

Default 0, could be set higher to limit seeing the delta only for trades higher than the size filter setting for example track larger trades only - keep in mind this could be potentially set to high for your chart, so Volumetric bars value cells could show 0 volume, so it never met this criteria then to be considered in the analysis.

Tick replay

Check to allow indicators or strategies to access Tick replay data, the main Volumetric bars though will always be built off a 1 tick series.

 

Chart style:

 

Chart style type

Sets the chart style type used, possible values are : BidAsk or Delta

 

BidAsk - allows you seeing the individual buy / sell volume cells inside the Volumetric bar, buy (ask) volume is shown on the right side, sell (bid) volume shown on the right side. Additionally this style can highlight the maximum and imbalance conditions.

 

Delta - allows to see the single value total net delta per each price cell, maximum can be shown as well (no imbalance option for this style)

Strength sensitivity

Sets how many gradient levels should be calculated to provide the buy / sell strength shading for the Volumetric bars, the default setting is 20. This is reset at every session break to ensure the gradient strength classifications easily comparable across various days market action.

Show imbalance

Enables the display of Imbalance coloring

 

Only applicable for the Volumetric BidAsk chart style type

Imbalance ratio

Sets the ratio used for comparing the buy / sell volumes diagonally for accessing if Imbalance is present, default 1.5

 

Only applicable for the Volumetric BidAsk chart style type

Minimum delta for imbalance

Sets the minimum delta to be seen diagonally across compared buy / sell volume columns for displaying Imbalance, default value is 10.

 

Only applicable for the Volumetric BidAsk chart style type

Color dominant side

Enables to display the dominant ('winning') strength side only in the Volumetric strength display

 

Only applicable for the Volumetric BidAsk chart style type

Box outline

Sets options for the display of the outline of the Volumetric boxes

Box grid

Sets options for the display of the inner grid of the Volumetric bars

Candle body outline

Sets options for the display of the body outline of the Open/Close bar

Color for up bars

Sets the up brush color used for Open/Close bar

Color for down bars

Sets the down brush color used for Open/Close bar

Color for doji

Sets the doji brush color used for Open/Close bar

Color for positive strength

Sets the positive brush color used for positive strength gradients

Color for negative strength

Sets the negative brush color used for negative strength gradients

Color for buy imbalance

Sets the brush color used for buy imbalance

 

Only applicable for the Volumetric BidAsk chart style type

Color for sell imbalance

Sets the brush color used for sell imbalance

 

Only applicable for the Volumetric BidAsk chart style type

Show maximum

Enables the display of the maximum value for the Volumetric bars, if identical values would be seen across cells, then all cells sharing the maximum would be highlighted.

 

BidAsk style: If Color dominant side is checked, it will highlight both the Buy and Sell price levels with the highest volume, else it will highlight the price level with the highest combined Buy / Sell volume (Total volume for the price level)

 

Delta stye: highest absolute delta level would be highlighted

Color for maximum

Sets the text color used for maximum display

Color for text

Sets the text color used for the displaying the Volumetric cell values

Show bar statistics

Enables the display of the Volumetric bar statistics in the lower portion (static location) of the chart. You can checkmark each desired statistic, possible statistics are -

 

Trades

The total number of trades in the bar

Volume

The volume for the bar

Buy vol

The Buy vol for the bar

Sell vol

The Sell vol for the bar

Delta (bar)

The total delta for the bar (all individual price level delta summed)

Delta (%)

The bar delta expressed as percentage of volume for the bar

Cumulative delta

The bar delta value cumulated throughout the session

Min delta

The minimum delta seen in the bar (intrabar). This could be positive as well, i.e. a strong up bar with no selling pressure

Max delta

The maximum delta seen in the bar (intrabar). This could be negative as well, i.e. a strong down bar with no buying pressure

Delta change

The change in delta from the previous bar's delta value

 

The statistics can be toggled as well 'on the fly' from the chart's right scale by clicking on the statistic labels.

 

Color for base

Sets the brush color used for base bar statistics strength gradients (Trades, Volume)

Statistics grid

Sets options for the display of the bar statistics grid of the Volumetric bars

 

tog_minus        Order Flow Volumetric Values NinjaScript access

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.

 

Methods and Properties the VolumetricBarsType exposes:

 

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 session break)

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 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

 

Example

ns


protected override void OnBarUpdate()
{
        if (ChartBars.Bars == null)
          return;
       
        NinjaTrader.NinjaScript.BarsTypes.VolumetricBarsType barsType = ChartBars.Bars.BarsSeries.BarsType as    

        NinjaTrader.NinjaScript.BarsTypes.VolumetricBarsType;
       
        if (barsType == null)
          return;
        try
        {
          double price;
          Print("=========================================================================");
          Print("Bar: " + CurrentBar);
          Print("Trades: " + barsType.Volumes[CurrentBar].Trades);
          Print("Total Volume: " + barsType.Volumes[CurrentBar].TotalVolume);
          Print("Total Buying Volume: " + barsType.Volumes[CurrentBar].TotalBuyingVolume);
          Print("Total Selling Volume: " + barsType.Volumes[CurrentBar].TotalSellingVolume);
          Print("Delta for bar: " + barsType.Volumes[CurrentBar].BarDelta);
          Print("Delta for bar (%): " + barsType.Volumes[CurrentBar].GetDeltaPercent());
          Print("Delta for Close: " + barsType.Volumes[CurrentBar].GetDeltaForPrice(Close[0]));
          Print("Ask for Close: " + barsType.Volumes[CurrentBar].GetAskVolumeForPrice(Close[0]));
          Print("Bid for Close: " + barsType.Volumes[CurrentBar].GetBidVolumeForPrice(Close[0]));
          Print("Volume for Close: " + barsType.Volumes[CurrentBar].GetTotalVolumeForPrice(Close[0]));
          Print("Maximum Ask: " + barsType.Volumes[CurrentBar].GetMaximumVolume(true, out price) + " at price: " + price);
          Print("Maximum Bid: " + barsType.Volumes[CurrentBar].GetMaximumVolume(false, out price) + " at price: " + price);
          Print("Maximum Combined: " + barsType.Volumes[CurrentBar].GetMaximumVolume(null, out price) + " at price: " + price);
          Print("Maximum Positive Delta: " + barsType.Volumes[CurrentBar].GetMaximumPositiveDelta());
          Print("Maximum Negative Delta: " + barsType.Volumes[CurrentBar].GetMaximumNegativeDelta());
          Print("Max seen delta (bar): " + barsType.Volumes[CurrentBar].MaxSeenDelta);
          Print("Min seen delta (bar): " + barsType.Volumes[CurrentBar].MinSeenDelta);
          Print("Cumulative delta (bar): " + barsType.Volumes[CurrentBar].CumulativeDelta);
        }
        catch{}
}