Bid/Ask Volume Question

Is It possible to use the PriceVolDistribution function to setup a bid ask volume screen like the attached screenshot. Volume that trades when the bid is hit is the Red negative value; volume that trades when the Offer is lifted is positive Green value. This would be for trades on the given bar.
Any assistance would be greatly appreciated.

PriceVolDistribution() function is provided for something else. It is provided to implement “volume-at-price” histogram.

What you are asking for is not histogram of volumes at different (fixed) price levels, but sum of volumes traded at ask and at bid. But these levels are not constant.

Implementing such chart requires:

  1. Using Tick base time interval
  2. Collecting historical Bid/Ask price (only available from IQFeed at the moment)
  3. Calculating sum of volume traded at bid and at ask on tick by tick level
  4. Storing it in static variable for later use in other intervals

So as you can see there are few precautions and few hurdles. If you are looking for “ready-to-use” copy/paste formula, it is not there, sorry.

Hi @Tomasz,

Pardon my ignorance!

After several weeks of follow-ups with my broker, using a C++ plugin they are able to relay Bid, Ask Rates from their Trading Terminal to AB’s Aux1, Aux2 respectively at Tick level.

On a 1-tick chart, the segregation of the volume works.

//Aux1 = Bid Rate
//Aux2 = Ask Rate
//Close = Last Traded Price

TimeFrameSet( -1 );
	 buy_vol = IIf( C >= Aux2, V, 0 ); //Buying volume or Ask Volume
	 sell_vol = IIf( C <= Aux1, V, 0 ); //Selling volume or Bid Volume
	 neutral_vol = IIf( ( C > Aux1 ) and ( C < Aux2 ), V, 0 ); //Unknown
TimeFrameRestore();

How do I count the number of bars in an ongoing minute at 1-tick level, create a loop and add the instances of buy_vol, sell_vol to view their total in a minute bar of in1Minute timeframe or more?

In regards to,[quote=“Tomasz, post:2, topic:332”]
3) Calculating sum of volume traded at bid and at ask on tick by tick level
4) Storing it in static variable for later use in other intervals
[/quote]

are you referring to Collecting and Plotting Ticks v2? In this case how to do that with Aux1, Aux2?

Please guide me out of this dilemma!
Thank you very much!