Bid/Ask Volume Ratio

thyself

Member
Joined
Oct 7, 2021
Posts
8
Likes
1
I am trying to create a simple bar coloring indicator based on AskVolume/BidVolume formula, but apparently I cannot find a way to access Ask and Bid Volume in the SDK. There is a default MW Indicator Ask/Bid Volume, but its source code is not provided in the public collection of studies. Can you please suggest how to access AskVolume BIdVolume in the SDK, or can you provide link to the latest collection of MW Studies which contain Ask/Bid Volume indicator?

Thank you
 

thyself

Member
Joined
Oct 7, 2021
Posts
8
Likes
1
I've read the code of Bid/Ask Spread, but it doesn't show how to access Bid/Ask volume of the bar, help is needed:

//input = price, user defined, default is close
//index = current bar number

switch(input)
case HIGH:
ASK = getAskHigh(index));
BID = getBidHigh(index));
break;
case LOW:
ASK = getAskLow(index));
BID = getBidLow(index));
break;
case OPEN:
ASK = getAskOpen(index));
BID = getBidOpen(index));
break;
default:
ASK = series.getAskClose(index));
BID = getBidClose(index));
break;
end
 

xerol

Active member
Joined
Apr 6, 2022
Posts
28
Likes
7
Hi, did you find a solution for that? I am also looking for a way to access Bid/Ask volume, but I am stuck.
 

Spin

Well-known member
Joined
May 22, 2019
Posts
480
Likes
192
Seems like I'm a bit (or "bid" ? :ROFLMAO:) late to the party, but the SDK does indeed allow to access those values.
1700902393676.png

More info here:
https://www.motivewave.com/sdk/java...atform/sdk/common/DataSeries.html#getBidLow()

Seems there is no direct way of getting the volume from that particular Tick, so I would suggest a loop to iterate over all Ticks in that Bar, looking for the one that has the specific pricevalue you need, and then get the volume of that Tick.
https://www.motivewave.com/sdk/javadoc/com/motivewave/platform/sdk/common/Tick.html#getVolume()

Might make your processor sweat though :)
 

Shtick Hustler

Well-known member
Joined
Oct 15, 2020
Posts
106
Likes
46
I was getting no ouput from these methods:

Java:
series.getBidOpen(index)
series.getBidHigh(index)
series.getBidLow(index)
series.getBidClose(index)

series.getAskOpen(index)
series.getAskHigh(index)
series.getAskLow(index)
series.getAskClose(index)

Or, specifically: they always return exactly '0'.

I thought it was because my CQG data was top-of-book only.

So, I upgraded to Depth-of-Market data.
And I now see around 35 levels of DOM data for bid and ask.

I also added this to the StudyHeader:

Java:
    requiresBidAskHistory = true,

Still...nothing from these methods.

The only methods that work are these:
JavaScript:
series.instrument.bidPrice
series.instrument.askPrice


Also, the 'Bid/Ask Spread' study outputs nothing on my charts.

Does anyone have this working, and if so, who's your data provider and what's the data plan?
 
Last edited:

Shtick Hustler

Well-known member
Joined
Oct 15, 2020
Posts
106
Likes
46
Got an answer on this from mw support--bid/ask history is only available for Forex connections--and I don't have one :-(

I can get bid/ask prices @ the close of each bar, but would have to save my own history after placing my study on the chart.
 

Spin

Well-known member
Joined
May 22, 2019
Posts
480
Likes
192
Got an answer on this from mw support--bid/ask history is only available for Forex connections--and I don't have one :-(

I can get bid/ask prices @ the close of each bar, but would have to save my own history after placing my study on the chart.
Ha!

Thanks for reporting that @Shtick Hustler. I guess this was knowledge I had acquired ages ago, but it was stored in my offline memory since then :LOL:
 
Top