Storing Profit/Loss at a selection level (horse racing)

Advanced automation available in Guardian - Chat with others and share files here.
User avatar
Dallas
Posts: 23101
Joined: Sun Aug 09, 2015 10:57 pm
Location: Working From Home

Jolissa wrote:
Thu May 16, 2024 2:27 am
Thanks for all the responses, guess I will have to park it for a while.

I'm a bit surprised that you cannot get the Profit or Loss result for an individual bet back as a stored value, but If I am reading correctly it's something we may have in the future.
It can store the P/L of each runner quite easily, it's separating that P/L and determining the amount of relating to different rules/stratergies that is the harder part as the P/L from Betfair for each selection is just one single total irrespective of how/where/when the bet/s were placed

There is ways around it like Anbell and Jimibt have mentioned above but unless it just separating a few straight forward bets it becomes very complicated very quickly to track them all
sniffer66
Posts: 1791
Joined: Thu May 02, 2019 8:37 am

jimibt wrote:
Thu May 16, 2024 9:00 am
Jolissa wrote:
Thu May 16, 2024 2:27 am
Thanks for all the responses, guess I will have to park it for a while.

I'm a bit surprised that you cannot get the Profit or Loss result for an individual bet back as a stored value, but If I am reading correctly it's something we may have in the future.
you could work around this by setting a sv on the selection when it's matched (for example back1, back2, back3.. etc). Then, you could have a rule that reconciles the p&l of the selection at an individual level, based on the sv (back1,2,3) being set. This could be done on a rule using the inplay time offset and reconciled when the market is suspended or closed. You'd set the condition to say:

If Back(n) is set and there are mathced bets for it, then grab the value of the greenup for selection total and add it to your running total for that strategy.

Fag packet analysis!! :)

Just to add to this Jim, this is also possible via the BA API, using the "selections win status" as a text Stored Value
I'm doing all my entry placement via the BA APi these days, and if you retain the selectionId, entry price in a dictionary, getting BA to save the win status (winner/loser) on market closure, you can do a GET request for any markets with that SV set, then match the status to the selectionId, you can calc P&L and save to a csv for that strat. That then gives you the possibility of a separate P&L for each strat, plus virtual banks, % staking etc etc ;)
User avatar
jimibt
Posts: 4088
Joined: Mon Nov 30, 2015 6:42 pm
Location: Narnia

sniffer66 wrote:
Wed May 22, 2024 3:08 pm
jimibt wrote:
Thu May 16, 2024 9:00 am
Jolissa wrote:
Thu May 16, 2024 2:27 am
Thanks for all the responses, guess I will have to park it for a while.

I'm a bit surprised that you cannot get the Profit or Loss result for an individual bet back as a stored value, but If I am reading correctly it's something we may have in the future.
you could work around this by setting a sv on the selection when it's matched (for example back1, back2, back3.. etc). Then, you could have a rule that reconciles the p&l of the selection at an individual level, based on the sv (back1,2,3) being set. This could be done on a rule using the inplay time offset and reconciled when the market is suspended or closed. You'd set the condition to say:

If Back(n) is set and there are mathced bets for it, then grab the value of the greenup for selection total and add it to your running total for that strategy.

Fag packet analysis!! :)

Just to add to this Jim, this is also possible via the BA API, using the "selections win status" as a text Stored Value
I'm doing all my entry placement via the BA APi these days, and if you retain the selectionId, entry price in a dictionary, getting BA to save the win status (winner/loser) on market closure, you can do a GET request for any markets with that SV set, then match the status to the selectionId, you can calc P&L and save to a csv for that strat. That then gives you the possibility of a separate P&L for each strat, plus virtual banks, % staking etc etc ;)
yeah, altho I'm aware of that (SelectionPriceInfoJSON?), i haven't implemented around it. It definitely is the BEST way to get the selections per strategy for sure. at a pure BA level, then that's obviously a tad more frustrating!
Post Reply

Return to “Bet Angel - Automation”