Author Topic: Selections p/l after event is settled  (Read 82176 times)

Tags:
  • All members
  • Posts: 32
  • Gender: Male
Selections p/l after event is settled
« on: 13 May 2024, 12:45 »
Hey,

So I'm trying to use the selections settled p/l in calculations but can't seem to get it working. I have different bets on the 1st 4 faves so I can't use the market settled p/l for these calculations. It has to be specific to the runner so I'm trying to calculate a running total pl for each selection so it should start at 0 and then plus whatever the settled pl is for that runner. I've tried using selections profit/loss conditions and selections trigger expression profit/loss but these don't work so I'm assuming you can't use these for settled markets. Any idea how I can calculate the settled p/l for each selection? Cheers.

  • Moderator
  • Posts: 3641
*
Re: Selections p/l after event is settled
« Reply #1 on: 16 May 2024, 11:10 »
Hi
selection p/l is not available in settled markets, but here is something you can play with which will capture p/l just before market is settled:

in the settings make sure show p/l net of exchange commission is unticked

set a user variable with value: tradeout_pl individually per selection
once per market
market status: in-play or suspended
conditions:
at least one selections lay price is equal to 1.01
and markets race status is finished

you can change or add conditions as to when you best want to record the p/l's but the user variable should show each selections p/l after the market has been settled  
Please read the following disclaimer with regards to the information you may request and obtain on our forum. This specifically concerns trigger files and various instructions as to how to implement a strategy.

  • All members
  • Posts: 32
  • Gender: Male
Re: Selections p/l after event is settled
« Reply #2 on: 16 May 2024, 14:01 »
Hi
selection p/l is not available in settled markets, but here is something you can play with which will capture p/l just before market is settled:

in the settings make sure show p/l net of exchange commission is unticked

set a user variable with value: tradeout_pl individually per selection
once per market
market status: in-play or suspended
conditions:
at least one selections lay price is equal to 1.01
and markets race status is finished

you can change or add conditions as to when you best want to record the p/l's but the user variable should show each selections p/l after the market has been settled  
Hey, thanks for the reply. So if I set this up on the first 4 runners. Effectively, it would take the current p/l for the runner if the lay odds are 1.01 when the market is finished meaning the runner has secured victory so then I can use this to calculate my running total p/l for each selection? So I can do that for calculations after a win. For losses, would I set up the same trigger but have conditions for market is finished and tradeout_pl for selection is < 0??

  • Moderator
  • Posts: 3641
*
Re: Selections p/l after event is settled
« Reply #3 on: 16 May 2024, 18:20 »
Hi
I thought it would be a good idea but looking closer it wont work because a selection's p/l can be affected by other selections with bets. I will give this some more thought and post here if I come up with something.
Please read the following disclaimer with regards to the information you may request and obtain on our forum. This specifically concerns trigger files and various instructions as to how to implement a strategy.

  • All members
  • Posts: 32
  • Gender: Male
Re: Selections p/l after event is settled
« Reply #4 on: 17 May 2024, 03:04 »
Hi
I thought it would be a good idea but looking closer it wont work because a selection's p/l can be affected by other selections with bets. I will give this some more thought and post here if I come up with something.
 Could I not work out the p/l on the runner by taking the tradeout_pl and then adding the other bets. so if my variables are bet_1, bet_2, bet_3, bet_4 in relation to each fave then if the runner I'm taking the p/l for is the 3rd fave. Could I not do tradeout_pl on the 3rd fave + bet_1 + bet_2 + bet_4 which will give me the p/l for the 3rd fave.
So if the 3rd fave wins and the market is finished and the profit on the 3rd fave is £10. My bets for 1st, 2nd, and 4th fave are all £1 then if I were to just take tradeout_pl, it should equal £7 but if I add all them bets back on, I should get £10.

  • All members
  • Posts: 32
  • Gender: Male
Re: Selections p/l after event is settled
« Reply #5 on: 17 May 2024, 03:08 »
Another option could be to set up a virtual bankroll for each runner and have conditions to only trigger if that runner reaches 1.01 lay price then it can take market_settled_pl and also only add to the virtual bank if the new amount would be higher than the old amount. Then again, the other runners would affect p/l so would need to add the bets back on anyways.

  • Moderator
  • Posts: 3641
*
Re: Selections p/l after event is settled
« Reply #6 on: 17 May 2024, 16:04 »
Hi
Not tested this but if you are backing in win markets, the selection who's lay price is 1.01 is the potential winner, all other selections with back bets are potential losers.

so 2 triggers:

1st trigger as above, first matching selection, condition: selections lay price is equal to 1.01

2nd trigger sets a user variable individually per selection value: -back_matched
all matching selections
conditions:
trigger 1st trigger number of runs in the market is greater than 0
and selections back matched is greater than 0
and selections back price is equal or greater than greater than 1.01

this records the winners profit and assumes the liability for the others as a loss 

I don't think this is watertight because a lay price of 1.01 can still be overturned, or the market could be reopened after suspension etc. and also it does not take into account commission on the winning bets.
Please read the following disclaimer with regards to the information you may request and obtain on our forum. This specifically concerns trigger files and various instructions as to how to implement a strategy.

  • All members
  • Posts: 32
  • Gender: Male
Re: Selections p/l after event is settled
« Reply #7 on: 18 May 2024, 02:24 »
Hi
Not tested this but if you are backing in win markets, the selection who's lay price is 1.01 is the potential winner, all other selections with back bets are potential losers.

so 2 triggers:

1st trigger as above, first matching selection, condition: selections lay price is equal to 1.01

2nd trigger sets a user variable individually per selection value: -back_matched
all matching selections
conditions:
trigger 1st trigger number of runs in the market is greater than 0
and selections back matched is greater than 0
and selections back price is equal or greater than greater than 1.01

this records the winners profit and assumes the liability for the others as a loss

I don't think this is watertight because a lay price of 1.01 can still be overturned, or the market could be reopened after suspension etc. and also it does not take into account commission on the winning bets.
Hi, I'll keep this in mind for future strategies. just another question. If I have multiple instances running different strategies on the same event. Would each instance show the p/l for each selection on every instance or only on the instance with that specific strategy? I've just back tested the strategy I'm currently using and it only seems effective on the favourite so I won't be using this strategy on the 2nd, 3rd, 4th faves as planned so I can use market profit/loss for the strategy but I may run other strategies alongside it on the same event so would these instances interfere with each other by showing the selection p/l from all strategies?

  • Moderator
  • Posts: 3641
*
Re: Selections p/l after event is settled
« Reply #8 on: 18 May 2024, 07:29 »
Hi
In the Betting Options settings there is a setting to ignore all bets except those in the current profile. This works well for bets that have not yet been settled, but after a market has been settled it's bets will be added to the statement which includes all bets from all sources. See the description for this setting in the help file for more info.    
Please read the following disclaimer with regards to the information you may request and obtain on our forum. This specifically concerns trigger files and various instructions as to how to implement a strategy.

 

Please note, BetFair is seems to be currently OFFLINE