PDA

View Full Version : Some Range Bars have zero volume


scjohn
11-08-2007, 02:18 PM
Add the Vol indicator to a chart that is using Range Bars and some of the bars have 0 volume. I think this is a bug.

NinjaTrader_Ray
11-08-2007, 02:38 PM
This is possible and accurate.

The reason is that range bars are built when a price trades outside of a range. If you have a range set for 4 ticks, and the current trade is 9 ticks away from the last trade, we would put in 2 synthetic bars (that have no volume) to represent the 8 ticks (2 full bars) of range that just gapped.

This is the correct approach for range bars.

whitmark
11-08-2007, 11:26 PM
These are also referred to as "phantom bars" in that they appear to represent the traded price but they really don't. Keep in mind while backtesting range bars that should your indicator or setup trigger a trade in the midst of several of these phantom bars, there will be no underlying volume to fill your order and you will get unrealistic performance results for that trade.

I have found range bars most useful when applied to forex markets to allow more bar closing evaluation points than when the price action can breakout suddenly and all within a single 30 minute bar, for example.

Regards,

Whitmark

NinjaTrader_Ray
11-09-2007, 07:45 AM
Thanks for the further explanation Whitmark.

zoltran
11-09-2007, 10:08 AM
One could add a test such as volume>0 to ensure you aren't using a phantom bar.

Doesn't always work for forex though .. no volume.

Ray .. perhaps you could add a testable property such as 'isPhantomBar' ?

That would remove all doubt and second-guessing.

NinjaTrader_Ray
11-09-2007, 10:31 AM
Will add to list of future possible enhancements.