Author Topic: Number of bets placed per strategy  (Read 1233 times)

Tags:
  • All members
  • Posts: 314
Number of bets placed per strategy
« on: 23 Jan 2020, 15:41 »
Hi,

I have a Back To Lay strategy, and my intention is to back 1 point at a high price, and lay 1 point at low price. The idea is to try to produce a profit, no matter what.

For each of the strategies I have, I want to find out how many bets were placed. The problem is that I have multiple strategies, so I cannot check the number of bets, because separate strategies have their own rules, so it has to be specific to a strategy.

Possible bets in a race can be 0, 1, 2, 3 or 4

I want to extract this number, so that I know how many points I need to place in the lay bet.

So, if we have 4 selections bet on a strategy, I place £1 back, at prices of 5, 10, 15, 20, I then place a lay bet of £4 on each of them, at odds of say 1.3. If we have 3 selections bet, then lay at £3, 2 selections £2, etc...

Is there a simple way to get the number of bets, in a particular strategy?

Hope all that makes sense?

Thanks

Mark.

  • Moderator
  • Posts: 3597
*
Re: Number of bets placed per strategy
« Reply #1 on: 23 Jan 2020, 18:48 »
Hi
My suggestion would be to user variables to increment a bet counter for each strategy.

bet_cntr1
bet_cntr2
etc.

start of market refresh
set user variable bet_cntr1 value: 0

add a second action to your backing trigger
set user variable bet_cntr1 value: bet_cntr1+1

this way it will increment bet counters separately according to when each backing trigger fires. when backing is finished use the value of bet_cntr1 for the lay bet for strategy 1
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: 314
Re: Number of bets placed per strategy
« Reply #2 on: 23 Jan 2020, 20:13 »
Hi MarkV,

Many thanks for your logical and clear explanation/suggestion.

I do potentially have an additional condition for this, and I am not sure how to do this with good logic...

we have bet_cntr1, which is reset to 0 at market refresh, and then we have the action to increment, from the trigger. Understood.

BUT

What if there is a condition that, in order to increment the counter, the back price must be above 3.0

The trigger bets on all selections from 2.5 to 300, but, if the price is below 3, there is no value in laying it, and so if we have 3 bets placed, and one of them is 2.5, then the lay bet will be £2  - so, rather than the bet_cntr1 being 3, it will be 2

Not sure how to do this?

My thinking is taking me all over... Have a variable called increment, whose value is bet_cntr1 + 1, but how do I call increment, to execute bet_cntr1 + 1?

thanks

Mark.

  • Moderator
  • Posts: 3597
*
Re: Number of bets placed per strategy
« Reply #3 on: 24 Jan 2020, 11:06 »
is each of the possible four unmatched back bets fired from individual triggers, or does one backing trigger send all the back bets at once?
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: 314
Re: Number of bets placed per strategy
« Reply #4 on: 24 Jan 2020, 12:26 »
My trigger fires once per selection. Single trigger for the backs. Selections come from a text file, back bet is conditional. See attached image. Its a simple trigger. I do get values from a spreadsheet, which you helped me with some time back, but this is all working fine

  • Moderator
  • Posts: 3597
*
Re: Number of bets placed per strategy
« Reply #5 on: 24 Jan 2020, 16:29 »
because the bet counter conditions are different from the betting trigger, you cannot count from the backing trigger. the only way I found to do it was a sequence of 4 triggers (one per back bet)

set user variable: bet_cntr1 value: bet_cntr1+1
condition: selections trigger expression bu_1_backp is greater than 3.00

set user variable: bet_cntr1 value: bet_cntr1+1
condition: selections trigger expression bu_2_backp is greater than 3.00

set user variable: bet_cntr1 value: bet_cntr1+1
condition: selections trigger expression bu_3_backp is greater than 3.00

set user variable: bet_cntr1 value: bet_cntr1+1
condition: selections trigger expression bu_4_backp is greater than 3.00

so variable bet_cntr1 will have the number of unmatched back bets greater than a price of 3.00 
  
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