Author Topic: [TR] BSP Betting  (Read 2922 times)

Tags:
  • All members
  • Posts: 314
[TR] BSP Betting
« on: 18 Oct 2016, 10:34 »
Hi,

I have a trigger in place, which I think is working, BUT, when I compare my results with ACTUAL BSP, they don't match, this is because I have set my bets to go between low_toff and high_toff, and of course, this will not be the same as BSP. The very basic requirement is that I want the conditions checked for the bet and if matched AT BSP, place the bet.

I am attaching my current trigger, and I really would like to keep the constants intact, and hopefully, the changes you make will just be to set the bet to be placed at or close to BSP, AND for the the odds to be within the limits set by the constants. If you have to use 'best' for this to work, that's fine.

I have 2 strategies, called RTBK and RTBG, the names are not important, but they are 2 separate strategies.


RTBK has 3 separate sections, ALL bet when Market Minutes before the off is between low_toff and high_toff, at which point the conditions are checked and if matched, the bet is placed. The idea is to leave everything as it is, but instead of using low_toff and high_toff, I want the conditions checked for the actual_sp value, and if they meet, place the bet, and perhaps take the best odds value... Maybe needs discussion?
ALL use the selections file : RTBK_SWL.txt
Section 1 :
RTBK_Low = 6.51
RTBK_High = 11.50
Lay selection from file at odds between RTBK_Low and RTBK_High
Bet amount = bank_RTBK * perc_RTBK
Currently betting at the price when time is between low_toff and high_toff - I want to place the bet at SP

Section 2 :
RTBK1_Low = 13.01
RTBK1_High = 19.00
Lay selection from file at odds between RTBK_Low and RTBK_High
Bet amount = bank_RTBK * perc_RTBK
Currently betting at the price when time is between low_toff and high_toff - I want to place the bet at SP

Section 3 :
RTBK1_Low = 22.01
RTBK1_High = 55.00
Lay selection from file at odds between RTBK_Low and RTBK_High
Bet amount = (bank_RTBK * perc_RTBK_liab) / (lay_price - 1)  - this is a liability bet amount, set at 8.5%
Currently betting at the price when time is between low_toff and high_toff - I want to place the bet at SP

The same goes for RTBG, but there are 4 of these, using 7.01 - 11, 13.01 - 16, 24.01 - 45, and 55.01 - 200, the last 2 using liability staking...

Have a look at the attached trigger, of course, any feedback welcome on my coding is welcome, but I generally code in this way so that I can easily follow it.

Thanks

Mark.

  • All members
  • Posts: 314
Re: BSP Betting
« Reply #1 on: 18 Oct 2016, 11:52 »
Here are todays selections - if someone looks at this today.....

  • Élite
  • Posts: 3698
  • Gender: Male
*
Re: BSP Betting
« Reply #2 on: 18 Oct 2016, 12:47 »
hi
the only way to get as close as possible to bsp is to place the bet just after the off , if you are happy with this then i will alter and test the trigger.

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.

  • Élite
  • Posts: 3698
  • Gender: Male
*
Re: BSP Betting
« Reply #3 on: 18 Oct 2016, 12:50 »
hi
or i could use an average of the back and lay price , this does get close to the bsp most times.

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.

  • All members
  • Posts: 314
Re: BSP Betting
« Reply #4 on: 19 Oct 2016, 11:10 »
hi mcbee,

please, first, accept that I am no expert in the mechanics of how betfair do BSP, so, my discussion below may have a lot of errors.

I have developed a couple of strategies, based on my own database of selections, which I compile myself, and I have discovered, over a reasonable period, the odds ranges specified in the triggers boundaries, actually produce some amazing results, BUT, the results are based on BSP values, which I get from the site : https://promo.betfair.com/betfairsp/prices/     which give the actual recorded values of BSP.


To be honest, I would like you to use what you think is best. I can't honestly say which approach I would prefer you to use, because of my lack of experience, so to speak. What is VITALLY important, is that the ACTUAL BSP, satisfies the criteria specified. I understand that this statement is kind of skewed, because, as you said in a previous post to me, BSP has to be calculated and after the processing, it is shown, so, in that respect, I understand that my logging of the results based on historical data will not match exactly.

As for placing the bet, I am not sure if it should use 'best' ? Maybe needs discussion?

It is unlikely I will be asking for many triggers, and so, for this one, just go ahead and do what you consider the best approach.

I would of course prefer you to keep my constants intact, and so, I can then adjust them as time goes by, as their respective price values will change.

Thanks

Mark.

  • All members
  • Posts: 314
Re: BSP Betting
« Reply #5 on: 19 Oct 2016, 11:11 »
before I forget, here are todays selections.....

  • Élite
  • Posts: 3698
  • Gender: Male
*
Re: BSP Betting
« Reply #6 on: 19 Oct 2016, 13:11 »
hi
here is your trigger, i have removed 2 constants , all other constants and values are as previous.
no bet placed in the 13:40 due to prices.

please use test mode until you are happy with your settings

mcbee

download the trigger below
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: BSP Betting
« Reply #7 on: 19 Oct 2016, 14:00 »
Hi mcbee,

thanks for the trigger update.

I have been informed that betfair will only allow a minimum liability of £10, when using BSP.

I have a standard bank of £100, and I am using 0.085 (8.5%) as a liability stake in RTBG 24.01 - 45 / 55.01 - 200  and RTBK uses 0.085 liability - will this be allowed, by doing it like this? I think this is just placing a bet, rather than telling Betfair its a liability based on BSP?

I would ideally like to see some bets matched using the odds range specified at the higher end, and possibly, in the same race, where different selections satisfy the criteria...

