I have a new idea for a bot but am struggling to get the logic in the form of automation for the bot.
i will explain my scenario and see if anyone can help.
At the start of the day i set a stored value with the balance for that day.
i then have 4 stored values starting at -10,-20,-30 and -40.
i start off by placing a lay bet for a liability of £10.
if that wins the next market has the same starting stake and keeps going to a target profit of £100.
if it loses then i have lost £10. this triggers the first stored value of £-10 which is the original balance - 10.
What i would like to happen next is that the next stake is now £20 liability
and this remains so for the next 5 trades on 5 markets until 1 of 2 things happen.
Either the 5 trades are successful at which point it then reverts back to the initial stake of £10, or the 5 trades get to a profit position of (initial Balance + £5), and then reverts back, or there is a loss in that sequence of 5 trades.
if there is a loss , this sets another stored value at -20.
if that happens then the next trade is for a liability of £30 for another 5 trades or until the (new balance = balance +£5).
Does anyone have an idea how i would automate this in guardian?
Thanks
Bot Help
- MemphisFlash
- Posts: 2339
- Joined: Fri May 16, 2014 10:12 pm
Last edited by MemphisFlash on Wed Nov 11, 2020 7:01 am, edited 1 time in total.
be careful with this idea, even if you've paper traded it for days/weeks. this is just another form of martingale. any staking plan that attempts loss recovery is unfortunately not statistically sound. I have out of curiosity, examined similar apporaches and it can be quite frightening if you run a monte-carlo simulation against these loss recovery systems. others may offer more optimistic anecdotal opinions but i would be very wary.
if you have a genuine edge, then the variance is going to play out using flat stakes, but in the long run, it should run in line with your projections.
if you have a genuine edge, then the variance is going to play out using flat stakes, but in the long run, it should run in line with your projections.
Guardian Automation will never know if it won or lost the previous event - and you're an old hand so I'm sure you already know that. So if you are prepared to work with the limitation that which bet size your file is to use can only be determined by the current balance and that might not necessarily have had a winning settlement from a previous race.MemphisFlash wrote: ↑Tue Nov 10, 2020 10:56 pm.....Does anyone have an idea how i would automate this in guardian?
Thanks
I would do it with four separate bet instructions- one each for your £10, £20, £30 and £40 parameters
The conditions for each to include two Stored Value conditions for the balance with an upper limit and lower limit determined for that bet order by your stored values and a further condition on each that the number of bet triggers on the market is =0
There is a possible fudge around giving Guardian a "memory" or access to outside data that I'm using to some extent.
It is a liittle clunky but you can use a script to edit the baf directly, I load the baf into a one dimensional array so I can address by line number. You can then edit an SV value directly and save the file.Then by opening/closing the automation file in Guardian it will assign the SV value to any markets already applied to. As long as you don't force a save of the baf in Guardian it won't re-apply the baf and refresh everything - maybe not an issue if you arent gathering any data before the off and the market isnt in play
I use Auto-It as it can easily manipulate the Guardian window post edit, to do the open/close
Looks like this: (Where lines 6000-8000 contain the SV's you want to edit with a new value)
Local $BotArray = ""
Local $BotArray = FileReadToArray($BotFile2)
For $d = 6000 To 8000
If StringInStr($BotArray[$d], "Store: 'ATP' for the market") Then
If $ATPNewStringP2 <> "" Then
$BotArray[$d - 4] = $ATPNewStringP2
Else
$BotArray[$d - 4] = "/"
EndIf
If $ATPNewStringP1 <> "" Then
$BotArray[$d - 14] = $ATPNewStringP1
Else
$BotArray[$d - 14] = "/"
EndIf
_FileWriteFromArray($BotFile2, $BotArray)
It is a liittle clunky but you can use a script to edit the baf directly, I load the baf into a one dimensional array so I can address by line number. You can then edit an SV value directly and save the file.Then by opening/closing the automation file in Guardian it will assign the SV value to any markets already applied to. As long as you don't force a save of the baf in Guardian it won't re-apply the baf and refresh everything - maybe not an issue if you arent gathering any data before the off and the market isnt in play
I use Auto-It as it can easily manipulate the Guardian window post edit, to do the open/close
Looks like this: (Where lines 6000-8000 contain the SV's you want to edit with a new value)
Local $BotArray = ""
Local $BotArray = FileReadToArray($BotFile2)
For $d = 6000 To 8000
If StringInStr($BotArray[$d], "Store: 'ATP' for the market") Then
If $ATPNewStringP2 <> "" Then
$BotArray[$d - 4] = $ATPNewStringP2
Else
$BotArray[$d - 4] = "/"
EndIf
If $ATPNewStringP1 <> "" Then
$BotArray[$d - 14] = $ATPNewStringP1
Else
$BotArray[$d - 14] = "/"
EndIf
_FileWriteFromArray($BotFile2, $BotArray)
Last edited by sniffer66 on Wed Nov 11, 2020 9:39 am, edited 1 time in total.
Thanks Atho.
Have actually gone quite a bit further than that

Have the one script that downloads the days H2H Tennis stats from Patreon, loads them into Excel\arrays, runs a set formula to determine which players to set for each strat - Lay 1st set break, Lay Set 1 winner, Back the break down etc. It then updates the baf with all the permutations - using Market Name rules to determine Player position and sets the Player Gender (I tailor entries exits dependent on WTA/ATP). It then loads the days matches in Guardian, applies the baf to each then reads the log pane to determine which matches don't have a strat applied and deletes them.
The baf uses my in play tennis stat framework so as well as using prematch data, it also uses the in play data to determine the entries
One click at the start of the day and I'm set up and free to get on with other stuff

-
- Posts: 3140
- Joined: Sun Jan 31, 2010 8:06 pm
But does it win lots of moneysniffer66 wrote: ↑Wed Nov 11, 2020 11:33 amThanks Atho.
Have actually gone quite a bit further than that![]()
Have the one script that downloads the days H2H Tennis stats from Patreon, loads them into Excel\arrays, runs a set formula to determine which players to set for each strat - Lay 1st set break, Lay Set 1 winner, Back the break down etc. It then updates the baf with all the permutations - using Market Name rules to determine Player position and sets the Player Gender (I tailor entries exits dependent on WTA/ATP). It then loads the days matches in Guardian, applies the baf to each then reads the log pane to determine which matches don't have a strat applied and deletes them.
The baf uses my in play tennis stat framework so as well as using prematch data, it also uses the in play data to determine the entries
One click at the start of the day and I'm set up and free to get on with other stuff![]()

It wins enough to make me happyspreadbetting wrote: ↑Wed Nov 11, 2020 12:51 pmBut does it win lots of moneysniffer66 wrote: ↑Wed Nov 11, 2020 11:33 amThanks Atho.
Have actually gone quite a bit further than that![]()
Have the one script that downloads the days H2H Tennis stats from Patreon, loads them into Excel\arrays, runs a set formula to determine which players to set for each strat - Lay 1st set break, Lay Set 1 winner, Back the break down etc. It then updates the baf with all the permutations - using Market Name rules to determine Player position and sets the Player Gender (I tailor entries exits dependent on WTA/ATP). It then loads the days matches in Guardian, applies the baf to each then reads the log pane to determine which matches don't have a strat applied and deletes them.
The baf uses my in play tennis stat framework so as well as using prematch data, it also uses the in play data to determine the entries
One click at the start of the day and I'm set up and free to get on with other stuff![]()
![]()

- MemphisFlash
- Posts: 2339
- Joined: Fri May 16, 2014 10:12 pm
to give an idea of the guardian file i am try to create,
the screenshot shows a typical sequence of what i require.
there are no formulas in this sheet, this is just an example.
the screenshot shows a typical sequence of what i require.
there are no formulas in this sheet, this is just an example.
You do not have the required permissions to view the files attached to this post.