Recalculating Stake

Discuss anything related to using the program (eg. triggered betting tactics)

Moderator: 2020vision

Recalculating Stake

Postby philuk » Sun Jun 27, 2010 11:04 am

On the moment I am running BA 24 hours with success. Every morning at 8:00 am it reloads the markets etc...

No problems at all.

All I would like to know is , is there a way to use a function to recalculate my stake at about 8:05 am every morning ?

For example if the time reaches 8:05am then my stake must be recalculated at 0.0025 of my balance. ( Where my balance is on sheet 1 I2 )

The stake must then stay that amount for the whole day untill the following morning where it would recalculate it again for the days betting.

Hope it is clear enough :)

Thanx

Philip
philuk
 
Posts: 37
Joined: Tue Mar 02, 2010 12:55 am

Postby osknows » Mon Jun 28, 2010 9:13 pm

Possibly this would work for what you want to achieve

In the THISWORKBOOK object copy this code
Code: Select all
Private Sub Workbook_Open()
Application.OnTime TimeValue("08:05:00"), "calculate_stake"
End Sub


This sets a time to run a macro named 'calculate_stake' at 08:05:00


Then put something like this in a MACRO
Code: Select all
Private Sub calculate_stake()
Application.EnableEvents = False
Application.OnTime TimeValue("08:05:00"), "calculate_stake"

With ThisWorkbook.Sheets("Selections")

If .Range("m2").Value > .Range("n2").Value Then
.Range("n2").Value = .Range("m2").Value

ElseIf .Range("m2").Value <= (.Range("n2").Value) * (1 - Range("q2").Value) Then
.Range("n2").Value = .Range("m2").Value
End If


End With
Application.EnableEvents = True
End Sub


This sets the timer again when run and the code is set up for the following...
1. your stake info is on a worksheet named "Selections"
2. cell m2 is Current Bank
3. cell n2 is Max Bank
4. cel q2 is Stop at Loss x%

and performs the calc - if current bank is greater than max bank then max bank = current bank
or
if current bank is less than or equal to the stop loss amount adjust the max bank down to current bank
User avatar
osknows
 
Posts: 946
Joined: Wed Jul 29, 2009 12:01 am

Postby philuk » Mon Jun 28, 2010 11:30 pm

Thanx for that.

Just want to ask something

1. Will this code work out the stake for the next day ?
2. I see there is a stop loss in there..???


All it needs to do is at 8:05 am , look at my current balance and work out 0.0025 of it. ( example 100 * 0.0025 = 0.25 )

Meaning stake will be 25p for the day.

Following morning it will look again at balance and example it is 110 , then 110*0.0025 = 28p.

That will be the stake for the day that will be used, untill the next morning.

Cheers and thanx
:)
philuk
 
Posts: 37
Joined: Tue Mar 02, 2010 12:55 am

Postby osknows » Tue Jun 29, 2010 7:08 am

The code doesn't work out the stake. All it does is re-calcualte the max bank total at 08:05:00 every day

In my example

current bank (m2) is live and updates through the day
max bank (n2) only recalcs at 08:05:00

So if you base your stake on max bank (n2) then you will have a stake which remains constant until the next update
User avatar
osknows
 
Posts: 946
Joined: Wed Jul 29, 2009 12:01 am


Return to Discussion

Who is online

Users browsing this forum: No registered users and 38 guests

Sports betting software from Gruss Software


The strength of Gruss Software is that it’s been designed by one of you, a frustrated sports punter, and then developed by listening to dozens of like-minded enthusiasts.

Gruss is owned and run by brothers Gary and Mark Russell. Gary discovered Betfair in 2004 and soon realised that using bespoke software to place bets was much more efficient than merely placing them through the website.

Gary built his own software and then enhanced its features after trialling it through other Betfair users and reacting to their improvement ideas, something that still happens today.

He started making a small monthly charge so he could work on it full-time and then recruited Mark to help develop the products and Gruss Software was born.

We think it’s the best of its kind and so do a lot of our customers. But you can never stand still in this game and we’ll continue to improve the software if any more great ideas emerge.