SV question

Advanced automation available in Guardian - Chat with others and share files here.
Post Reply
User avatar
jamesedwards
Posts: 4370
Joined: Wed Nov 21, 2018 6:16 pm

What's the best way of storing the expected P&L based on matching a set stake at any price?

eg if I wanted to back £20 at any price and available prices were:
2.02 with £5 available
2.00 with £6 available
1.99 with £7 available
1.98 with £9 available
...then it would match £5 @ 2.02, £6 at 2.00, £7 @ 1.99, and £2 of the money available at 1.98. Therefore a total expected profit of £19.99 (ignoring commission).

Is there any way to get that £19.99 into a stored value?

I've had a good look around Guardian and the only way I can figure so far is a complicated set of calculations based around the 'the Money available to Back at a price for a selection' options but this seems to only allow me to gather the values for the first three back price positions so in the above example wouldn't capture the correct total and would store a value of only £18.03.
sionascaig
Posts: 1682
Joined: Fri Nov 20, 2015 9:38 am

Not sure if you could do it completely accurately due to market refresh and how active the market is but you should be able to get close.

One way is to capture, say current back price as a SV, say BackP0 and then in a separate SV capture money associated with that price, say BackM0...

Next SV captured (in same rule) will be BackP1 which is same logic you used to capture BackP0 but you "adjust" the SV by 1 tick and then use this price to capture BackM1... Next one will be BackP2 with a 2 tick adjustment etc....

By using the tick adjustment method you can capture as many prices as you like (not limited to 3) and associated money at these prices.

Have rules that capture 12 backs & 12 lays every refresh and not had any issues.
User avatar
Dallas
Posts: 23597
Joined: Sun Aug 09, 2015 10:57 pm

jamesedwards wrote:
Sun Jun 25, 2023 3:35 am
What's the best way of storing the expected P&L based on matching a set stake at any price?

eg if I wanted to back £20 at any price and available prices were:
2.02 with £5 available
2.00 with £6 available
1.99 with £7 available
1.98 with £9 available
...then it would match £5 @ 2.02, £6 at 2.00, £7 @ 1.99, and £2 of the money available at 1.98. Therefore a total expected profit of £19.99 (ignoring commission).

Is there any way to get that £19.99 into a stored value?

I've had a good look around Guardian and the only way I can figure so far is a complicated set of calculations based around the 'the Money available to Back at a price for a selection' options but this seems to only allow me to gather the values for the first three back price positions so in the above example wouldn't capture the correct total and would store a value of only £18.03.
It is possible to store values outside the best three prices but to do it requires two SV's per price point
There's an example here that stores the 4th and 5th
viewtopic.php?f=56&t=26012
User avatar
jamesedwards
Posts: 4370
Joined: Wed Nov 21, 2018 6:16 pm

Dallas wrote:
Sun Jun 25, 2023 11:04 am
jamesedwards wrote:
Sun Jun 25, 2023 3:35 am
What's the best way of storing the expected P&L based on matching a set stake at any price?

eg if I wanted to back £20 at any price and available prices were:
2.02 with £5 available
2.00 with £6 available
1.99 with £7 available
1.98 with £9 available
...then it would match £5 @ 2.02, £6 at 2.00, £7 @ 1.99, and £2 of the money available at 1.98. Therefore a total expected profit of £19.99 (ignoring commission).

Is there any way to get that £19.99 into a stored value?

I've had a good look around Guardian and the only way I can figure so far is a complicated set of calculations based around the 'the Money available to Back at a price for a selection' options but this seems to only allow me to gather the values for the first three back price positions so in the above example wouldn't capture the correct total and would store a value of only £18.03.
It is possible to store values outside the best three prices but to do it requires two SV's per price point
There's an example here that stores the 4th and 5th
viewtopic.php?f=56&t=26012
Thanks both.

I don't think this solution will work for me because it's for less liquid markets where prices will not be just one-tick apart. eg might be 3.0 / 2.95 / 2.7 / 2.2. I assume using -1 tick in this example it would still only capture the first three prices and fail to capture the 4th?
sionascaig
Posts: 1682
Joined: Fri Nov 20, 2015 9:38 am

jamesedwards wrote:
Sun Jun 25, 2023 1:49 pm

I don't think this solution will work for me because it's for less liquid markets where prices will not be just one-tick apart. eg might be 3.0 / 2.95 / 2.7 / 2.2. I assume using -1 tick in this example it would still only capture the first three prices and fail to capture the 4th?
No, you just keep on going... Not sure if there is a BA limit on number of SV's but would be surprised if you couldn't do at least 50 on each side.

I use it on gappy markets all the time (and sometimes its good to know there are gaps!)...
User avatar
jamesedwards
Posts: 4370
Joined: Wed Nov 21, 2018 6:16 pm

sionascaig wrote:
Sun Jun 25, 2023 1:55 pm
jamesedwards wrote:
Sun Jun 25, 2023 1:49 pm

I don't think this solution will work for me because it's for less liquid markets where prices will not be just one-tick apart. eg might be 3.0 / 2.95 / 2.7 / 2.2. I assume using -1 tick in this example it would still only capture the first three prices and fail to capture the 4th?
No, you just keep on going... Not sure if there is a BA limit on number of SV's but would be surprised if you couldn't do at least 50 on each side.

I use it on gappy markets all the time (and sometimes its good to know there are gaps!)...
Right I see. Bit worried how much this might slow down the rest of my automation (which includes automated TPD triggers so every ms is vital). Might do something limited to just the first three prices as that will capture most of the available value.

Thanks again both.
Post Reply

Return to “Bet Angel - Automation”