Calculating Percentage of Liability

Advanced automation available in Guardian - Chat with others and share files here.
Post Reply
sniffer66
Posts: 1666
Joined: Thu May 02, 2019 8:37 am

I have a set of rules that are laying by liability to a fixed stake. At a certain point I'm trading out x% of that liability using a back, calculating the amount by using the current P&L on that player

Which works fine for the first lay but I can't work out how to calculate that percentage when I have an existing +/- figure in the player P&L before I make the lay. I can't use last matched bet info as that gives the amount matched, not the liability. I only want to remove liability from the last lay, not overall.

Anyone point me in the right direction ?
sniffer66
Posts: 1666
Joined: Thu May 02, 2019 8:37 am

Just came to me that I could save the P&L to an SV prior to the lay then calculate the difference between before and after. That should result in the liability for the last lay - if my thinking is correct. Would need to take into account postive or minus figures.
Anbell
Posts: 2004
Joined: Fri Apr 05, 2019 2:31 am

sniffer66 wrote:
Thu Sep 17, 2020 5:26 pm
Just came to me that I could save the P&L to an SV prior to the lay then calculate the difference between before and after. That should result in the liability for the last lay - if my thinking is correct. Would need to take into account postive or minus figures.
Or lay price * fixed stake?
sniffer66
Posts: 1666
Joined: Thu May 02, 2019 8:37 am

Anbell wrote:
Fri Sep 18, 2020 2:47 am
sniffer66 wrote:
Thu Sep 17, 2020 5:26 pm
Just came to me that I could save the P&L to an SV prior to the lay then calculate the difference between before and after. That should result in the liability for the last lay - if my thinking is correct. Would need to take into account postive or minus figures.
Or lay price * fixed stake?

Don't think I explained that well in my OP. It's a fixed liability so the stake is variable, based on the price I lay at - BA does that calc when it lays to liability. I can't see how to capture the amount though, apart from the above
User avatar
Dallas
Posts: 22674
Joined: Sun Aug 09, 2015 10:57 pm
Location: Working From Home

Just to be sure I've understood

After laying to a liability you want to take out a % (which works fine)

But then you want to lay again for a liability and repeat the process above taking out a % of that latest lay liability (effectively ring fencing each entry/exit) and not look at the overall P/L after taking a % out then placing a second lay?
sniffer66
Posts: 1666
Joined: Thu May 02, 2019 8:37 am

Dallas wrote:
Fri Sep 18, 2020 10:50 am
Just to be sure I've understood

After laying to a liability you want to take out a % (which works fine)

But then you want to lay again for a liability and repeat the process above taking out a % of that latest lay liability (effectively ring fencing each entry/exit) and not look at the overall P/L after taking a % out then placing a second lay?
Spot on Dallas. So I need to calc the % of liability for the latest lay. Only way I can think to do it is snapshot (via SV) the "before" P&L and calc the difference between "before" and "now"
User avatar
Dallas
Posts: 22674
Joined: Sun Aug 09, 2015 10:57 pm
Location: Working From Home

sniffer66 wrote:
Fri Sep 18, 2020 10:53 am
Dallas wrote:
Fri Sep 18, 2020 10:50 am
Just to be sure I've understood

After laying to a liability you want to take out a % (which works fine)

But then you want to lay again for a liability and repeat the process above taking out a % of that latest lay liability (effectively ring fencing each entry/exit) and not look at the overall P/L after taking a % out then placing a second lay?
Spot on Dallas. So I need to calc the % of liability for the latest lay. Only way I can think to do it is snapshot (via SV) the "before" P&L and calc the difference between "before" and "now"
That's how it would need to be done.
The way i'd do it is to store the P/L with the lay rule, then run a SV rule afterwards (with whatever conditions needed to ensure the previous lay has been matched) to store the new P/L
Then minus the first SV from that leaving you with the new P/L from that lay
sniffer66
Posts: 1666
Joined: Thu May 02, 2019 8:37 am

Dallas wrote:
Fri Sep 18, 2020 11:10 am
sniffer66 wrote:
Fri Sep 18, 2020 10:53 am
Dallas wrote:
Fri Sep 18, 2020 10:50 am
Just to be sure I've understood

After laying to a liability you want to take out a % (which works fine)

But then you want to lay again for a liability and repeat the process above taking out a % of that latest lay liability (effectively ring fencing each entry/exit) and not look at the overall P/L after taking a % out then placing a second lay?
Spot on Dallas. So I need to calc the % of liability for the latest lay. Only way I can think to do it is snapshot (via SV) the "before" P&L and calc the difference between "before" and "now"
That's how it would need to be done.
The way i'd do it is to store the P/L with the lay rule, then run a SV rule afterwards (with whatever conditions needed to ensure the previous lay has been matched) to store the new P/L
Then minus the first SV from that leaving you with the new P/L from that lay
Great, thanks. At least I know there's not an easy way to do it before going off :)
sniffer66
Posts: 1666
Joined: Thu May 02, 2019 8:37 am

Dallas wrote:
Fri Sep 18, 2020 11:10 am
sniffer66 wrote:
Fri Sep 18, 2020 10:53 am
Dallas wrote:
Fri Sep 18, 2020 10:50 am
Just to be sure I've understood

After laying to a liability you want to take out a % (which works fine)

But then you want to lay again for a liability and repeat the process above taking out a % of that latest lay liability (effectively ring fencing each entry/exit) and not look at the overall P/L after taking a % out then placing a second lay?
Spot on Dallas. So I need to calc the % of liability for the latest lay. Only way I can think to do it is snapshot (via SV) the "before" P&L and calc the difference between "before" and "now"
That's how it would need to be done.
The way i'd do it is to store the P/L with the lay rule, then run a SV rule afterwards (with whatever conditions needed to ensure the previous lay has been matched) to store the new P/L
Then minus the first SV from that leaving you with the new P/L from that lay
Actually Dallas, this is where History Lists really come into their own. I have a lot of lay rules in this automation. Rather than edit each I can just create a rule that saves the P&L every second. Then compare the P&L from Now and x seconds ago. If they differ, the lay has been matched, run the calc on the liability and save that to an SV

The new functionality has really opened up some possibilities I hadnt even thought of.
Post Reply

Return to “Bet Angel - Automation”