Author Topic: recorded highest balance and placing bets based on this  (Read 31615 times)

Tags:
  • All members
  • Posts: 46
  • Gender: Male
Hey,

I'm trying to increase or reset stakes based on what my highest recorded balance is. So if I start with £200 at £1 stakes. If my new balance after a bet is higher than the highest recorded balance then my stake will reset to £1. If my balance is decreasing, the stake is increased by £1 and then reset when the new balance is higher than the recorded balance.

I've managed to set it up so that it records the highest balance when I start the program (either current balance or a manual balance adjustment which I can enter in case the program resets) and I can record the highest balance after a win by using the initial balance amount and IF(current balance>highest balance, current balance, highest balance) but the problem comes after this because I need it to keep taking the new highest balance but not sure how to do this without making tons of variables for highest balance (max_bal1, max_bal2, max_bal3... so on) and then a long winded IF statement for increasing the stake. Any ideas on how I can record the highest balance and then if the highest balance is greater than the previous highest balance, stake = £1, if not then stake = previous stake + £1?? Below is a table of bets of what I'm looking to achieve. Cheers.

           
Bet #Date/TimeMarketWinning BetMax BalanceUnit PriceUnitsStakeBack PriceLay PriceIf WinsIf LosesP/L (AC)Starting BalanceEnding Balance
101/01/2023 13:08Horse Racing - Calendar / 2023 / January 2023 / 01 (Sun) / Tramore / Tramore 01/01/2023 12:55 2m Mdn Hrd - 2m Mdn HrdBack£200.00£1.001.00£1.001.251.26£0.25-£1.00£0.25£200.00£200.25
201/01/2023 13:20Horse Racing - Calendar / 2023 / January 2023 / 01 (Sun) / Cheltenham / Cheltenham 01/01/2023 13:10 2m4f Mdn Hrd - 2m4f Mdn HrdBack£200.25£1.001.00£1.002.402.42£1.37-£1.00£1.37£200.25£201.62
301/01/2023 13:34Horse Racing - Calendar / 2023 / January 2023 / 01 (Sun) / Musselburgh / Musselburgh 01/01/2023 13:25 1m7f Juv Hrd - 1m7f Juv HrdBack£201.62£1.001.00£1.002.672.69£1.64-£1.00£1.64£201.62£203.25
401/01/2023 13:47Horse Racing - Calendar / 2023 / January 2023 / 01 (Sun) / Fakenham / Fakenham 01/01/2023 13:35 3m5f Hcap Chs - 3m5f Hcap ChsLay£203.25£1.001.00£1.003.253.30£2.21-£1.00-£1.00£203.25£202.25
501/01/2023 14:00Horse Racing - Calendar / 2023 / January 2023 / 01 (Sun) / Fairyhouse / Fairyhouse 01/01/2023 13:50 2m4f Mdn Hrd - 2m4f Mdn HrdBack£203.25£1.002.00£2.003.603.65£5.10-£2.00£5.10£202.25£207.35
601/01/2023 14:16Horse Racing - Calendar / 2023 / January 2023 / 01 (Sun) / Tramore / Tramore 01/01/2023 14:05 2m6f Mdn Hrd - 2m6f Mdn HrdLay£207.35£1.001.00£1.001.821.83£0.80-£1.00-£1.00£207.35£206.35
701/01/2023 14:31Horse Racing - Calendar / 2023 / January 2023 / 01 (Sun) / Cheltenham / Cheltenham 01/01/2023 14:20 2m4f Grd2 Nov Chs - 2m4f Grd2 Nov ChsLay£207.35£1.002.00£2.002.682.70£3.29-£2.00-£2.00£206.35£204.35
801/01/2023 14:44Horse Racing - Calendar / 2023 / January 2023 / 01 (Sun) / Musselburgh / Musselburgh 01/01/2023 14:35 2m4f Hcap Chs - 2m4f Hcap ChsBack£207.35£1.003.00£3.003.603.65£7.64-£3.00£7.64£204.35£211.99
901/01/2023 14:54Horse Racing - Calendar / 2023 / January 2023 / 01 (Sun) / Fakenham / Fakenham 01/01/2023 14:45 2m5f Nov Hcap Chs - 2m5f Nov Hcap ChsLay£211.99£1.001.00£1.004.404.50£3.33-£1.00-£1.00£211.99£210.99
1001/01/2023 15:12Horse Racing - Calendar / 2023 / January 2023 / 01 (Sun) / Fairyhouse / Fairyhouse 01/01/2023 15:00 3m Hcap Hrd - 3m Hcap HrdLay£211.99£1.002.00£2.005.305.40£8.43-£2.00-£2.00£210.99£208.99
1101/01/2023 15:26Horse Racing - Calendar / 2023 / January 2023 / 01 (Sun) / Tramore / Tramore 01/01/2023 15:15 2m6f Grd3 Chs - 2m6f Grd3 ChsLay£211.99£1.003.00£3.001.871.88£2.56-£3.00-£3.00£208.99£205.99
1201/01/2023 15:41Horse Racing - Calendar / 2023 / January 2023 / 01 (Sun) / Cheltenham / Cheltenham 01/01/2023 15:30 2m4f Grd2 Hrd - 2m4f Grd2 HrdLay£211.99£1.004.00£4.004.404.50£13.33-£4.00-£4.00£205.99£201.99
1301/01/2023 15:56Horse Racing - Calendar / 2023 / January 2023 / 01 (Sun) / Musselburgh / Musselburgh 01/01/2023 15:45 1m7f Hcap Hrd - 1m7f Hcap HrdLay£211.99£1.005.00£5.004.204.30£15.68-£5.00-£5.00£201.99£196.99
1401/01/2023 16:11Horse Racing - Calendar / 2023 / January 2023 / 01 (Sun) / Catterick / Catterick 01/01/2023 16:00 3m1f Hcap Chs - 3m1f Hcap ChsLay£211.99£1.006.00£6.002.402.42£8.23-£6.00-£6.00£196.99£190.99
1501/01/2023 16:26Horse Racing - Calendar / 2023 / January 2023 / 01 (Sun) / Exeter / Exeter 01/01/2023 16:15 2m3f Hcap Chs - 2m3f Hcap ChsBack£211.99£1.007.00£7.005.105.20£28.13-£7.00£28.13£190.99£219.12
1601/01/2023 16:41Horse Racing - Calendar / 2023 / January 2023 / 01 (Sun) / Fakenham / Fakenham 01/01/2023 16:30 3m Hcap Chs - 3m Hcap ChsLay£219.12£1.001.00£1.002.752.77£1.72-£1.00-£1.00£219.12£218.12
1701/01/2023 17:24Horse Racing - Calendar / 2023 / January 2023 / 01 (Sun) / Fairyhouse / Fairyhouse 01/01/2023 16:45 2m INHF - 2m INHFLay£219.12£1.002.00£2.001.791.80£1.55-£2.00-£2.00£218.12£216.12
1801/01/2023 17:54Horse Racing - Calendar / 2023 / January 2023 / 01 (Sun) / Southwell / Southwell 01/01/2023 17:26 5f Nov Stks - 5f Nov StksLay£219.12£1.003.00£3.003.903.95£8.53-£3.00-£3.00£216.12£213.12
1901/01/2023 18:24Horse Racing - Calendar / 2023 / January 2023 / 01 (Sun) / Southwell / Southwell 01/01/2023 17:56 5f Hcap - 5f HcapLay£219.12£1.004.00£4.004.704.80£14.50-£4.00-£4.00£213.12£209.12
2001/01/2023 18:54Horse Racing - Calendar / 2023 / January 2023 / 01 (Sun) / Southwell / Southwell 01/01/2023 18:26 5f Hcap - 5f HcapLay£219.12£1.005.00£5.004.304.40£16.17-£5.00-£5.00£209.12£204.12
2102/01/2023 13:21Horse Racing - Calendar / 2023 / January 2023 / 01 (Sun) / Southwell / Southwell 01/01/2023 18:56 1m3f Hcap - 1m3f HcapBack£219.12£1.006.00£6.004.84.90£22.34-£6.00£22.34£204.12£226.46
2202/01/2023 13:29Horse Racing - Calendar / 2023 / January 2023 / 02 (Mon) / Lingfield / Lingfield 02/01/2023 13:23 1m Hcap - 1m HcapLay£226.46£1.001.00£1.003.63.65£2.55-£1.00-£1.00£226.46£225.46
2302/01/2023 13:43Horse Racing - Calendar / 2023 / January 2023 / 02 (Mon) / Plumpton / Plumpton 02/01/2023 13:30 2m4f Nov Chs - 2m4f Nov ChsBack£226.46£1.002.00£2.001.141.15£0.27-£2.00£0.27£225.46£225.74
2402/01/2023 13:56Horse Racing - Calendar / 2023 / January 2023 / 02 (Mon) / Ayr / Ayr 02/01/2023 13:45 2m4f Nov Hrd - 2m4f Nov HrdLay£226.46£1.003.00£3.001.391.40£1.15-£3.00-£3.00£225.74£222.74
2502/01/2023 14:13Horse Racing - Calendar / 2023 / January 2023 / 02 (Mon) / Plumpton / Plumpton 02/01/2023 14:00 2m Nov Hrd - 2m Nov HrdLay£226.46£1.004.00£4.001.71.71£2.74-£4.00-£4.00£222.74£218.74
2602/01/2023 14:27Horse Racing - Calendar / 2023 / January 2023 / 02 (Mon) / Ayr / Ayr 02/01/2023 14:15 2m4f Hcap Hrd - 2m4f Hcap HrdLay£226.46£1.005.00£5.006.957.15£29.16-£5.00-£5.00£218.74£213.74
2702/01/2023 14:43Horse Racing - Calendar / 2023 / January 2023 / 02 (Mon) / Plumpton / Plumpton 02/01/2023 14:30 2m4f Nov Hrd - 2m4f Nov HrdBack£226.46£1.006.00£6.001.391.40£2.29-£6.00£2.29£213.74£216.03
2802/01/2023 14:58Horse Racing - Calendar / 2023 / January 2023 / 02 (Mon) / Ayr / Ayr 02/01/2023 14:45 3m Hcap Chs - 3m Hcap ChsBack£226.46£1.007.00£7.002.682.70£11.52-£7.00£11.52£216.03£227.56
2902/01/2023 15:13Horse Racing - Calendar / 2023 / January 2023 / 02 (Mon) / Plumpton / Plumpton 02/01/2023 15:00 2m4f Hcap Hrd - 2m4f Hcap HrdLay£227.56£1.001.00£1.003.253.30£2.21-£1.00-£1.00£227.56£226.56

  • Moderator
  • Posts: 3653
*
Re: recorded highest balance and placing bets based on this
« Reply #1 on: 08 May 2024, 17:14 »
Hi
Record the maximum balance in a user variable once per market:

set user variable
name: max_bal
globally
value: balance
condition: selections trigger expression balance is greater than max_bal
once per market

max_bal will always be the maximum recorded balance and you can use this for the betting stake IF statement 

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: 46
  • Gender: Male
Re: recorded highest balance and placing bets based on this
« Reply #2 on: 09 May 2024, 02:44 »
Hi
Record the maximum balance in a user variable once per market:

set user variable
name: max_bal
globally
value: balance
condition: selections trigger expression balance is greater than max_bal
once per market

max_bal will always be the maximum recorded balance and you can use this for the betting stake IF statement

After spending all day yesterday trying to come up with a solution and then thinking about it all night at work, I finally had a lightbulb moment and realised I need a condition to only adjust max_bal if a new highest balance has been reached but then I was stuck at work and couldn't program it :o Finally home now so gonna get started ;D Cheers, least I know it will definitely work!!

 

Please note, BetFair is seems to be currently OFFLINE