Author Topic: moving average of faves winning  (Read 5753 times)

Tags:
  • All members
  • Posts: 405
moving average of faves winning
« on: 15 May 2014, 14:58 »
Hi,

I started a topic about this in the triggered betting section, but Mcbee suggested that I posted a request here instead.

I'm trying to create a trigger to monitor how often the favourite has won in the last 10 races.  I basically only want to look at the results from the previous 10 races, so this figure will be dynamic as each day progresses:

I'll try and give an example to explain further:

1st 10 races of the day the fave wins 4 races spread through the 10 races:

Race 1  Race 2  Race 3  Race 4  Race 5  Race 6  Race 7  Race 8  Race 9  Race 10
Win       Win       Loose     Loose      Win      Loose    Win      Loose     Loose     Loose

so, in the first 10 races the fave has won 4 out of 10 races, so 40% of the previous 10 races

The fave then looses both race 11 and race 12 of the day:

Race1  Race 2  Race 3  Race 4  Race 5  Race 6  Race 7  Race 8  Race 9  Race10  Race 11 Race 12
Win       Win      Loose      Loose    Win      Loose   Win    Loose      Loose    Loose     Loose      Loose

so, in the last 10 races the fave has now only won 2 out of the previous 10 races, so 20% of the previous 10 races.

I'm trying to just work out the number of winners in the previous 10 races, but that figure is constantly evolving.

Mcbee suggested that I would need 10 variables to record the wins/losses and have them advance after 10 races, so variable 1 would be a new figure, variable 2 would take the value of variable 1 etc all the way down to variable 10 which would take the value of variable 9.

I could then get an percentage of how many races the fave had won in the previous 10 races using the formula (winners/races)*100

Hope that's enough info, and thanks for you help

  • Élite
  • Posts: 3698
  • Gender: Male
*
Re: moving average of faves winning
« Reply #1 on: 18 May 2014, 11:49 »
hi
working on the trigger now


mcbee
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.

  • Administrator
  • Posts: 8821
  • Gender: Female
*
Re: moving average of faves winning
« Reply #2 on: 18 May 2014, 13:15 »
Hi mcbee,

Sorry to intrude, but since there was no response in this topic I decided to help with this, so I have the triggers ready.

armarni, please see the file attached. The solution does not look elegant, but it works, so that's something. Like mcbee suggested, you need 10 variables to hold the previous result (i.e. whether the favourite has won or lost). When you get to the end of the sequence, these values get shifted, so that the first variable contains the result of the second, the second - the result of the third and so on. In the end you sum up these variables to get the number of races where the favourite has won.

This number will be stored in wins_counter.

If you are going to use these triggers in combination with yours, then add this block on top of your triggers and query the wins_counter in your trigger expressions.

I also want to add that this has been a great mental exercise as the task turned out to be non-trivial!
Always try your triggers in Test Mode before switching to real money!

Follow us on Twitter.

Join our WhatsApp chat!

Присоединяйтесь к официальному Telegram-каналу!

  • All members
  • Posts: 405
Re: moving average of faves winning
« Reply #3 on: 18 May 2014, 13:34 »
Hi Oxa

Thanks for your effort on this, I'll incorporate it now.  It was tying me up in knots trying to get my head around how to do it, so I  appreciate your time on it.

And thanks to Mcbee as well for starting to work on it as well.

Hopefully other people will find a use for it as well in their strategies.

  • All members
  • Posts: 405
Re: moving average of faves winning
« Reply #4 on: 22 May 2014, 07:55 »
Please be aware that while this works very well in test mode, I had to tweak it to work in live mode.  For some reason the trigger doesn't register a win when the market is settled in live mode.

I found the only way around this was to put in a live bet and then it would register the win.

Hope that helps anybody whose stuck.

  • Administrator
  • Posts: 8821
  • Gender: Female
*
Re: moving average of faves winning
« Reply #5 on: 08 Jun 2014, 05:50 »
Hi armarni,

Did the white "WINNER" label appear in the live markets where you were testing the triggers?
Always try your triggers in Test Mode before switching to real money!

Follow us on Twitter.

Join our WhatsApp chat!

Присоединяйтесь к официальному Telegram-каналу!

  • All members
  • Posts: 169
Re: moving average of faves winning
« Reply #6 on: 08 Jun 2014, 21:36 »

Oxa (WellDoneSoft) i like your trigger. Well done. Its possible add the folowing:

Number of lost in a row for the present moment:
Number of win in a row for the present moment:
Max nº of win in a row:
Max n0 of lost in a row:

Thanks

  • All members
  • Posts: 405
Re: moving average of faves winning
« Reply #7 on: 09 Jun 2014, 08:32 »
Hi Oxa

In test mode the white winner label came up instantly the market settled from betfairs RSS feed.  In live mode however, the winner label comes up after the market has settled, approximately 20 seconds later.

I dont have any market or bet refreshes set anywhere near as long as 20 seconds so I think its a betfair side issue.

  • Administrator
  • Posts: 8821
  • Gender: Female
*
Re: moving average of faves winning
« Reply #8 on: 27 Jun 2014, 10:01 »
Oxa (WellDoneSoft) i like your trigger. Well done. Its possible add the folowing:
Hi Angelito,

Please make a new tirgger request for additional changes.
Always try your triggers in Test Mode before switching to real money!

Follow us on Twitter.

Join our WhatsApp chat!

Присоединяйтесь к официальному Telegram-каналу!

  • All members
  • Posts: 1
Re: moving average of faves winning
« Reply #9 on: 24 Nov 2014, 08:46 »
Hi, I like the way this trigger works, but when I add a back trigger which refers to wins_cntr it does not trigger. Can anyone help? Many thanks.
I have attached a screenshot.

  • Administrator
  • Posts: 8821
  • Gender: Female
*
Re: moving average of faves winning
« Reply #10 on: 25 Nov 2014, 09:26 »
As always, bring in the logs from the trigger.
Always try your triggers in Test Mode before switching to real money!

Follow us on Twitter.

Join our WhatsApp chat!

Присоединяйтесь к официальному Telegram-каналу!

 

Please note, BetFair is seems to be currently OFFLINE