I will run it for the rest of today, on test, and see how it goes..

Thanks again

Mark.

  • All members
  • Posts: 314
Re: BSP Betting
« Reply #8 on: 19 Oct 2016, 14:25 »
hi mcbee,

the trigger did not place a bet, at the expected BSP price, see image....

Mark.

  • Élite
  • Posts: 3698
  • Gender: Male
*
Re: BSP Betting
« Reply #9 on: 19 Oct 2016, 17:12 »
hi
i checked the triggers and there was a conflict with your constants for the 24.01 - 45.00 trigger.
you had   (bank_RTBG * perc_RTBG_liab) / (lay_price - 1)
but you have already used perc_RTBG as a constant by adding the _liab it caused a conflict .
i have changed the perc_RTBG_liab to perc_RTBG1_liab and it calculates ok now.
please note that if there are any more error's in your formula or constants , you will have to make a new request to correct them if you cannot do it yourself.

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.

  • All members
  • Posts: 314
Re: BSP Betting
« Reply #10 on: 19 Oct 2016, 18:32 »
ok,

I truly hope I have not misunderstood you....

so, if I have understood you correct, if I use perc_RTBG as a constant, which contains a value, I cannot use a separate constant called perc_RTBG_liab, because it has the extra characters '_liab' in its defined name?

if this is true, I am flabbergasted! in all my years as a software engineer, primarily coding in C/C++/C#, I have never had this restriction! In fact, I don't know ANY language that has this kind of restriction. If I want to use a variable called A, and I also want to use another variable called A_, and then a further one called A_A, and use them all in the same calculation, then I should be free to do this, and not receive some compile time error that tells me I can't extend an already existing variable with extra characters, because this is not allowed.

I would really like to get an explanation and a technical explanation as to why two constants, with different names, should conflict with each other?

perc_RTBG IS NOT perc_RTBG_liab, just like A_A is not A_A_B, and yet, if I used these in MFP, as per the trigger, they would conflict?

Surely you can appreciate how crazy that is?

again, if I have understood you correct - the mind boggles at how MFP can actually do this?

With all due respect, mcbee, the error is not in my constants/formula, with respect to this issue, it is with MFP, and should be fixed by the developers of this software.

I still don't know if this has 'fixed' the problem, but I will test it tomorrow.

  • Élite
  • Posts: 3698
  • Gender: Male
*
Re: BSP Betting
« Reply #11 on: 20 Oct 2016, 05:57 »
hi
the value in perc_RTBG already contains a value , by adding _liab the result was 0.0085_liab and this is not a true value , thus a conflict was created.
personally i never use the _ separator.

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.

  • All members
  • Posts: 314
Re: BSP Betting
« Reply #12 on: 20 Oct 2016, 07:59 »
ok, maybe I did misunderstand you?

BUT, as for the original setup, in the constants section, I HAD the following:
perc_RTBG = 0.0085. As you know, this will be the equivalent of an 0.85% multiplicand if used in a calculation.
perc_RTBG_liab = 0.05, which again, if used as a multiplicand, is the equivalent of 5%, as per the liability bet

in the RTBG 24.01 - 45.00 trigger, the beginning of Amount calculation formula is given as bank_RTBG * perc_RTBG_liab, which, when the actual numbers are put in, will give 100.00 * 0.05, producing a result of 5. If we continue, arbitrarily, with a lay price of 11, then the whole result, should be calculated as per my formula construct, as (100 * 0.05) / (11 - 1), which will produce a final result of 0.5, or, in staking terms, £0.50, or 50p. At no point, was perc_RTBG used?

as per your comment on never using the '_' separator, this is simply a preference. I ALWAYS define a private variable, beginning with an underscore, such as _xyz, and then define a public property using xyz, because that is my preference (most developers will use this approach), we are all different, and using it this way suits me. It does not mean it is incorrect, or even bad practice. Unless there are some rules inside MFP that will not allow '_', there is nothing wrong in my constant naming, its just simply not your preference.

I really cannot see how you have observed that my formula has produced '0.0085_liab'

I will of course apologise if I have made a stupid mistake, but I have gone through the original mft file you sent me back, and I cannot see any mistake that will produce this.

I have defined a number of constants, one of them is called perc_RTBG_liab, which has a value of 0.05, another, perc_RTBG, has a value of 0.0085. There is nowhere in ANY part of ANY of these triggers, where I have ADDED perc_RTBG_liab to perc_RTBG, and even if there was, by adding perc_RTBG_liab to perc_RTBG, this would simply produce 0.0585, because 0.05 + 0.0085 = 0.0585, and definitely NOT '0.0085_liab'

Could you please show me how you have come to the conclusion that '0.0085_liab' has been produced?

I appreciate this is not constructive work, but I am being informed that I have made a mistake, and I cannot see how this mistake you have observed, is actually happening.

I have attached an annotated image, which looks fine to me....

I have no problem admitting my faults, and yes, I have made some really stupid mistakes in my development history, but I honestly cannot see the mistake that will produce this value, which you have noted as incorrect. Please show me, and then I will stop this mithering...

Thanks

Mark.

  • Élite
  • Posts: 3698
  • Gender: Male
*
Re: BSP Betting
« Reply #13 on: 20 Oct 2016, 15:54 »
hi
perc_RTBG is used in the constants , it is given a value , so it is used.
i am sorry but i do not know the reason why mixing predefined variables with other variable names give an incorrect value.
the trigger did not fire so i simply used logic to find out why and i came up with the error, renamed the variable , tested the variable and it gave a correct value.
i can on say what i see.

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.

 

Please note, BetFair is seems to be currently OFFLINE