Separate matched amount for back and lay prices

We were all new to Bet Angel once. Ask any question you like here and fellow forum members promise not to laugh. Betfair trading made simple.
Post Reply
User avatar
doctor143
Posts: 74
Joined: Wed Jul 31, 2019 3:10 pm

Hi Experts,

How can I retrieve separate matched volumes for back and lay at the same price?

For example:

At 1.05–1.06, matched amounts are:
1.05 → 1000
1.06 → 2000

When the market moves to 1.06–1.07, it shows:

1.06 → 2000
1.07 → 0

However, I want to distinguish:

Matched volume at 1.06 when it was a lay price
Matched volume at 1.06 when it later becomes a back price

Is there a way to track this separately?
User avatar
jamesedwards
Posts: 5482
Joined: Wed Nov 21, 2018 6:16 pm

doctor143 wrote:
Sun Mar 29, 2026 1:04 pm
Hi Experts,

How can I retrieve separate matched volumes for back and lay at the same price?

For example:

At 1.05–1.06, matched amounts are:
1.05 → 1000
1.06 → 2000

When the market moves to 1.06–1.07, it shows:

1.06 → 2000
1.07 → 0

However, I want to distinguish:

Matched volume at 1.06 when it was a lay price
Matched volume at 1.06 when it later becomes a back price

Is there a way to track this separately?
As far as I know you would have to do this manually. eg Create your own stored value called something like "1.06 lay vol" that increases by the amount of volume changed at 1.06 but only whenever the lay price is 1.06.
User avatar
doctor143
Posts: 74
Joined: Wed Jul 31, 2019 3:10 pm

Are you suggesting I need to create back lay volume for all the prices? From 1.01 to 1000?
User avatar
jamesedwards
Posts: 5482
Joined: Wed Nov 21, 2018 6:16 pm

doctor143 wrote:
Sun Mar 29, 2026 3:06 pm
Are you suggesting I need to create back lay volume for all the prices? From 1.01 to 1000?
Depends what you are trying to do. If you are only tracking a couple of prices then it's easily doable, but if you want lots or all then the juice may well not be worth the squeeze.
User avatar
doctor143
Posts: 74
Joined: Wed Jul 31, 2019 3:10 pm

For now, I’m simply trying to compare whether more volume is being matched on the back side or the lay side of a given market.

There are many potential use cases for this functionality, and I believe it would be a valuable feature for Bet Angel to consider adding.
User avatar
jamesedwards
Posts: 5482
Joined: Wed Nov 21, 2018 6:16 pm

doctor143 wrote:
Sun Mar 29, 2026 6:15 pm
For now, I’m simply trying to compare whether more volume is being matched on the back side or the lay side of a given market.

There are many potential use cases for this functionality, and I believe it would be a valuable feature for Bet Angel to consider adding.
Volume matched on the back side will always equal volume matched on the lay side because a match only happens where these two prices meet.
User avatar
doctor143
Posts: 74
Joined: Wed Jul 31, 2019 3:10 pm

I want to determine whether more volume is being matched on the back side or the lay side.

To simplify:

Capture the amount matched at the back price (1.50) and store it as a value.
If the price moves to 1.51–1.52, then:
Take the amount matched at the new back price (1.51)
Add it to the previously stored value

This way, I can track the cumulative matched volume on the back side as the price moves.
User avatar
jamesedwards
Posts: 5482
Joined: Wed Nov 21, 2018 6:16 pm

doctor143 wrote:
Tue Mar 31, 2026 2:54 pm
I want to determine whether more volume is being matched on the back side or the lay side.

To simplify:

Capture the amount matched at the back price (1.50) and store it as a value.
If the price moves to 1.51–1.52, then:
Take the amount matched at the new back price (1.51)
Add it to the previously stored value

This way, I can track the cumulative matched volume on the back side as the price moves.
The cumulative matched back volume of a selection will always equal half of the cumulative matched volume of that selection.
User avatar
doctor143
Posts: 74
Joined: Wed Jul 31, 2019 3:10 pm

I get your point. I’m not looking at cumulative volume irrespective of side.
I want to separate matched volume based on which side of the book the price was on at the time of the trade.

Track how much volume is matched when a price is trading on the back side
And separately, track how much volume is matched when a price is trading on the lay side

So even for the same price (e.g. 1.51), I want to distinguish:

volume matched when it was the best back price
vs volume matched when it was the best lay price
User avatar
jamesedwards
Posts: 5482
Joined: Wed Nov 21, 2018 6:16 pm

doctor143 wrote:
Tue Mar 31, 2026 4:09 pm
I get your point. I’m not looking at cumulative volume irrespective of side.
I want to separate matched volume based on which side of the book the price was on at the time of the trade.

Track how much volume is matched when a price is trading on the back side
And separately, track how much volume is matched when a price is trading on the lay side

So even for the same price (e.g. 1.51), I want to distinguish:

volume matched when it was the best back price
vs volume matched when it was the best lay price
As far as I know this value does not exist within the API so the only way to capture it would be with your own manual stored values in the way I described in my first reply.
User avatar
Dallas
Posts: 23904
Joined: Sun Aug 09, 2015 10:57 pm

jamesedwards wrote:
Tue Mar 31, 2026 4:11 pm
doctor143 wrote:
Tue Mar 31, 2026 4:09 pm
I get your point. I’m not looking at cumulative volume irrespective of side.
I want to separate matched volume based on which side of the book the price was on at the time of the trade.

Track how much volume is matched when a price is trading on the back side
And separately, track how much volume is matched when a price is trading on the lay side

So even for the same price (e.g. 1.51), I want to distinguish:

volume matched when it was the best back price
vs volume matched when it was the best lay price
As far as I know this value does not exist within the API so the only way to capture it would be with your own manual stored values in the way I described in my first reply.
Its been asked a few times in the past and I remember trying to set it up like James suggested but it required loads of SV for each price it just wasn't worth the effort even just for the touch and surrounding prices

and I don't think anything has been added to the stored values since which would make it easier :roll:
Post Reply

Return to “Bet Angel for newbies / Getting started”