Running Daily Profit & Loss Total - Guardian Automation Bot

Post Reply
User avatar
Dallas
Posts: 22709
Joined: Sun Aug 09, 2015 10:57 pm
Location: Working From Home

This is a basic Guardian automation rule for use any and all types of markets

The purpose of the bot is to record your Profit/loss after each market once Betfair closes and settles the market, it will then keep a running total of your profit/loss throughout the day and write those to you Bet Angel log after each market closes

Here is an example of how it would look in your log after each race, there is a stored value for the profit/loss from that market, and below that a stored value with the total profit and loss for all todays markets so far

01/04/2022 13:30:04: [G_Auto 1] : Store Value (Shared) for Ami Desbois: Market_Profit = 15.78
01/04/2022 13:30:04: [G_Auto 1] : Store Value (Shared) for Bet Angel: Total_Profit = 15.78 + -6.53 = 9.25


I've created this as a bare template so it only goes as far as recording those values, its then up to you how you want to use those values.

For example if you just wanted to see what your daily total was so far you could just check on them in your log as shown above or you could display them on your One-Click, Ladder, Guardian trading screens etc (i'll be adding some ladder and one-click settings files to do this over the weekend)

Or you can use them as part of your parameters and/or conditions of other rules

NB; to use this settings profile you will need to be using the new Bet Angel v1.59 which can be downloaded from the following page which also contains full details of all new options and features which have been added
viewtopic.php?f=46&t=25251



How it works and using the Rules File
Once you have it imported into your Guardian you can edit those (or any other parts of the file) anyway you want or remove them and add your own rules to use the recent form very easily by clicking on "Edit Rules File".

Please refer to the 'Note' tab for a more detailed explanation on how each rule works and how it may be connected/linked to other rules within the file
Notes.JPG


Downloading and Importing the Files
To use the file just click on the 'Running Profit and Loss Total.baf' link below and that will download it to your computer, then with guardian open on the "Automation" tab click on a rules file as shown in the image, once imported it will now appear in the pick list area just above, you can now apply it to any markets you have added into guardian.

To see a video tutorial on how to download and import an automation file into your Bet Angel please see this link
https://www.youtube.com/watch?v=g7Im4pj683g
You do not have the required permissions to view the files attached to this post.
sniffer66
Posts: 1676
Joined: Thu May 02, 2019 8:37 am

Excellent Dallas - cheers for this. I started playing around with this myself a few days ago, looking at using P&L to compound automatically on a given strat. But this saves me having to finish it. I'll just nick yours :D

And I completely missed the new SV is Not Set Condition previously - that was the problem I was trying to get around. Makes life much easier
sniffer66
Posts: 1676
Joined: Thu May 02, 2019 8:37 am

This is excellent Dallas

Little compounding test laying the dogs.
Row 1 - P&L
Row 2 - Virtual bank
Row 3 - Stake @ 1% of virtual bank

Needs tidying and some row title text but works a treat. Bank is off to profit as I made some £'s before creating the bank SV

Capture.JPG
You do not have the required permissions to view the files attached to this post.
User avatar
Dallas
Posts: 22709
Joined: Sun Aug 09, 2015 10:57 pm
Location: Working From Home

sniffer66 wrote:
Tue Apr 05, 2022 4:25 pm
This is excellent Dallas

Little compounding test laying the dogs.
Row 1 - P&L
Row 2 - Virtual bank
Row 3 - Stake @ 1% of virtual bank

Needs tidying and some row title text but works a treat. Bank is off to profit as I made some £'s before creating the bank SV


Capture.JPG

Image


Looking good, nice thinking about creating a virtual balance to use
sniffer66
Posts: 1676
Joined: Thu May 02, 2019 8:37 am

Dallas wrote:
Tue Apr 05, 2022 4:28 pm
sniffer66 wrote:
Tue Apr 05, 2022 4:25 pm
This is excellent Dallas

Little compounding test laying the dogs.
Row 1 - P&L
Row 2 - Virtual bank
Row 3 - Stake @ 1% of virtual bank

Needs tidying and some row title text but works a treat. Bank is off to profit as I made some £'s before creating the bank SV


Capture.JPG

Image


Looking good, nice thinking about creating a virtual balance to use
I think I know the negative answer to this one Dallas, but thought I'd ask...

I've set up 2 horse strats with the same virtual bank, % of bank as stake etc and all working well. However, when both strats are on the same race then obviously the final P&L is a combination of both results , and both banks are updated with that figure, skewing the result.

Can you think of a way I can calc the result so I can apportion the right amount to each strats P&L ? Just to complicate things, one was an L2B and the other was a B2L - both greening in profit on its selection before the race ended. So had the same green result on every runner.
User avatar
Dallas
Posts: 22709
Joined: Sun Aug 09, 2015 10:57 pm
Location: Working From Home

sniffer66 wrote:
Thu Apr 07, 2022 9:08 am
Dallas wrote:
Tue Apr 05, 2022 4:28 pm
sniffer66 wrote:
Tue Apr 05, 2022 4:25 pm
This is excellent Dallas

Little compounding test laying the dogs.
Row 1 - P&L
Row 2 - Virtual bank
Row 3 - Stake @ 1% of virtual bank

Needs tidying and some row title text but works a treat. Bank is off to profit as I made some £'s before creating the bank SV


Capture.JPG

Image


Looking good, nice thinking about creating a virtual balance to use
I think I know the negative answer to this one Dallas, but thought I'd ask...

I've set up 2 horse strats with the same virtual bank, % of bank as stake etc and all working well. However, when both strats are on the same race then obviously the final P&L is a combination of both results , and both banks are updated with that figure, skewing the result.

Can you think of a way I can calc the result so I can apportion the right amount to each strats P&L ? Just to complicate things, one was an L2B and the other was a B2L - both greening in profit on its selection before the race ended. So had the same green result on every runner.
Are you running two instances of BA each from its own installation directory?
sniffer66
Posts: 1676
Joined: Thu May 02, 2019 8:37 am

No, but I dont think that will solve it either, as the market P&L data comes from BF ? I can place a trade with completely different software and that still shows up in the BA results.

The only option I can think of is to try and calc the amount won from within the baf, knowing entries\exits\amounts but think that's too complex to achieve.
User avatar
Dallas
Posts: 22709
Joined: Sun Aug 09, 2015 10:57 pm
Location: Working From Home

sniffer66 wrote:
Thu Apr 07, 2022 1:17 pm
No, but I dont think that will solve it either, as the market P&L data comes from BF ? I can place a trade with completely different software and that still shows up in the BA results.

The only option I can think of is to try and calc the amount won from within the baf, knowing entries\exits\amounts but think that's too complex to achieve.
Ahh ok, because you'd created a 'virtual' bank above I assumed you were using PM and just testing

It will be tricky to set up to sperate the two strategies, but if one is always going to be greened up before the other and you know roughly by what point, ie the B2L is always greened with in the first 0-30% of a race and the L2B in the second half sometime then it could be done

It would also depend if they both run together on several markets a day or if its just the odd one?
sniffer66
Posts: 1676
Joined: Thu May 02, 2019 8:37 am

Hi Dallas. I might just combine the two strats results and use a % as stake - far easier lol

On another note, I'm seeing intermittent occasions when the winner\loser status isnt returned, so the P&L is never calculated. My educated guess is BF havent returned that data when the "Winner" rule detects the Closed market, only running the once.
I've made a change to run that rule unlimited times, every 15s, until "result" is set with a value - tests well and think that should solve the above issue.

Stu


Winner Edit.baf
You do not have the required permissions to view the files attached to this post.
User avatar
Dallas
Posts: 22709
Joined: Sun Aug 09, 2015 10:57 pm
Location: Working From Home

sniffer66 wrote:
Fri Apr 08, 2022 10:53 am
Hi Dallas. I might just combine the two strats results and use a % as stake - far easier lol

On another note, I'm seeing intermittent occasions when the winner\loser status isnt returned, so the P&L is never calculated. My educated guess is BF havent returned that data when the "Winner" rule detects the Closed market, only running the once.
I've made a change to run that rule unlimited times, every 15s, until "result" is set with a value - tests well and think that should solve the above issue.

Stu



Winner Edit.baf
Cheers for the heads up, I hadn't noticed any issues with it getting the winner status so far but makes sense to trigger it a few times just to be sure so think I'll adjust mine now while its fresh in my head
Roobetter
Posts: 43
Joined: Wed Jun 23, 2021 12:48 pm

Im getting an error when i try and import into Guardian. It says it was created with a different version of Bet Angel and not compatible. Im using version 1.58.
User avatar
ShaunWhite
Posts: 9731
Joined: Sat Sep 03, 2016 3:42 am

Roobetter wrote:
Tue May 03, 2022 3:05 pm
Im getting an error when i try and import into Guardian. It says it was created with a different version of Bet Angel and not compatible. Im using version 1.58.
https://www.betangel.com/download/
User avatar
Dallas
Posts: 22709
Joined: Sun Aug 09, 2015 10:57 pm
Location: Working From Home

Roobetter wrote:
Tue May 03, 2022 3:05 pm
Im getting an error when i try and import into Guardian. It says it was created with a different version of Bet Angel and not compatible. Im using version 1.58.
You need to be using the latest V1.59
https://www.betangel.com/download/?product=BetAngelPro
gareth75
Posts: 35
Joined: Wed Nov 23, 2011 8:35 pm

Hi Dallas
Please ignore my stupidness but cant quite workout how or where I find the running profit / loss by using the imported file (Running profit and loss total) . I can see the logs, matched bets and profit and loss files, but when I open them up cannot find where the running total is ? I'm guessing I haven't set it up correctly. Where am i going wrong.? Do I Put the Profit Loss import file in the automation 1 circled in the photo? But that then takes over from the automation file I have there? I'm obviously missing something simple?

Thanks
gareth75
Posts: 35
Joined: Wed Nov 23, 2011 8:35 pm

Dallas wrote:
Fri Apr 01, 2022 1:47 pm
This is a basic Guardian automation rule for use any and all types of markets

The purpose of the bot is to record your Profit/loss after each market once Betfair closes and settles the market, it will then keep a running total of your profit/loss throughout the day and write those to you Bet Angel log after each market closes

Here is an example of how it would look in your log after each race, there is a stored value for the profit/loss from that market, and below that a stored value with the total profit and loss for all todays markets so far

01/04/2022 13:30:04: [G_Auto 1] : Store Value (Shared) for Ami Desbois: Market_Profit = 15.78
01/04/2022 13:30:04: [G_Auto 1] : Store Value (Shared) for Bet Angel: Total_Profit = 15.78 + -6.53 = 9.25


I've created this as a bare template so it only goes as far as recording those values, its then up to you how you want to use those values.

For example if you just wanted to see what your daily total was so far you could just check on them in your log as shown above or you could display them on your One-Click, Ladder, Guardian trading screens etc (i'll be adding some ladder and one-click settings files to do this over the weekend)

Or you can use them as part of your parameters and/or conditions of other rules

NB; to use this settings profile you will need to be using the new Bet Angel v1.59 which can be downloaded from the following page which also contains full details of all new options and features which have been added
viewtopic.php?f=46&t=25251



How it works and using the Rules File
Once you have it imported into your Guardian you can edit those (or any other parts of the file) anyway you want or remove them and add your own rules to use the recent form very easily by clicking on "Edit Rules File".

Please refer to the 'Note' tab for a more detailed explanation on how each rule works and how it may be connected/linked to other rules within the file
Notes.JPG



Downloading and Importing the Files
To use the file just click on the 'Running Profit and Loss Total.baf' link below and that will download it to your computer, then with guardian open on the "Automation" tab click on a rules file as shown in the image, once imported it will now appear in the pick list area just above, you can now apply it to any markets you have added into guardian.

To see a video tutorial on how to download and import an automation file into your Bet Angel please see this link
https://www.youtube.com/watch?v=g7Im4pj683g
Hi Dallas
Please ignore my stupidness but cant quite workout how or where I find the running profit / loss by using the imported file (Running profit and loss total) . I can see the logs, matched bets and profit and loss files, but when I open them up cannot find where the running total is ? I'm guessing I haven't set it up correctly. Where am i going wrong.? Do I Put the Profit Loss import file in the automation 1 circled in the photo? But that then takes over from the automation file I have there? I'm obviously missing something simple?
betangel3.JPG
You do not have the required permissions to view the files attached to this post.
Post Reply

Return to “Bet Angel Automation - General”