Cancel unmatched lay bet if best back price is greater?

Advanced automation available in Guardian - Chat with others and share files here.
Post Reply
Fugazi
Posts: 935
Joined: Wed Jan 10, 2024 7:20 pm

I want to cancel bet if the current best back price is higher than my unmatched lay bet. Easiest way to do this?
sionascaig
Posts: 1676
Joined: Fri Nov 20, 2015 9:38 am

Fugazi wrote:
Thu Sep 19, 2024 9:23 pm
I want to cancel bet if the current best back price is higher than my unmatched lay bet. Easiest way to do this?
- Capture the price at which your unmatched bet is placed as a SV
- Use the "Cancel Bets" rule for everything <= the SV, if back price > SV

I usually set a signal when the bet is placed & reset it when the cancel bet rule runs, so it only places a bet if signal not set and only cancels if signal set.
Fugazi
Posts: 935
Joined: Wed Jan 10, 2024 7:20 pm

sionascaig wrote:
Thu Sep 19, 2024 9:54 pm
Fugazi wrote:
Thu Sep 19, 2024 9:23 pm
I want to cancel bet if the current best back price is higher than my unmatched lay bet. Easiest way to do this?
- Capture the price at which your unmatched bet is placed as a SV
- Use the "Cancel Bets" rule for everything <= the SV, if back price > SV

I usually set a signal when the bet is placed & reset it when the cancel bet rule runs, so it only places a bet if signal not set and only cancels if signal set.
From that, I realised I can set it in conditions directly of cancel bets.. Save the number of unmatched lay bets at best back price. Then cancel if unmatched bets at best back price = 0

edit: Ah. Now it seems to cancel quicker than its able to register there is a bet there.
sionascaig
Posts: 1676
Joined: Fri Nov 20, 2015 9:38 am

Fugazi wrote:
Thu Sep 19, 2024 10:22 pm

edit: Ah. Now it seems to cancel quicker than its able to register there is a bet there.
That is where the signal helps.. Also an unmatched bets > 0 condition..

... I'm assuming you picked that up )
Fugazi
Posts: 935
Joined: Wed Jan 10, 2024 7:20 pm

sionascaig wrote:
Fri Sep 20, 2024 8:50 am
Fugazi wrote:
Thu Sep 19, 2024 10:22 pm

edit: Ah. Now it seems to cancel quicker than its able to register there is a bet there.
That is where the signal helps.. Also an unmatched bets > 0 condition..

... I'm assuming you picked that up )
Unmatched bets less than 0? How come not equal to zero?

Ive never used signals so was avoiding it but best I learn how 😅
sionascaig
Posts: 1676
Joined: Fri Nov 20, 2015 9:38 am

Fugazi wrote:
Fri Sep 20, 2024 9:14 am

Unmatched bets less than 0? How come not equal to zero?
Unmatched bet amounts (I should have said) > 0 for the "cancel" rule... No point in it running if nothing to cancel...

It also helps if you have partial matches, the price moves away & you want to cancel residual amounts before a rinse & repeat (although, obviously the amount you are cancelling could be greater than 0 in that case)... Fill / kill also handy in these cases, depending on what you are doing & how long you want bets up for...
Fugazi
Posts: 935
Joined: Wed Jan 10, 2024 7:20 pm

sionascaig wrote:
Fri Sep 20, 2024 9:40 am
Fugazi wrote:
Fri Sep 20, 2024 9:14 am

Unmatched bets less than 0? How come not equal to zero?
Unmatched bet amounts (I should have said) > 0 for the "cancel" rule... No point in it running if nothing to cancel...

It also helps if you have partial matches, the price moves away & you want to cancel residual amounts before a rinse & repeat (although, obviously the amount you are cancelling could be greater than 0 in that case)... Fill / kill also handy in these cases, depending on what you are doing & how long you want bets up for...
I want my bet gone when someone overtake me. BUT a condition I have set for my bet placement means I can't just use "back price greater than 1 second ago" type thing

Never thought about the residual amounts!

Fill/kill ive been using as an interim but isn't as efficient that way
sionascaig
Posts: 1676
Joined: Fri Nov 20, 2015 9:38 am

Fugazi wrote:
Fri Sep 20, 2024 9:52 am

I want my bet gone when someone overtake me. BUT a condition I have set for my bet placement means I can't just use "back price greater than 1 second ago" type thing
Being at the front of the queue & cancelling bets when the price moves away can become a bit of a challenge when you have to deal with spoofing etc but at a simple level just do as above, i.e.

When the bet is placed capture the price is placed in the bet placement rule, say SV = "BetPrice"

AND

Use the Cancel rule with a condition that Best Back Price > BetPrice when you want to remove it.

Once you get that running then need to deal with someone else placing small amounts above you (do you want to jump ahead or not depending on size) and the situation when the money below you disappears and leaves you exposed...

Expect to spend a lot of time on developing / testing )
Fugazi
Posts: 935
Joined: Wed Jan 10, 2024 7:20 pm

sionascaig wrote:
Fri Sep 20, 2024 10:16 am
Fugazi wrote:
Fri Sep 20, 2024 9:52 am

I want my bet gone when someone overtake me. BUT a condition I have set for my bet placement means I can't just use "back price greater than 1 second ago" type thing
Being at the front of the queue & cancelling bets when the price moves away can become a bit of a challenge when you have to deal with spoofing etc but at a simple level just do as above, i.e.

When the bet is placed capture the price is placed in the bet placement rule, say SV = "BetPrice"

AND

Use the Cancel rule with a condition that Best Back Price > BetPrice when you want to remove it.

Once you get that running then need to deal with someone else placing small amounts above you (do you want to jump ahead or not depending on size) and the situation when the money below you disappears and leaves you exposed...

Expect to spend a lot of time on developing / testing )
I suspect you're already using an almost identical .baf to me regarding when the money below disappears. I just need to fix my bet being left on the ladder and make sure I cancel efficiently rather than kill/fill.

Will have a play with the settings youve suggested above later on today
Fugazi
Posts: 935
Joined: Wed Jan 10, 2024 7:20 pm

sionascaig wrote:
Fri Sep 20, 2024 8:50 am
Fugazi wrote:
Thu Sep 19, 2024 10:22 pm

edit: Ah. Now it seems to cancel quicker than its able to register there is a bet there.
That is where the signal helps.. Also an unmatched bets > 0 condition..

... I'm assuming you picked that up )
Just realised what you meant. No I wanted to set it as unmatched bets at best back price =0 . If my unmatched bet is at the best back price I want ot to stay there. However, is someone jumps ahead of me, then unmatched bets at best back price would now =0 and therefore cancel my unmatched bet which is now sitting at 2nd best back price
Post Reply

Return to “Bet Angel - Automation”