Author Topic: Formula for Laying at certain % of the total payout  (Read 762 times)

Tags:
  • All members
  • Posts: 45
Hi,

Feel a little bit embarrassed to post such trivial question but I sort of fried my brain on the equations today. The idea is as follows:

I back selection at odds X and want to cash out for 65% of the predicted profit (in case the pick wins), examples:

I back under at 2.40. I want to green when the profit is 0.65*(2.40-1) = 0.65*1.40 = 0.91
Similarly, if I back at 9.00. I want to lay when the potential profit is 0.65*8 = 5.2 

I coded it this way, which I am not super happy about:

GREEN UP by ticks = 1
if selection trigger's expression is stake*(bm_backp-1)-(lay_price-1)*(bm_backp/(lay_price-0.05)*stake) is greater than 0.65*stake*(bm_backp-1)

So in general it works fine, but the problem is it waits for the lay_price to approach a certain value and if the market has poor liquidity I sometimes miss the green up opportunity.

What I would like to do is to place the appropriate lay bet shortly after the back bet has been matched and keep it there throughout the game. What would be the best way to do it?

Thank you,

LiAlH4 

  • Tim Vetrov
  • Administrator
  • Posts: 4725
  • Gender: Male
*
Re: Formula for Laying at certain % of the total payout
« Reply #1 on: 26 Nov 2021, 10:35 »
Have you tried "Attempt to greenup" trigger action?
I'm happy to help Monday - Friday, 08:00-18:00 GMT
Буду рад помочь с понедельника по пятницу, 08:00-18:00 GMT

  • All members
  • Posts: 45
Re: Formula for Laying at certain % of the total payout
« Reply #2 on: 26 Nov 2021, 10:49 »
Hi Tim,

Good suggestion! but I still do not know how to tell the program to attempt greening up for 65% of the payout

  • Tim Vetrov
  • Administrator
  • Posts: 4725
  • Gender: Male
*
Re: Formula for Laying at certain % of the total payout
« Reply #3 on: 26 Nov 2021, 12:55 »
Action: Attempt to greenup
Based on profit %: 100/ ( (bm_backp - 1) * 0.65)
Condition: Any selection's matched back is greater than 0
I'm happy to help Monday - Friday, 08:00-18:00 GMT
Буду рад помочь с понедельника по пятницу, 08:00-18:00 GMT

  • All members
  • Posts: 45
Re: Formula for Laying at certain % of the total payout
« Reply #4 on: 26 Nov 2021, 13:53 »
Fantastic! thank you!!!